mql5 master candle

 
Good day,
I tried for days to code a master candle indicator by myself, with no success. I need to draw the high/low of each master candle available on historical datas.
Can someone help me very please.

here is the function OnCalculate
Regards.
int shift, bar, limit=0;
    //--- 
    if(prev_calculated<0)   return(-1);
    if(prev_calculated==0)  limit=rates_total-1;
    //--- last counted bar will be recounted
    if(prev_calculated>0)   limit=rates_total-prev_calculated;
    limit--;

    for(shift=limit; shift>0; shift--)
    {
      //--- Master Bar
      if(high[shift] <= HiestHi  &&  low[shift] >= LoestLo)
      {
        BarCount++;
      }
      else
      {
        HiestHi  = high[shift];
        LoestLo  = low [shift];
        BarCount = 0;
      }
      //---
      if(BarCount>=min_inside_bar)
      {        
        for(bar=0; bar<BarCount; bar++)   
        {
          master_hi_buf[shift+bar] = HiestHi;
          master_lo_buf[shift+bar] = LoestLo;
        }  
      }
    }
 

Have you checked the first link at the bottom of your post: https://www.mql5.com/en/forum/283609?

Bear in mind there's virtually nothing that hasn't already been programmed for MT4/MT5 and is ready for you - so searching gives better results than AI or ChatGPT!

Master Candle's Trendlines until it's broken
Master Candle's Trendlines until it's broken
  • 2018.10.12
  • www.mql5.com
Hello all, i am writing a "Master Candle" indicator (on H1...
 
Carl Schreiber #:

Have you checked the first link at the bottom of your post: https://www.mql5.com/en/forum/283609?

Bear in mind there's virtually nothing that hasn't already been programmed for MT4/MT5 and is ready for you - so searching gives better results than AI or ChatGPT!

thank you, i'll check it today and let you know this week.
Regards.

 
Email Temporaire #:

thank you, i'll check it today and let you know this week.
Regards.

the link wasn 't so good. to much hard coded.
I have done it with chat gpt.

 
Email Temporaire #: the link wasn 't so good. to much hard coded. I have done it with chat gpt.

Stop using ChatGPT. It is useless. We can't help you if you use it.

Learn to code or hire someone "human" to code it for you!