I am using the following code to trigger a long order
void Buy()
{
double threshold = MAX(this.High, 2)[0];
barsLong = 0;
base.EnterLongStopMarket(1, threshold, "VLong");
}
I get the following error when the market opens gap up above my threshold value
"Buy stop or buy stop limit orders can't be placed below the market.." and then my strategy is diabled.
The funny thing is that once I re-enable the strategy the order is submitted just fine.
What am I doing wrong? Please advise on what to do.
kind regards
Ioannis
Comment