Hi all,
I am facing a problem with reentries when a stop profit is reached and the buy condition is met on the same bar.
I can only think of a much more complicated solution than simply setting one or two Amibroker options at the beginning of my code but I don't find anything.
ApplyStop(stopTypeLoss, stopModePercent, 1, 1, ValidFrom = 0);
ApplyStop(stopTypeProfit, stopModePercent, 0.3, 0, ValidFrom = 0);
Buy = Low < Ref(High, -1) AND High >= Ref(High, -1) AND Ref(C > EMA(C,10), -1);
BuyPrice = Ref(High, -1);
Sell = 0;
This is the QQQ chart of August this year. The circled candle closed 1.3% higher than the previous one, reaching the stop profit but also the buy condition is met so Amibroker shows another buy at the previous high price, which, of course, leads to a false trade entered due to the fact that Amibroker is "seeing the future".
Does somebody know an easy solution for this?
Thanks
Regards.