You need to enable JavaScript in order to visit our site!
 
Logo PTMC
NAVIGATION
CANCEL
 
or via PTMC account
Restore password
or via PTMC account
Logo PTMC
NAVIGATION
or via PTMC account
Restore password
or via PTMC account
or via PTMC account
Restore password
or via PTMC account

Position

class
The Position object holds data related to position.

Properties

Account Account Gives access to all information of the account that opened the position.
Amount double Value of the position in lots.
CloseOrderId string ID of closing order (if postion was closed).
ClosePrice double Closing position price (for closed positions).
CloseTime DateTime Time when position was closed (for closed positions).
Comment string Returns comment for the selected position.
CurrentPrice double The market price obtainable from your broker.
Exp1 double Returns amount of base instrument part on which your position is open. Fixing when position was open.
Exp1Close double Returns amount of base instrument part on which your position is open.
Exp2 double Returns amount of counter instrument part on which your position is open. Fixing when position was open. The Exposure calculated using the amount and cross price.
Exp2Close double Returns amount of counter instrument part on which your position is open. For open position recalculating occurs after every new quote. If position close - return exposition fixing when position was close. The Exposure calculated using the amount and cross price.
GroupId long The ID of the position group. This group created when position opened by the MAM account.
Id string A unique number that the trading system assigns to each position.
Instrument Instrument Represents the information of instrument for position.
IsGroupPart bool Return true when position was sent by MAM account.
MagicNumber int Returns a magic number of chosen position.
OpenOrderId string Order number that opened a position. Unique number that the trading system assigns to each order. If a position opens based on an order, the position's OpenOrderId property will return the same number.
OpenPrice double Price at which the position was opened.
OpenTime DateTime Date and time the position was opened.
Side Operation Operation with which the position was opened (BUY or SELL).
StopLossOrder Order Provide acess to Stop Loss order of the current position or null if it isn't exist.
TakeProfitOrder Order Provide acess to Take Profit order of the current order or null if it isn't exist.

Methods

Close () Return: bool Close position.
Close (double amount) Return: bool Close part of the position.
Close (double amount, double price, int marketRange) Return: bool Close position with price change control
CloseAsync (Action<bool> callback) Return: bool Close position asynchronously.
CloseAsync (double amount, Action<bool> callback) Return: bool Close part of the position asynchronously.
CloseAsync (double amount, double price, int marketRange, Action<bool> callback) Return: bool Close position with price change control asynchronously
GetCommission (Currency currency) Return: double Commission amount for the position.
GetExposition (Currency currency) Return: double Returns amount of counter instrument part on which your position is open. For open position recalculating occurs after every new quote. If position close - return exposition fixing when position was close. The Exposure calculated using the amount and cross price.
GetProfitExp2 () Return: double Profit/loss calculated based on the current broker's price in counter currency.
GetProfitGross (Currency currency) Return: double Profit/loss (without swaps or commissions) all calculated based on the current broker's price. For open position it shows the profit/loss you would make if you close the position at the current price. If position closed, this parameter show profit/loss what trader have after closing this position.
GetProfitNet (Currency currency) Return: double Profit/loss calculated based on the current broker's price. For open position it shows the profit/loss you would make if you close the position at the current price. If position closed, this parameter show profit/loss what trader have after closing this position.
GetSwaps (Currency currency) Return: double Amounts collected/paid out by your broker when a position is rolled over to a new value date.
GetUsedMargin (Currency currency) Return: double Initial margin for opened position.
RemoveStopLoss () Return: bool Removes current stop-loss order
RemoveStopLossAsync (Action<bool> callback) Return: bool Removes current stop-loss order asynchronously
RemoveTakeProfit () Return: bool Removes current take-profit order
RemoveTakeProfitAsync (Action<bool> callback) Return: bool Removes current take-profit order asynchronously
Rollback () Return: bool Rollback position. This operation is allowed only for accounts with MasterPosition function and
SetStopLoss (double slPrice) Return: bool Sets a new (modifies existed) stop-loss order
SetStopLossAsync (double slPrice, Action<bool> callback) Return: bool Sets a new (modifies existed) stop-loss order asynchronously
SetStopLossTrail (double slPrice) Return: bool Sets a new (modifies existed) stop-loss order with trailing
SetStopLossTrailAsync (double slPrice, Action<bool> callback) Return: bool Sets a new (modifies existed) stop-loss order with trailing asynchronously
SetTakeProfit (double tpPrice) Return: bool Sets a new (modifies existed) take-profit order
SetTakeProfitAsync (double tpPrice, Action<bool> callback) Return: bool Sets a new (modifies existed) take-profit order asynchronously
PTMC is a professional trading platform that combines all the best charting and analytical tools to trade on different financial markets. It is developed by PFSOFT UK LTD, a global provider of trading technology for banks & brokers
© 2024. PTMC is based on Protrader technology
PFSOFT UK LTD
71-75, Shelton Street,
Covent Garden,
London, WC2H9SQ,
United Kingdom
Support & Development
PFSOFT Ukraine
Office #701
Mechnikova Street, 10B
49000, Dnipro, Ukraine
Contact us
Phone: +380 56 740 30 01
E-mail: info@protrader.org
Skype: PTMC_support
Find more ways to contact
Join us in social networks