|
Indicator with this code:
Hi my Dears,
I want 2 indicators in MT4 with these code below: (with arrow signal buy/sell on the chart)
Number 1:
----------
MA1 = SMA(5,Close), MA2 = SMA(10,Close), MACD(12,26,9)
To signal a long trade: MA1 > MA2, RSI(14) > 50, and MACD Fast > MACD Signal
To signal a short trade: MA1 < MA2, RSI(14) < 50, and MACD Fast < MACD Signal.
----------
Number 2:
----------
F1 is Fractal Up Level and F2 is Fractal Down Level in the code below
UpTrend and DownTrend(Description):
F1:=ValueWhen(1,H<Ref(H,-2) AND Ref(H,-1)<Ref(H,-2) AND Ref(H,-3)<Ref(H,-2) AND Ref(H,-4)<Ref(H,-2),Ref(H,-2));
F2:=ValueWhen(1,L>Ref(L,-2) AND Ref(L,-1)>Ref(L,-2) AND Ref(L,-3)>Ref(L,-2) AND Ref(L,-4)>Ref(L,-2),Ref(L,-2));
a:=Cross(H,F1);
b:=Cross(F2,L);
state:=BarsSince(a)<BarsSince(b);
{Signal Long and Short}
LongSignal:= state<Ref(state,-1);
ShortSignal:=state>Ref(state,-1);
{Trend Up and Down}
UpTrend:=state>0;
DownTrend:=state<1;
---------------------------------------
Thanks and Best Regards,
Khamoosh
|