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
Hello
I saw a system coded at metastock lang at forex-tsd.com. This system looks candle pattrern . Its a kind of fractal system. How can convert this code to mt4 ea.
Thanks.
code:
Up Level and Down Level Fractals}
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));
{Cross Up and Down Level Fractal}
a:= Cross(H,F1);
b:= Cross(F2,L);
state:= BarsSince(a)<BarsSince(b);
{Signal Long and Short}
ShortSignal:= state < Ref(state,-1);
LongSignal:= state > Ref(state,-1);
{Trend Up and Down}
UpTrend:= state>0;
DownTrend:= state<1;
{OpenBuy and CloseBuy}
OpenBuy:= LongSignal and (eventCount('OpenBuy')=eventCount('CloseBuy'));
CloseBuy:= ShortSignal and (eventCount('OpenBuy')>eventCount('CloseBuy'));
{OpenSell and CloseSell}
OpenSell:= ShortSignal and (eventCount('OpenSell')=eventCount('CloseSell'));
CloseSell:= LongSignal and (eventCount('OpenSell')>eventCount('CloseSell'));