Does the positionprofit function work when using the portfolio backtester. I'm trying this test strategy below:
Code: Select all
if barnumber = 1 then buy next bar at market;
if barnumber = 10 then sell next bar at market;
print( "PositionProfit = ", positionprofit, " OpenPositionProfit = ", openpositionprofit, " BarNumber = ", barnumber );
When I run this, I can see openpositionprofit is showing values from bars 1 through 10. However, positionprofit is always being output as 0.