Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 1071

 
   limit=rates_total-prev_calculated;
   if(prev_calculated>0)
      limit++;
Taken from the MACD example supplied with the terminal.
 
evillive:
Taken from the MACD example from the terminal delivery.
Thank you, but in this case limit=0 and in the loop the calculation is from the last bar to zero
 
Pokrov:
Thank you, but in this case limit=0 and in the loop the calculation goes from the last bar to zero

In that case, if 0 is counted, we take all the bars, and in other cases, we take as many bars as are not counted:

  limit=rates_total-prev_calculated;
  if(prev_calculated<1) limit=rates_total-1;
 
evillive:

Then, if 0 is counted, we take all bars, in other cases, how many are not counted:

Thank you very much! I dont understand why it works, when I loadrates_total and prev_calculated are equal to equal number of bars and then limit = 0, further the condition which is not true, why it works ? Explain it to me please,

I want to understand why it works ...
 
Pokrov:

Thank you very much! Only I still don't understand why it works, when I load the indicatorrates_total and prev_calculated are equal to the same number of bars and then limit = 0, further the condition which is not true, then why does it work ? Please explain me,

Want to understand why it works ...

When loadingrates_total=Bars, a prev_calculated=0.

 
evillive:

When loadingrates_total=Bars, a prev_calculated=0.

Oh that's right, I just didn't look closely at the log, first tickprev_calculated=0. thanks again!!!!
 
evillive:
You can. Just leave more space for it, folders of history and logs are growing, I have more than 5 Gb of history, and once my Expert Advisor had 20 Gb of errors in its logs, it's good that it's not on a flash drive ))))
Right. I see. Thank you all!
 

Hi all. I want to use data from H4 in strategy tester on H1 timeframe. When I initialize the indicator it is rendered correctly, but when I start the tester it is not redrawn.

Is this a feature of the tester? How can I overcome it?

int shift = iBarShift(Symbol(), PERIOD_H4, Time[i]);

bufBuffer[i] = iClose(Symbol(),PERIOD_H4,shift); 
 
storuky:

Hi all. I want to use this indicator from H4 in strategy tester on H1 timeframe. When I initialize the indicator it is rendered correctly, but when I start the tester it is not redrawn.

Is this a feature of the tester? Is there any way to fix it?

Yes, the tester blocks access to data of other TFs in the visualization mode. In normal testing without visualization, the data goes properly, but rendering suffers.

There is no way to solve this problem directly - we can only complicate the algorithm and draw objects, but is it worth it?

 
Good afternoon, 5 kopeck question))) Can you please tell me what the "&" sign means when passing to a function? Example: int determineSection_D1(int & askSection_D1,int & bidSection_D1) ? Thank you.