EA31337 / EA31337-classes

📦📈 EA31337 framework (MQL library for writing trading Expert Advisors, indicators and scripts)
https://ea31337.github.io/EA31337-classes
GNU General Public License v3.0
186 stars 98 forks source link

Test correctness of Ichimoku indicator #656

Open kenorb opened 2 years ago

kenorb commented 2 years ago

In Ichimoku 2nd and 3rd buffers are shifted by senkou_span_shift bars.

In this code example, it's shifted as CopyBuffer(ind_handle,2,-senkou_span_shift and CopyBuffer(ind_handle,3,-senkou_span_shift.

if senkou_span_shift>0, the line is shifted in the future direction by senkou_span_shift bars

but in MQL5's Examples/Ichimoku.mq5, the shift is different:

   PlotIndexSetInteger(2,PLOT_SHIFT,InpKijun);
   PlotIndexSetInteger(3,PLOT_SHIFT,-InpKijun);

And in MQL4 example (Ichimoku.mq4) also different:

   SetIndexShift(2,InpKijun);
   SetIndexShift(3,InpKijun);

We should check and update GetEntryAlter() with the right shifts (for 2nd and 3rd buffers) for each platform to produce the right values to be consistent between 2 platforms.