Summary
Taking or opening a position means buying or selling a trading pair.
Syntax
public interface Position
Members
Name | Type | Summary |
---|---|---|
Close | Method | Shortcut for the Robot.ClosePosition method. |
Comment | Property | Comment can be used as a note for the order. |
Commissions | Property | Commission Amount of the request to trade one way (Buy/Sell) associated with this position. |
EntryPrice | Property | Entry price of the position. |
EntryTime | Property | Entry time of trade associated with the position. The Timezone used is set in the cBot attribute. |
GrossProfit | Property | Gross profit accrued by the order associated with the position. |
HasTrailingStop | Property | When HasTrailingStop set to true, the server updates the Stop Loss every time the position moves in your favor. |
Id | Property | The position's unique identifier. |
Label | Property | Label can be used to represent the order. |
ModifyStopLossPips | Method | Shortcut for the Robot.ModifyPosition method to change the Stop Loss pips |
ModifyStopLossPrice | Method | Shortcut for Robot.ModifyPosition method to change the Stop Loss. |
ModifyTakeProfitPips | Method | Shortcut for the Robot.ModifyPosition method to change the Take Profit pips |
ModifyTakeProfitPrice | Method | Shortcut for Robot.ModifyPosition method to change the Take Profit. |
ModifyTrailingStop | Method | Shortcut for the Robot.ModifyPosition method to change the Trailing Stop. |
ModifyVolume | Method | Shortcut for the Robot.ModifyPosition method to change the VolumeInUnits. |
NetProfit | Property | The Net profit of the position. |
Pips | Property | Represents the winning or loosing pips of the position. |
Quantity | Property | Quantity of lots traded by the position. |
Reverse | Method | Shortcut for the Robot.ReversePosition method to change the direction of the trade. |
StopLoss | Property | The Stop Loss level of the position. |
StopLossTriggerMethod | Property | Trigger method for the position's Stop Loss. |
Swap | Property | Swap is the overnight interest rate if any, accrued on the position. |
SymbolCode | Property | Symbol code of the position. |
TakeProfit | Property | The take profit level of the position. |
TradeType | Property | Trade type (Buy/Sell) of the position. |
VolumeInUnits | Property | The amount traded by the position. |
Example 1
protected override void OnStart() { foreach (var position in Positions) { Print("Position Label {0}", position.Label); Print("Position ID {0}", position.Id); Print("Profit {0}", position.GrossProfit); Print("Entry Price {0}", position.EntryPrice); } }