I have a working staratgety, and I'm just trying to tweek it a bit, by ensuring it dosen't jump right back into a trade after getting stopped out. To accomplish this, I'm ensure we've waited at least one bar since we've exited, and I'm using BarSinceExit to accomplish this.
Here is what code I"m using:
Onbarupdate...
if (Position.MarketPosition == MarketPosition.Flat &&
ToTime(Time[0]) > ToTime(8, 00, 0) &&
ToTime(Time[0]) < ToTime(15, 55, 0) &&
BarsSinceExit() > 1 || BarsSinceExit() == -1)
tradepermission = true;
But when I add the BarsSinceExit part, I get no results on my backtest. Am I using this command improperly?
Regards,
Brian
Comment