Einzelnen Beitrag anzeigen
  #5 (permalink)  
Alt 18.08.20
MA-EA MA-EA ist offline
Elite Mitglied
 
Registriert seit: Sep 2015
Beiträge: 1.178
MA-EA befindet sich auf einem aufstrebenden Ast
Standard

Das Problem ist wohl, dass alle MA einfach nur nach unten verschoben werden und dementsprechend manchmal früher und manchmal später als die "originalen" MAs sich überschneiden. So müsste das Ganze wohl eher nen Sinn ergeben, indem sie ihren jeweiligen Verhältnissen zum ClosePrice entsprechend verändert werden:
Code:
extern int MA_Fast_Period=3;
extern int MA_Fast_Chart_Shift=0;
input ENUM_MA_METHOD MA_Fast_Method=0;
extern double MA_Fast_Divi=10.0;

extern int MA_Midd_Period=6;
extern int MA_Midd_Chart_Shift=0;
input ENUM_MA_METHOD MA_Midd_Method=0;
extern double MA_Midd_Divi=10.0;

extern int MA_Slow_Period=10;
extern int MA_Slow_Chart_Shift=0;
input ENUM_MA_METHOD MA_Slow_Method=0;
extern double MA_Slow_Divi=10.0;


double CP1=iClose(Symbol(),TF,1);


double MA_Fa=iMA(Symbol(),TF,MA_Fast_Period,MA_Fast_Chart_Shift,MA_Fast_Method,PRICE_CLOSE,1);

double MA_Mi=iMA(Symbol(),TF,MA_Midd_Period,MA_Midd_Chart_Shift,MA_Midd_Method,PRICE_CLOSE,1);

double MA_Sl=iMA(Symbol(),TF,MA_Slow_Period,MA_Slow_Chart_Shift,MA_Slow_Method,PRICE_CLOSE,1);


double CP1pluMAFa = CP1 + MA_Fa;

double CP1pluMAMi = CP1 + MA_Mi;

double CP1pluMASl = CP1 + MA_Sl;


if( CP1pluMAFa<1.0 )double di_Fa = CP1pluMAFa * MA_Fast_Divi;
else di_Fa = CP1pluMAFa / MA_Fast_Divi;

if( CP1pluMAMi<1.0 )double di_Mi = CP1pluMAMi * MA_Midd_Divi;
else di_Mi = CP1pluMAMi / MA_Midd_Divi;

if( CP1pluMASl<1.0 )double di_Sl = CP1pluMASl * MA_Slow_Divi;
  else di_Sl = CP1pluMASl * MA_Slow_Divi;
Vielleicht sind noch nen paar Fehler drin, im Großen und Ganzen müsste es so aber wohl eher funktionieren.


Gute Nacht für heute.
Angehängte Dateien
Dateityp: mq4 CPplus3MA_Div_CP1AB_MT4EA.mq4 (37,1 KB, 1x aufgerufen)