I need help understanding why this logic will only take long orders and won't generate any short orders. It looks for a breakout to either side of the current day's High or Low:
if (BarsInProgress != 0)
return;
if (CurrentBars[0] < 1)
return;
// Set 1
if ((Times[0][0].TimeOfDay == TimeGo.TimeOfDay)
&& (Close[0] < CurrentDayOHL1.CurrentHigh[0]))
{
EnterLongStopMarket(Convert.ToInt32(DefaultQuantit y), CurrentDayOHL1.CurrentHigh[0], "");
}
// Set 2
else if ((Times[0][0].TimeOfDay == TimeGo.TimeOfDay)
&& (Close[0] > CurrentDayOHL1.CurrentLow[0]))
{
EnterShortStopMarket(Convert.ToInt32(DefaultQuanti ty), CurrentDayOHL1.CurrentLow[0], "");
}
// Set 3
if (BarsSinceEntryExecution(0, "", 0) >= BarsHold)
{
ExitLong(Convert.ToInt32(DefaultQuantity), "", "");
ExitShort(Convert.ToInt32(DefaultQuantity), "", "");
}​
thank-you;
David

Comment