If you're running on a 1 day chart you will need to type 5 instead of 1 on your line 44: Add(PeriodType.Minute, 1);
You then have 4 bar series in the strategy but I'm only seeing you handle the BIP 0 (primary series) and BIP 1 (in this case its a 1 minute chart of the primary series)
Additionally you have some oddly placed brackets.
if (BarsInProgress == 1) {ExitShortStop(1, true, 1, Position.AvgPrice + 8 * TickSize, "SHORTstop", "SHORT");} {ExitShortLimit(1, true, 1, Position.AvgPrice - 6 * TickSize, "SHORTtarget", "SHORT");} {ExitLongStop(1, true, 1, Position.AvgPrice - 8 * TickSize, "LONGstop", "LONG");} {ExitLongLimit(1, true, 1, Position.AvgPrice + 6 * TickSize, "LONGtarget", "LONG");}
Please see the following as an example of how to use BarsInProgress: http://www.ninjatrader.com/support/h...nstruments.htm
Let me know if I can be of further assistance.
Leave a comment: