Buffers request doesnt match the buffers value

 

Hello all, I am new here and looking for some help.

In the attached file "Highlow custom.mq4" you'll find the source code of an indicator I downloaded. It has 3 buffers (buffer 0 1 2) which provide the high middle and low of selcted timeframe. 

My problem is when my ea requests the buffer value, it returns only the daily high middle low values. It cant return any weekly or monthly values even in the data window the correct values are shown. 

I can see from the souce code there is a loop function to get the weekly or monthly high low values from the array of daily high low values. But I dont know how to change to code so I can request the weekly or monthly high low values. 

Can anyone kindly help me the revise the code so the weekly or monthly value can be correctly requested.

Mnay thanks for looking into it.

 

No file was attached. Besides the indicator code, you will also need to show your EA's code. Also provide log output demonstrating your issue and screenshots may also be helpful.

 
Thanks. I uploaded the files. I dont have my EA's code. 
 
kkwang2005 #: Thanks. I uploaded the files. I dont have my EA's code. 
Then how to you expect to fix the issue if you don't have the EA code?
 

Hi I dont understand why do you need EA code to revise an indicator. EA just request its buffer value, its quite general. 

 

Hi

If the values are visible in the data window you should be able to get them by calling iCustom function.

Just need to figure out which buffer return which value and use it properly in the code.

 
kkwang2005 #: Hi I dont understand why do you need EA code to revise an indicator. EA just request its buffer value, its quite general. 
Because, from your description, it's most likely the case that the changes need to be made to both the EA and the indicator.
 
Fernando Carreiro #:
Because, from your description, it's most likely the case that the changes need to be made to both the EA and the indicator.
Hi EA doesnt need change. Just the indicator need change. 
 
Marzena Maria Szmit #:

Hi

If the values are visible in the data window you should be able to get them by calling iCustom function.

Just need to figure out which buffer return which value and use it properly in the code.

Hi, lets say I want to find a monthly low value for the last month. The indicator used an loop function on the daily low value DayMin of the last month to find the monthly low ExtMapBuffer3[shift+i] , but when I request the buffer value ExtMapBuffer3[shift+i] , it only returns the value of DayMin, not the actual  ExtMapBuffer3[shift+i] value. Why is that?

  int start() {


   int shift, i, CurDay, BarCount;

   double DayMax, DayMin;

   double DayOpen, DayClose, Avg;


   for (shift=Bars-1; shift>=0; shift--) {

   

      int timeFrameIndex = iBarShift(NULL, timeFrame, Time[shift], true);

   

      if (CurDay != iTime(NULL, timeFrame, timeFrameIndex)) {

      

         for (i=BarCount; i>=0; i--) {

         

            ExtMapBuffer1[shift+i] = DayMax;

            ExtMapBuffer2[shift+i] = (DayMax+DayMin)/2;

            ExtMapBuffer3[shift+i] = DayMin;

            

         }

         

         CurDay = iTime(NULL, timeFrame, timeFrameIndex);

         BarCount = 0;

         DayMax = 0;

         DayMin = 1000;

         DayOpen = Open[shift];

         

      }


      if (DayMax < High[shift]) {

      

         DayMax = High[shift];

         

      }

      

      if (DayMin > Low[shift]) {

      

            DayMin = Low[shift];

            

      }

      

      BarCount = BarCount + 1;

   }


   for (i=BarCount; i>=0; i--) {

   

      ExtMapBuffer1[shift+i] = DayMax;

      ExtMapBuffer2[shift+i] = (DayMax+DayMin)/2;

      ExtMapBuffer3[shift+i] = DayMin;

      

   }

   

   DayClose = Close[0];

   Avg = (DayMax+DayMin)/2;


   return(0);

   

}

 
kkwang2005 #:

Please edit your post and use the code button (Alt+S) when pasting code.

EDIT your original post, please do not just post the code correctly in a new post.

While you are doing this, please remove the excess blank lines to make it easier to read.

 
kkwang2005 #:

Hi I dont understand why do you need EA code to revise an indicator. EA just request its buffer value, its quite general. 

Look,

Fernando is one of the most respectful and knowledgeable.

If he asked for your EA, there's a reason behind it.


From your explanation it does sounds like, as Fernando suspects, an issue with the EA and not the indicator.

Show the code for your ea.

It will help the good guys in here to help you.

Reason: