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

 
yosuf:
Please excuse me, I am 0 in MKL programming, please indicate how this is done in practice?

Insert that function in the expert, set

We have the result

 
I can attachthe moving averege indicator to the indicatorAccumulative Swing Index(ASI)? I have ma constantly attached to the main chart, and I need to attach it to the ASI indicator window.


 
patreek:
I can attachthe moving averege indicator to the indicatorAccumulative Swing Index (ASI)? I have ma constantly attached to the main chart, but I need to attach it to the ASI indicator window.

You just drag the MA from the "Navigator" window to the ASI indicator window and select in the parameters to apply to



 
Recently I found out that starting from version 5xx the indicators with higher timeframes are not supported in the Tester. I checked it, iBarShift returns 0 for higher TF.
I haven't dealt seriously with this topic yet, but I would like to find out if there is any alternative? For example, what is the equivalent of iBarShift that will work in indicators for higher TFs in the Expert Advisor's testing mode than the TF of the tested Expert Advisor?
 
atztek:
Recently I found out that starting from version 5xx the indicators that have reference to higher timeframes are not supported in the Tester. Checked it, iBarShift returns 0 for higher TF.
I haven't dealt seriously with this topic yet, but I would like to find out if there is any alternative? For example, what is the equivalent of iBarShift that will work in indicators for higher TFs in the Expert Advisor's testing mode than the TF of the tested Expert Advisor?

all supports it,

Only in the new build you need to watch out for arrays, they are capricious

 
Vladon:

all supports it,
only in the new build you need to watch out for arrays, they are finicky

Here is, for example, a small test code:

int start() {

   int    Shift_1      = iBarShift(NULL,0,          Time[200]);
   int    Shift_2      = iBarShift(NULL,PERIOD_M30, Time[200]);

   Comment(
      "\n",
      "\n",
      "\n", "Time[200]   = ", TimeToStr(Time[200], TIME_DATE|TIME_MINUTES),
      "\n",
      "\n",
      "\n", "Shift_1     = ", Shift_1,
      "\n", "Shift_2     = ", Shift_2,
      "\n",
      "\n",
   "\n" );

   return(0);
}

Below is a screenshot from Tester in Visualization mode:



At the moment the Indicator is attached to the chart Shift_2 shows ~65 000, then 7,6,5...0.
Any ideas about this?
 
atztek:

The moment the Indicator is attached to the chart Shift_2 shows ~65,000, then 7,6,5..0.
Any ideas about this?

The developers have made it impossible to use iBarShift() in visualization mode (or maybe not only iBarShift()), it works in the Strategy Tester, the data is correct (according to the developers), but it does not make sense to attach this indicator to the visualization chart during tester operation - the data will be incorrect.
 
evillive:
The developers have made it impossible to address to high TF in visualization mode through iBarShift() (or maybe not only through iBarShift()), anyway it works in the tester, data are correct for Expert Advisors (again according to the developers), but there is no sense to attach such indicator to the visualization chart during tester operation, data will not be correct.
The person above said that everything works, but as you can see from the example this is not the case.

Have you disabled the operation only in visualization mode? Will it work without visualization in the tester, have you checked it?
Thanks for the info!

In any case, the first question becomes relevant again -
Is it possible to write a user alternative to iBarShift (etc.), i.e. function that would perform similar calculations based on bars opened in chart visualization mode for higher TF? Has anyone come across iBarShift code written in mql?
 
atztek:
The person above said that everything works, but as you can see from the example this is not the case.

Have you only disabled operation in visualisation mode? Without visualisation in the tester will work, have you not checked?
Thanks for the info!

In any case, the first question becomes relevant again -
Is it possible to write a user alternative to iBarShift (etc.), i.e. function that would perform similar calculations based on bars opened in chart visualization mode for higher TF? Has anyone encountered iBarShift code written in mql?

You misunderstood the person above.

Your code works correctly in the EA. The matter is that when addressing to a higher TF, the indicator receives data of a closed real bar while this bar in the tester is not closed yet. And when accessing from the EA OHLC are modelled.

 
AlexeyVik:

You misunderstood the man above.

Your code works correctly in the EA. The point is that the indicator receives data of already closed real bar while the same bar in the tester is not closed yet. And when accessing from the EA OHLC are modelled.

From the beginning I was talking about the Indicator in the Strategy Tester (in Expert Advisors with iBarShift for other TFs there is no problem), but now there is an assumption that iBarShift for higher TFs does not work if the indicator is in the Strategy Tester with visualization mode (maybe in the Strategy Tester without visualization it will work, I do not know, but anyway it is not so important). Now we need to find a solution for Tester with Visualisation.
Reason: