Find the maximum pips moved in a Time Period

 

Any of the experts have any idea or suggestion on how to find and display

a) the maximum pips and b) average pips moved in a Day, Week and Month considering the entire history of a Symbol?

 
Go through your (3) history and compute them, and then display them. You haven't stated a problem, you stated a want. Show us your attempt (using the CODE button) and state the nature of your problem.
          No free help 2017.04.21

Or pay someone. Top of every page is the link Freelance.
          Hiring to write script - General - MQL5 programming forum 2018.05.12

 
Shine Scariah:

Any of the experts have any idea or suggestion on how to find and display

a) the maximum pips and b) average pips moved in a Day, Week and Month considering the entire history of a Symbol?

Why the entire history ? 

There has to be some association between the data ,for instance ,the entirety maximum will almost always point to an outlier event in high timeframes 

and news reactions to lower timeframes 

 
William Roeder:
Go through your (3) history and compute them, and then display them. You haven't stated a problem, you stated a want. Show us your attempt (using the CODE button) and state the nature of your problem.
          No free help 2017.04.21

Or pay someone. Top of every page is the link Freelance.
          Hiring to write script - General - MQL5 programming forum 2018.05.12

Dear William Roeder,

I can see you dont offer free help from many of your replies to majority of the threads and we also know there is a freelance service offered. So if you don't offer, request ignore such threads, rather than repeating same comment in most of the threads. However just replying, if it gives some additional points as a Moderator, then its upto you. Thank you.

If from others reply, we find this is quite a complex thing, definitely we will go for freelancer. The response also shows the skillset of a freelancer. For example, in my previous thread, a freelancer gave a very precise and accurate response. So he get the order for development of big task. So please be kind to others who are less knowledgeable in coding than you.

 
Lorentzos Roussos:

Why the entire history ? 

There has to be some association between the data ,for instance ,the entirety maximum will almost always point to an outlier event in high timeframes 

and news reactions to lower timeframes 

Dear Lorentzos,

Thank you very much for the kind response.

Basically i wanted to see which day the no of pips moved maximum in a Time chart (Day/Week/Month) between 2018 till date. Physically scrolling through each and every history throughout the 2 year and measuring using the "crosshair": i found bit tough. This is the reason.

 

Shine Scariah:

William Roeder:
Go through your (3) history and compute them, and then display them. You haven't stated a problem, you stated a want. Show us your attempt (using the CODE button) and state the nature of your problem.
          No free help 2017.04.21

Or pay someone. Top of every page is the link Freelance.
          Hiring to write script - General - MQL5 programming forum 2018.05.12

Dear William Roeder,

I can see you dont offer free help from many of your replies to majority of the threads and we also know there is a freelance service offered. So if you don't offer, request ignore such threads, rather than repeating same comment in most of the threads. However just replying, if it gives some additional points as a Moderator, then its upto you. Thank you.

If from others reply, we find this is quite a complex thing, definitely we will go for freelancer. The response also shows the skillset of a freelancer. For example, in my previous thread, a freelancer gave a very precise and accurate response. So he get the order for development of big task. So please be kind to others who are less knowledgeable in coding than you.

Actually, William helps a lot of people, and for free.

AS for repeating, that is unfortunately a necessity as the vast majority of people don't actually bother to read the forum and only visit the forum when they want help. If people actually read the forum they could learn so much. But no, that would require some effort, so they just start a new topic with the same questions that have been asked 100's of times before.

 
Keith Watford:

Actually, William helps a lot of people, and for free.

AS for repeating, that is unfortunately a necessity as the vast majority of people don't actually bother to read the forum and only visit the forum when they want help. If people actually read the forum they could learn so much. But no, that would require some effort, so they just start a new topic with the same questions that have been asked 100's of times before.

Thanks Keith for the enlightenment. However this topic I have not seen anywhere else asked or answered.
 
Shine Scariah:

Dear Lorentzos,

Thank you very much for the kind response.

Basically i wanted to see which day the no of pips moved maximum in a Time chart (Day/Week/Month) between 2018 till date. Physically scrolling through each and every history throughout the 2 year and measuring using the "crosshair": i found bit tough. This is the reason.

Ow that makes sense then . 

Mt4 or Mt5 ?

 
Lorentzos Roussos:

Ow that makes sense then . 

Mt4 or Mt5 ?

Whichever is easy for you to guide :)
 
Shine Scariah:
Whichever is easy for you to guide :)

Great , MT4 .Cheers :) .Let me know if i understood the idea correctly .

