Download MetaTrader 5

BUG on iHighest using MODE_CLOSE, it don't work

To add comments, please log in or register
ffoorr
1096
ffoorr  

I am using this code :


      dc_haut[i] = High[iHighest(Symbol(),Period(),MODE_CLOSE,15,i) ];
      dc_bas[i]  = Low[iLowest(Symbol(),Period(), MODE_CLOSE,15,i)];


It should drow on higher close and lower close of 15 Bars, and here is what I get :

https://www.mql5.com/en/charts/7177409/eurusd-h1-fxpro-financial-services


or here , double click the image :


Chart EURUSD, H1, 2017.06.08 14:15 UTC, FxPro Financial Services Ltd, MetaTrader 4, Demo
Chart EURUSD, H1, 2017.06.08 14:15 UTC, FxPro Financial Services Ltd, MetaTrader 4, Demo
  • www.mql5.com
Symbol: EURUSD. Periodicity: H1. Broker: FxPro Financial Services Ltd. Trading Platform: MetaTrader 4. Trading Mode: Demo. Date: 2017.06.08 14:15 UTC.
Alain Verleyen
Moderator
33360
Alain Verleyen  
ffoorr:

I am using this code :



Your code doesn't make sense :

  dc_haut[i] = High[iHighest(Symbol(),Period(),MODE_CLOSE,15,i) ];
  dc_bas[i]  = Low[iLowest(Symbol(),Period(), MODE_CLOSE,15,i)];

iHighest() returns an index for Highest close price, and then your are using this index for a High[] array. Same for iLowest/Low

ffoorr
1096
ffoorr  
Alain Verleyen:

OK, thank's, I modified it and it work now :

  dc_haut[i] = Close[iHighest(Symbol(),Period(),MODE_CLOSE,15,i) ];
  dc_bas[i]  = Close[iLowest(Symbol(),Period(), MODE_CLOSE,15,i)];
To add comments, please log in or register