GetUnrealizedProfitLoss()
<< Click to Display Table of Contents >> GetUnrealizedProfitLoss() |
Calculates the unrealized PnL for the strategy position.
A double value representing the unrealized PnL.
Position.GetUnrealizedProfitLoss(PerformanceUnit unit, [double price])
Note: If no double argument is provided in the call, the current Last price will be substituted in. In case Tools > Options > Trading > 'Use last price for Pnl' is unchecked or the instrument type is Forex / CFD the bid (for a long position) / ask (for a short position) would be used as substitute. |
unit |
Possible values: PerformanceUnit.Percent PerformanceUnit.Pips PerformanceUnit.Points PerformanceUnit.Ticks |
price |
Price used to calculate the PnL such as Close[0]. This value is used as the current price and compared against your entry price for the PnL. |
protected override void OnBarUpdate() |