#property copyright "Mql5.com forum thread >>"
#property link      "https://www.mql5.com/en/forum/349863"
#property description "Telegram  : https://t.me/lorentzor\nInstagram : @rlorentzo\nTwitter : @lorentzo_r\nLinkedIn : https://www.linkedin.com/in/lorentzor\nYoutube : https://www.youtube.com/channel/UCM0Lj06cAJagFWvSpb9N5zA\nFacebook  : @LorentzoR"
/* 
ways to connect .> : 
Telegram  : https://t.me/lorentzor
Instagram : https://www.instagram.com/rlorentzo /OR/ @rlorentzo
Twitter   : https://twitter.com/lorentzo_r /OR/ @lorentzo_r
LinkedIn  : https://www.linkedin.com/in/lorentzor
Youtube   : https://www.youtube.com/channel/UCM0Lj06cAJagFWvSpb9N5zA
Facebook  : https://www.facebook.com/LorentzoR /OR/ @LorentzoR
Mql5.com  : https://www.mql5.com/en/users/lorio
*/
#property strict
#property indicator_chart_window
#property indicator_buffers 5
#property indicator_plots   0
//--- indicator buffers
double         AverageHLBuffer[];
double         AverageOCBuffer[];
double         HLSum[],OCSum[],Sum[];
double MaximumHLInPrice=0,MaximumOCInPrice=0;//
datetime MaximumHLTime=0,MaximumOCTime=0;//
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int OnInit()
  {
  
//--- indicator buffers mapping
   SetIndexBuffer(0,AverageHLBuffer);
   SetIndexStyle(0,DRAW_NONE,EMPTY,EMPTY,clrNONE);
   SetIndexBuffer(1,AverageOCBuffer);
   SetIndexStyle(1,DRAW_NONE,EMPTY,EMPTY,clrNONE);
   SetIndexBuffer(2,HLSum);
   SetIndexStyle(2,DRAW_NONE,EMPTY,EMPTY,clrNONE);
   SetIndexBuffer(3,OCSum);
   SetIndexStyle(3,DRAW_NONE,EMPTY,EMPTY,clrNONE);
   SetIndexBuffer(4,Sum);
   SetIndexStyle(4,DRAW_NONE,EMPTY,EMPTY,clrNONE);
   MaximumHLInPrice=0;MaximumOCInPrice=0;
   MaximumHLTime=0;MaximumOCTime=0;
   
//---
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int OnCalculate(const int rates_total,
                const int prev_calculated,
                const datetime &time[],
                const double &open[],
                const double &high[],
                const double &low[],
                const double &close[],
                const long &tick_volume[],
                const long &volume[],
                const int &spread[])
  {
//---
  int total=rates_total-prev_calculated;
  int i_from=rates_total-2;
  bool ini=true;
  if(total<=0){i_from=0;ini=false;}
  if(total==1){i_from=1;ini=false;}   
  for(int i=i_from;i>=0;i--)
  {
  if(ini&&i==i_from){Sum[i+1]=0;HLSum[i+1]=0;OCSum[i+1]=0;}
  double hl=High[i]-Low[i];
  double oc=MathAbs(Close[i]-Open[i]);
  if(hl>MaximumHLInPrice){MaximumHLInPrice=hl;MaximumHLTime=Time[i];}
  if(oc>MaximumOCInPrice){MaximumOCInPrice=oc;MaximumOCTime=Time[i];}
  //on going averages 
    Sum[i]=Sum[i+1]+1;
    HLSum[i]=HLSum[i+1]+hl;
    OCSum[i]=OCSum[i+1]+oc;
    AverageHLBuffer[i]=HLSum[i]/Sum[i];
    AverageOCBuffer[i]=OCSum[i]/Sum[i];
  //on going averages 
  }
  string comm="Max High->Low Size     : "+DoubleToString((MaximumHLInPrice/Point()),0)+" At "+TimeToString(MaximumHLTime,TIME_DATE|TIME_MINUTES)+"  [AVG : "+DoubleToString((AverageHLBuffer[0]/Point()),0)+" ]";
         comm+="\nMax Open->Close Size : "+DoubleToString((MaximumOCInPrice/Point()),0)+" At "+TimeToString(MaximumOCTime,TIME_DATE|TIME_MINUTES)+"  [AVG : "+DoubleToString((AverageOCBuffer[0]/Point()),0)+" ]";
  Comment(comm);
//--- return value of prev_calculated for next call
   return(rates_total);
  }
Reason: