Just typed.
fill out the rest.
/* AA:=MA(C,10); * BB:=MA(C,50); * CC:=MA(AA-BB,10); * ABC:(2*REF(CC,1)+3*REF(AA,1)+4*REF(BB,1))/7,COLORRED; * PARTLINE(ABC>CLOSE,ABC),COLORBLUE; */ double AA[], BB[], CC[], dif[], dspRed[], dspBlue[]; #indicator_buffers 2 //dspRed, dspBlue total buffers 6 for(int iBar=...){ AA[iBar] = iMA(NULL,0, 10, 0, MODE_SMA, PRICE_CLOSE, iBar); BB[iBar] = iMA(NULL,0, 50, 0, MODE_SMA, PRICE_CLOSE, iBar); dif[iBar]= AA[iBar] - BB[iBar]; CC[iBar[]= iMAOnArray(dif, 0, 10, 0,MODE_SMA, iBar); double abc = (2*CC[iBar] + 3* AA[iBar] + 4*BB[iBAr])/7 if (result > Close[iBar]){ dspBlue[iBar] = abc; dspRed[iBar] = EMPTY_VALUE; } else{ dspRed[iBar] = abc; dspBlue[iBar] = EMPTY_VALUE; } }
This is an impressive demonstration to show what an extremely inappropriate language mql4 is for the kind of problems it is supposed to solve.

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Since I am new to MQL4. and I've tried the below translation but failed.
AA:=MA(C,10);
BB:=MA(C,50);
CC:=MA(AA-BB,10);
ABC:(2*REF(CC,1)+3*REF(AA,1)+4*REF(BB,1))/7,COLORRED;
PARTLINE(ABC>CLOSE,ABC),COLORBLUE;
I am most appreciated someone can help me to translate this to MQL4. Thanks in advance.