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.
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 !!!!