Naqibjan:
Take a look at this photo
We sell about 5 candles, but Expert also sells the next 5 candles.
When the sales signal is issued, this code
covers 10 candles after the sales signal.
Even when the sales signal runs out
I would even get 4 if we put 10 candles in the box (MathMax(10,Orders())) if the sales
signal was 4 and didn't reach 10.
Here's my 'guess' this time round (sorry, I just have to guess, because your questions are always difficult to understand):
if (b1_shift1<b2_shift1 && b1_shift2>b2_shift2) { if (TimeOfBuySignal==0) // SJT added TimeOfBuySignal = iTime(Symbol(),240,1); TimeOfSellSignal = 0; } move to after 'return("buy")'; if (TimeOfBuySignal>0 && iBarShift(Symbol(),240,TimeOfBuySignal)<=MathMax(10,Orders())) return("buy"); }
Do the same for sell. And change 10 to 5 if you want maximum of 5 trades.
Take a look at this photo
We sell about 5 candles, but Expert also sells the next 5 candles.
When the sales signal is issued, this code covers 10 candles after the sales signal.
Even when the sales signal runs out
I would even get 4 if we put 10 candles in the box (MathMax(10,Orders())) if the sales signal was 4 and didn't reach 10.