Please use the SRC button to post code.
Instead of . . .
y = iLow(Symbol(), PERIOD_M1, iLowest(Symbol(), PERIOD_M1, MODE_HIGH, iBarShift(Symbol(), PERIOD_M1, x, true), 0));
don't you mean . . .
y = iLow(Symbol(), PERIOD_M1, iLowest(Symbol(), PERIOD_M1, MODE_LOW, iBarShift(Symbol(), PERIOD_M1, x, true), 0));
Fixed the src issue. Thanks
You were right about MODE_LOW but it was just a typo - the problem is still here.
I tried adding RefreshRates() but that doesn't make any difference.
Any ideas.
Cheers
ObjectSet("ligneY3" ???
Is there any reasons why MT4 could not get the lowest price then ?
I read somewhere that when the ticks come up too fast, MT4 can ignore some of them in the process but in my case, I am analyzing the data after so it should be able to get the right price.
y = iLow(Symbol(), PERIOD_M1, iLowest(Symbol(), PERIOD_M1, MODE_LOW, iBarShift(Symbol(), PERIOD_M1, x, true), 0));Don't write indecipherable lines like that.
int iX = iBarShift(Symbol(), PERIOD_M1, x, true), iLL= iLowest(Symbol(), PERIOD_M1, MODE_LOW, iX , 0); y = iLow(Symbol(), PERIOD_M1, iLL); // Why not just Low[iLL]How many bars are there between iX and bar 0. iX+1 But you're not looking at the x bar.
Is there any reasons why MT4 could not get the lowest price then ?
nop, there is no reason for that, the only reason is the problem in your code
Thanks everyone - I will follow WHRoeder advice on writing clearer code and simplify the logic.
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi everyone,
Maybe you can figure what's wrong with the following program.
The logic of the code is to create a range of 10 pips where the low is always going to be the lowest price since the EA started and that the price did not touch the upper band of the range. Every time, the upper band is touched, the EA is taking the touching time as the new starting point.
Not always but sometimes, the EA is not updating the lower band to the lowest price as the figure below shows.
Am i missing something in my code ?
Thanks