Problems with the MTF_Stochastic_v2.0 from the codebase

 

Hi,

I found the MTF_Stochastic_v2 (https://www.mql5.com/en/code/8033), which works really great! Thanks for that!

Now I want to use it in my EA, but in this way I am allways getting a wrong value

Stoch_TF3_Indi1_0 = iCustom(NULL,0,"MTF_Stochastic_v2","n1","n2","n3","n4","n5", TimeFrame,"n6",KPeriod,DPeriod,Slowing,"n7",MAMethod,"n8",PriceField,false, false, Red, "Arial",8,0,0);

This are the extern Variables from the Indicator:

extern string note1="Chart Time Frame";
extern string note2="0=current time frame";
extern string note3="1=M1, 5=M5, 15=M15, 30=M30";
extern string note4="60=H1, 240=H4, 1440=D1";
extern string note5="10080=W1, 43200=MN1";
extern int    TimeFrame  =0;      // {1=M1, 5=M5, 15=M15, ..., 1440=D1, 10080=W1, 43200=MN1}
extern string note6="Stochastic1";
extern int    KPeriod     =5,
              DPeriod     =3,
              Slowing     =3;
extern string note7="0=SMA, 1=EMA, 2=SMMA, 3=LWMA";
extern int    MAMethod       =0;      // {0=SMA, 1=EMA, 2=SMMA, 3=LWMA}
extern string note8="0=Hi/Low, 1=Close/Close";
extern int    PriceField     =0;      // {0=Hi/Low, 1=Close/Close}
extern bool   ShowClock      =true;   // display time to candle close countdown
extern bool   ShowStochInfo  =true;
extern color  ClockColor     =Red;
extern string ClockFont      ="Arial";
extern int    ClockSize      =8;


How do I have to call the value from this indicator??

 

What you posted seems correct. Are you sure you want bufferK?

Indicator:

   SetIndexBuffer(0,BufferK);
   SetIndexBuffer(1,BufferD);
   SetIndexBuffer(2,BufferK_Curr);
   SetIndexBuffer(3,BufferD_Curr);
code:
#define BK 0
#define BD 1
#define BKcc 2
#define BDcc 3
Stoch_TF3_Indi1_0 = iCustom(NULL,0,"MTF_Stochastic_v2","n1","n2","n3","n4","n5",
                            TimeFrame,"n6",KPeriod,DPeriod,Slowing,"n7",MAMethod,"n8",
                            PriceField,false, false, Red, "Arial",8,BK,0);
Reason: