Class Position
Represents trading information about related position
Namespace: TradingPlatform.BusinessLayer
Syntax
public class Position : TradingObject, IConnectionBindedObject, IUniqueID
Properties
CurrentPrice
The market price obtainable from your broker.
Declaration
public double CurrentPrice { get; }
Property Value
Type | Description |
---|---|
System.Double |
Fee
Gets fee amount for the position.
Declaration
public PnLItem Fee { get; }
Property Value
Type | Description |
---|---|
TradingPlatform.BusinessLayer.PnLItem |
GrossPnL
Gets 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.
Declaration
public PnLItem GrossPnL { get; }
Property Value
Type | Description |
---|---|
TradingPlatform.BusinessLayer.PnLItem |
GrossPnLTicks
Returns ticks amount between open and current price.
Declaration
public double GrossPnLTicks { get; }
Property Value
Type | Description |
---|---|
System.Double |
NetPnL
Gets 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.
Declaration
public PnLItem NetPnL { get; }
Property Value
Type | Description |
---|---|
TradingPlatform.BusinessLayer.PnLItem |
OpenPrice
Gets position open order price
Declaration
public double OpenPrice { get; }
Property Value
Type | Description |
---|---|
System.Double |
OpenTime
Gets position openning time
Declaration
public DateTime OpenTime { get; }
Property Value
Type | Description |
---|---|
System.DateTime |
Quantity
Gets position quantity value
Declaration
public double Quantity { get; }
Property Value
Type | Description |
---|---|
System.Double |
StopLoss
Gets StopLoss order which belongs to the position
Declaration
public Order StopLoss { get; }
Property Value
Type | Description |
---|---|
Order |
Swaps
Gets PnL swaps
Declaration
public PnLItem Swaps { get; }
Property Value
Type | Description |
---|---|
TradingPlatform.BusinessLayer.PnLItem |
TakeProfit
Gets TakeProfit order which belongs to the position
Declaration
public Order TakeProfit { get; }
Property Value
Type | Description |
---|---|
Order |
Methods
Close(Double)
Closes position if quantity is not specified else - uses partial closing operation.
Declaration
public TradingOperationResult Close(double CloseQuantity = -1)
Parameters
Type | Name | Description |
---|---|---|
System.Double | CloseQuantity |
Returns
Type | Description |
---|---|
TradingPlatform.BusinessLayer.TradingOperationResult |
Events
Updated
Will be triggered on each TradingPlatform.BusinessLayer.Position.UpdateByMessage(TradingPlatform.BusinessLayer.Integration.MessageOpenPosition) and TradingPlatform.BusinessLayer.Position.UpdatePnl(TradingPlatform.BusinessLayer.PnL) invocation
Declaration
public event Action<Position> Updated
Event Type
Type | Description |
---|---|
System.Action<Position> |