double valHigh = high[ iHighest( null, PERIOD_D1, MODE_HIGH,10, 0)] ;
double valHigh = high[ iHighest( "EURUSD", PERIOD_D1, MODE_HIGH,10, 0)] ;
The problem is the use of high[]. It is a series for current chart!double valHigh = high[ iHighest( "EURUSD", PERIOD_D1, MODE_HIGH,10, 0)] ;
The first line above produces the iHighest for current chart, while the second line for EURUSD chart.
You have to use iHigh for the second statement above.
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
When I tested my script with " ihighest " and parameter " NULL " for symbol,
it run well.
double valHigh = high[ iHighest( null, PERIOD_D1, MODE_HIGH,10, 0)] ;
Print (valHigh);
- run script and the code gives prope value for current symbol (chart).
But, when tested with specific parameter " EURUSD " it doesn´t work correctly.
double valHigh = high[ iHighest( "EURUSD", PERIOD_D1, MODE_HIGH,10, 0)] ;
Print (valHigh);
- run script and proper value is OK only if the "EURUSD" chart is active.
- change the chart and value is for the current selected chart , but there should be EURUSD result on every active charts.
TESTED ON build v. 203 and build v. 208 // The iLowest is the same !!!!