Hi People,
I have taken this code from the MQL4 reference manual and I always assumed it was working. I have found out today, it does not work on a different chart than the period specified.
on the 15 minute chart is prints the value of the last days close rather than the highest high for the last 10 days..
double HighTrendVal= High[iHighest(NULL,PERIOD_D1,MODE_HIGH,10,1)];
Print ("High Trend Value is",(HighTrendVal));
As far as I can see, this chooses Highest day index, lets say 3, and puts it into the High array. So, what would be printed with High[3] on a 15 minute chart ? What you have to do is use iHigh instead with (NULL,PERIOD_D1,...iHighest.....)
Hi People,
I have taken this code from the MQL4 reference manual and I always assumed it was working. I have found out today, it does not work on a different chart than the period specified.
on the 15 minute chart is prints the value of the last days close rather than the highest high for the last 10 days..
double HighTrendVal= High[iHighest(NULL,PERIOD_D1,MODE_HIGH,10,1)];
Print ("High Trend Value is",(HighTrendVal));
Hi,
Just try that before going further and come back if it doesn't fit your expectations:
double HighTrendVal= iHigh[NULL,PERIOD_D1,iHighest(NULL,PERIOD_D1,MODE_HIGH,10,1)];
![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 People,
I have taken this code from the MQL4 reference manual and I always assumed it was working. I have found out today, it does not work on a different chart than the period specified.
on the 15 minute chart is prints the value of the last days close rather than the highest high for the last 10 days..
double HighTrendVal= High[iHighest(NULL,PERIOD_D1,MODE_HIGH,10,1)];
Print ("High Trend Value is",(HighTrendVal));