Is the last conditional line correct with just a 'else' instead of another 'else if' ??
For this example/question, there is no if (BarsInProgress != 0) return; && no if (BarsInProgress == 0) !!!
{
if (BarsInProgress == 1 && Closes[1][1] < Closes[1][0])
{
EnterLong();
Print("Went Long BIP=1 with Close above Close")
}
//
else if (BarsInProgress == 2 && Closes[2][1] > Closes[2][0])
{
EnterShort();
Print("Went Short BIP=2 with Close below Close")
}
//
else if (BarsInProgress == 0 && Closes[0][1] < Closes[0][0])
{
EnterLong();
Print("Went Long BIP=0 with Close above Close")
}
//
else (BarsInProgress == 0 && Closes[0][2] > Closes[0][1])
{
EnterShort();
Print("Went Short BIP=0 with Close below Close")
}
}
TJ
Comment