The 2 issues are the following:
Only a long or a short will be placed but not both.
The second issue is when the market opens my order disappears
I thought I found the issue about managed vs unmanaged but when I set unmanaged to true, my strategy goes to false. Here is the tidbit of code.
if(currentHour == 7 && ( currentMinute == 29))
{
// Unmanaged = true; THIS DOESN'T WORK IT TURNS OFF MY STRATEGY.
EnterShortStop(openLowBarPrice); THIS WILL TRIGGER
EnterLongStop(openHighBarPrice); THIS WILL NOT TRIGGER
Print("The low price is " +openLowBarPrice);
//SubmitOrder(0, OrderAction.Buy, OrderType.Stop, 1,openHighBarPrice);//, 0, "OCO", "LONG"); THIS WILL NOT TRIGGER
//SubmitOrder(0, OrderAction.Sell, OrderType.Stop, 1, openLowBarPrice);//, 0, "OCO", "SHORT"); THIS WILL NOT TRIGGER
}
THE CODE IS PLACED IN OnBarUpdate()
Comment