Script von MQL5 in MQL4 übersetzen

 

Hallo zusammen habe letztens eine Frage auf dem Forum gestellt ob es möglich ist bei einem Stochastic Oscillator die differenz von K% und D% zueinander zu berrechnen. Ich habe darauf von jemandem auf diesem Forum eine super Lösung erhalten aber leider in MQL5. Ich bräuchte das gleiche aber für MQL4. Hätte jemand von euch zufällig eine Lösung für MQL4 oder kann mir dieses Script übersetzen oder umschreiben das es für MQL4 funktioniert.

//+------------------------------------------------------------------+
//|                                                    StochDiff.mq5 |
//|                                Copyright © 2017 Ing. Otto Pauser |
//|                                          http://www.spider4x.com |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2017 Ing. Otto Pauser"
#property link      "http://www.spider4x.com"
#property version   "1.00"

input    int            inp_Kperiod =  15;             // %K Periode
input    int            inp_Dperiod =  6;             // %D Periode
input    int            inp_slowing =  3;             // Verlangsamung
input    ENUM_MA_METHOD inp_method  = MODE_SMA;       // Methode
input    ENUM_STO_PRICE inp_pricef  = STO_LOWHIGH;    // Preisbereich

int      haStoch;    // handle für iStochastik
double   prozD[1],   // statischer buffer für %D
         prozK[1];   // statischer buffer für %K
double   delta;

int OnInit()
{
   haStoch=iStochastic(_Symbol,_Period,inp_Kperiod,inp_Dperiod,inp_slowing,inp_method,inp_pricef);       // handle iStochastik erstellen
   if(haStoch==INVALID_HANDLE)                                                                           // ErrCheck
      {
         MessageBox("*ERROR* creating handle iStochastic",MQLInfoString(MQL_PROGRAM_NAME),MB_ICONERROR); // Info
         return(INIT_FAILED);                                                                            // da ging was schief
      }
   return(INIT_SUCCEEDED);                                                                               // alles OK
}

void OnTick()
{
   if(CopyBuffer(haStoch,0,0,1,prozK)!=1) return;     // Werte aus Buffern holen
   if(CopyBuffer(haStoch,1,0,1,prozD)!=1) return;
   delta=prozK[0]-prozD[0];                           // berechnen
   Comment("Stochastik Differenz %K-%D: ",DoubleToString(delta,2));
}
 
Exp_IBS_RSI_CCI_v4
Exp_IBS_RSI_CCI_v4
  • Stimmen: 15
  • 2017.03.02
  • Nikolay Kositsin
  • www.mql5.com
Trading system using the IBS_RSI_CCI_v4 indicator. The signal is formed when a bar is closing if there is change in cloud color. Place IBS_RSI_CCI_v4.ex5 compiled file to the . After compilation, the Exp_Fractal_ADX_Cloud.ex5 expert file contains the Fractal_ADX_Cloud.ex5 indicator as a resource, and therefore, it is not required to be present...
 
 

Ein kleines Dankeschön wäre wohl angebracht.

Frag in Zukunft den Herold!

 

Ist zwar schon eine Weile her,


aber von mir einen ganz super herzlichen Dank für deine Arbeit!!!!!

Ich konnte das gut gebrauchen.

Grund der Beschwerde: