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

 
I have a question - what does iClose() show in the tester for the zero bar (the rightmost bar on the open tester chart ) of the higher timeframe? If I am not mistaken, it turns out that the bar is not yet closed but we already see its close price as if it has already been completed. I checked it in all ticks mode. Is it so?
 
Close[0] and iClose(Symbol(),Period(),0) - always shows the last current price (Bid)
 
FAQ:
Close[0] and iClose(Symbol(),Period(),0) - always show the last current price (Bid)

I understand that if you specify "0", the tester will consider the last bar on the entire history. In this case I consider the right bar on the chart, but it is not the last one.

I'd rather formulate the question differently - the tester is open with M5 period and using iClose/ iHigh/... to simulate work with a bar on period H1. Can I use iHigh() to see how High of a simulated bar on period H1 changes upon adding new M5 bars to the tester?
Or using iClose/ iHigh/... we always see the values of a fully formed bar in the Strategy Tester at the zero bar?

 
Yes, there is such a hole in the tester, at least there was. I think there was a fix in one of the new builds, need to check.
 
How can you remove the average line in a linear regression channel? What line should I write this on in the EA?
 
FAQ:
Yes, there is such a hole in the tester, at least there was. I think there was a fix in one of the new builds, I need to check it.

Now I have checked it in the version 509, but the result is the same.
In my code of indicator (runs in empty EA in visualization mode) there is no error? -

The comments on the screen show that at the moment when the 1st M5 bar of a new H1 bar appears iClose / iHigh / ... etc. already know how things will end for H1, peeking into the future - good idea for a grail to sell ;)))

int start() {

   int Bars_Per_Chart                   = WindowBarsPerChart()   + 1;
   int First_Visible_Bar                  = WindowFirstVisibleBar();
   int Last_Bar_On_Right              = First_Visible_Bar - Bars_Per_Chart + 1;

   if( Last_Bar_On_Right<0 ) {
       Last_Bar_On_Right              = 0;
       Bars_Per_Chart                    = First_Visible_Bar + 1;
   }


      int          Shift_MTF_0           = iBarShift(MTF_Currency, MTF_TimeFrame, Time[Last_Bar_On_Right] );

      double    MTF_Close_0        = iClose(   MTF_Currency, MTF_TimeFrame, Shift_MTF_0 );
      double    MTF_Open_0         = iOpen(    MTF_Currency, MTF_TimeFrame, Shift_MTF_0 );
      double    MTF_High_0          = iHigh(    MTF_Currency, MTF_TimeFrame, Shift_MTF_0 );
      double    MTF_Low__0         = iLow(     MTF_Currency, MTF_TimeFrame, Shift_MTF_0 );
      datetime MTF_Time_0          = iTime(    MTF_Currency, MTF_TimeFrame, Shift_MTF_0 );

 . . . 
 
atztek:

I have checked it in version 509 now, but the result is the same.
My indicator code (I have it running in empty EA in visualization mode) does not show any error? -

The comments on the screen show that at the moment when the 1st M5 bar of a new H1 bar appears iClose / iHigh / ... etc. already know how it will end for H1, see the future.







You mean you are drawing the indicator on the chart in visualisation mode?

Then everything is correct. The indicator takes the last known data

 
Vinin:


You mean you are drawing the indicator on the chart in visualisation mode?

Then everything is correct. The indicator takes the last known data


Yes, I have a shell EA and use it to test the indicator's performance on history.
Apparently the problem will be solved with iHighest / iLowest for M5 considering H1 open/close time.
 

Please advise why the MACD indicator printout shows only 4 decimal places instead of 6 ... and therefore 0.000190 is 0.000110 there ?

I tried NormalizeDouble(MACD,6) - no result... same 4 digits...

 
lottamer:

Please advise, why is the MACD indicator printed instead of 6 decimal places only 4...and therefore 0.000190 is 0.000110 there ?

I tried NormalizeDouble(MACD,6) - no result... same 4 digits...


Try usingDoubleToStr