I also have a second DataSeries at 1 Tick to calculate exits (Closes[1])
AddDataSeries(Data.BarsPeriodType.Tick, 1);
After I take an exit in my strategy on Closes[1][0], I would like to be able to re-enter on the upcoming Closes[0][0]. Is that possible? My current code does not seem to work. Simplied logic is below:
if (BarsInProgress == 0) {
if (
Open[0] > Close[0]
&& CurrentBar > lastOrderBar
)
{
lastOrderBar = CurrentBar;
EnterShort(Convert.ToInt32(DefaultQuantity), "SE"); // this should re-enter since i have exited short position below and reset lastOrderBar to 0???
}
}
if (BarsInProgress == 1) {
stopShort = High[1];
if(CrossAbove(Closes[1], stopShort, 1)) {
lastOrderBar = 0;
ExitShort();
}
}
this should re-enter since i have exited short position on BarsInProgress(1) and reset lastOrderBar to 0???

Comment