Copying timeseries and getting Max

To add comments, please log in or register
armandaneshvar
22
armandaneshvar  
ArrayCopy(PeriodHigh, High, 0, i+5, 25);
double Max = ArrayMaximum(PeriodHigh, 0, WHOLE_ARRAY);

I want to select a period of 5 days before the current day in an array. Then after that I want to know what is the highest value of that given period. Somehow though, my code doesn't quit work the way I want it to work, and I think it is because of either one of the two lines above. Can anyone please explain to me whether there is something wrong there.

Marco vd Heijden
Moderator
8176
Marco vd Heijden  
 int Max = ArrayMaximum(PeriodHigh, 0, WHOLE_ARRAY);
 double MaxHigh=PeriodHigh[Max];

Please also study: https://www.mql5.com/en/docs/series/copyhigh

Documentation on MQL5: Timeseries and Indicators Access / CopyHigh
Documentation on MQL5: Timeseries and Indicators Access / CopyHigh
  • www.mql5.com
Timeseries and Indicators Access / CopyHigh - Reference on algorithmic/automated trading language for MetaTrader 5
To add comments, please log in or register