OHLC of previous Year.

To add comments, please log in or register
Thierry Ramaniraka
542
Thierry Ramaniraka  
Hello,
Here is the way i found on this forum to get the High and Low of the previous Year :
// YEAR LEVELS
   double PREV_YEAR_HIGH = iHigh(NULL, PERIOD_MN1, iHighest(NULL, PERIOD_MN1, MODE_HIGH, 12, Month()));
   double PREV_YEAR_LOW = iLow(NULL, PERIOD_MN1, iLowest(NULL, PERIOD_MN1, MODE_LOW, 12, Month()));
I tried to replace iLow and iLowest by iClose to have the Close ... but it doesn't work.

Can I have your help very please.

Regards.
William Roeder
20208
William Roeder  
Thierry Ramaniraka: I tried ... but it doesn't work.
  1. Do you really expect an answer? We can't see your broken code. There are no mind readers here and our crystal balls are cracked.

  2. "Doesn't work" is meaningless - just like saying the car doesn't work. Doesn't start, won't go in gear, no electrical, missing the key, flat tires - meaningless.

  3. On MT4: Unless the current chart is that specific pair/TF referenced, you must handle 4066/4073 errors.
              Download history in MQL4 EA - MQL4 and MetaTrader 4 - MQL4 programming forum

Thierry Ramaniraka
542
Thierry Ramaniraka  
I found a "year pivot" indicator somewhere on the web.
I use it to pick it from the code.

Regards.
Christopher Fernandez Ledon
993
Christopher Fernandez Ledon  
That will give you highest and lowest of the past 12 months. To get previous year's highest and lowest there's more to it than that. 
Thierry Ramaniraka
542
Thierry Ramaniraka  
No, i got it.
Thank you.
To add comments, please log in or register