The unrealized works fine but the total PnL ("Realized" in my string) is always zero. What am I missing here!?
protected override void OnBarUpdate()
{
if (BarsInProgress != 0)
return;
if (CurrentBars[0] < 1)
return;
PrintTo = PrintTo.OutputTab2;
Print(DateTime.Now.TimeOfDay + @";Unrealized:;" + PositionAccount.GetUnrealizedProfitLoss(Performanc eUnit.Currency, Close[0]) + @";Realized:;" + SystemPerformance.RealTimeTrades.TradesPerformance .Currency.CumProfit);
}
Section of ; delimited output (How can I reduce the currency output to 2 decimals?) :
Also, why would I have multiple entries at the same millisecond?
10:17:47.3780117;Unrealized:;912.499999999955;Rea lized:;0
10:17:47.3780117;Unrealized:;912.499999999955;Real ized:;0
10:17:47.3780117;Unrealized:;912.499999999955;Real ized:;0
10:17:47.3780117;Unrealized:;912.499999999955;Real ized:;0
10:17:47.5570091;Unrealized:;949.999999999955;Real ized:;0
10:17:47.5570091;Unrealized:;949.999999999955;Real ized:;0
10:17:47.7019667;Unrealized:;912.499999999955;Real ized:;0
10:17:47.7690275;Unrealized:;912.499999999955;Real ized:;0
10:17:47.7690275;Unrealized:;949.999999999955;Real ized:;0

Comment