double currentPrice = (Position.MarketPosition == MarketPosition.Long) ? GetCurrentBid() : GetCurrentAsk();
Print ("currentPrice="+currentPrice );
double currentProfit = Position.GetUnrealizedProfitLoss( PerformanceUnit.Currency, currentPrice);
Even when my Unrealized pnl in Ninjatrader worksatetion under account section, is positive.
I need to get current unrealized pnl to decide to close all of my positions.
if (currentProfit>0)
ExitLong();
How can I get a realtime Unrealized PnL?
Thanks in advance.
Comment