[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Metastockusers] Help Needed Converting Amibroker Code to Metastock



PureBytes Links

Trading Reference Links

Not being a formula expert, can anyone help me convert the following 
Amibroker codes to the correct Metastock formula. Any help would be 
very appreciated.


FRACTAL VOLUME:-

MaxGraph=5;

f1=BarsSince(H>Ref(H,1)AND H>Ref(H,2)AND H >Ref(H,-1)AND H > Ref(H,-
2)

OR

H==Ref(H,1)AND H>Ref(H,2)AND H>Ref(H,3)AND H >Ref(H,-1)AND H > Ref
(H,-2));

f1v=ValueWhen(H>Ref(H,1)AND H>Ref(H,2)AND H >Ref(H,-1)AND H > Ref(H,-
2)

OR

H==Ref(H,1)AND H>Ref(H,2)AND H>Ref(H,3)AND H >Ref(H,-1)AND H > Ref
(H,-2),MA(V,4),1);

f2v=ValueWhen(H>Ref(H,1)AND H>Ref(H,2)AND H >Ref(H,-1)AND H > Ref(H,-
2)

OR

H==Ref(H,1)AND H>Ref(H,2)AND H>Ref(H,3)AND H >Ref(H,-1)AND H > Ref
(H,-2),MA(V,4),2);

sf1=BarsSince(L<Ref(L,1)AND L<Ref(L,2)AND L<Ref(L,-1)AND L< Ref(L,-2)

OR

L==Ref(L,1)AND L<Ref(L,2)AND L<Ref(L,3)AND L<Ref(L,-1)AND L< Ref(L,-
2));

Graph3=V;

Graph3Color=3;

Graph3Style=2;

Graph3BarColor=IIf(MA(V,18)>Ref(MA(V,18),-18),5,3);

Graph4=Ref(MA(V,4),-f1);

Graph4Color=5;

Graph4Style=1;

Title=Name()+" Fractal Volume "+" "+WriteVal(V,format=1.0)+" Avg 22 
Day Vol "+WriteVal(MA(V,22),format=1.0);

-------------------------------------------------------------------

SECURITY TREND:

Aup=40;//40

Adown=60;//60

up=BarsSince(RSI(9)>70);

down=BarsSince(RSI(9)<30);

Graph0=IIf(up<down,1,-1);

Graph0Style=2;

Graph0BarColor=IIf( up<down AND LLV(RSI(9),up)>Aup ,5,IIf(down<up AND

HHV(RSI(9),down)<Adown,4,0));

Graph1=1.1;

Graph1Color=0;

Graph2=-1.1;

Graph2Color=0;

--------------------------------------------------------------------

EXPLORER SEARCH:

fractal1=ValueWhen(H>Ref(H,1)AND H>Ref(H,2)AND H >Ref(H,-1)AND H > 
Ref(H,-2) OR

H==Ref(H,1)AND H>Ref(H,2)AND H>Ref(H,3)AND H >Ref(H,-1)AND H > Ref
(H,-2),H,1);

fractal2=ValueWhen(H>Ref(H,1)AND H>Ref(H,2)AND H >Ref(H,-1)AND H > 
Ref(H,-2) OR

H==Ref(H,1)AND H>Ref(H,2)AND H>Ref(H,3)AND H >Ref(H,-1)AND H > Ref
(H,-2),H,2);

thisrsi=ValueWhen(RSI(9)>Ref(RSI(9),1)AND RSI(9)>Ref(RSI(9),2)AND RSI
(9) >Ref(RSI(9),-1)AND RSI(9) > Ref(RSI(9),-2),RSI(9),1);

lastrsi=ValueWhen(RSI(9)>Ref(RSI(9),1)AND RSI(9)>Ref(RSI(9),2)AND RSI
(9) >Ref(RSI(9),-1)AND RSI(9) > Ref(RSI(9),-2) ,RSI(9),2);

 

sf1=ValueWhen(L<Ref(L,1)AND L<Ref(L,2)AND L<Ref(L,-1)AND L< Ref(L,-
2) OR

L==Ref(L,1)AND L<Ref(L,2)AND L<Ref(L,3)AND L<Ref(L,-1)AND L< Ref(L,-
2),L,1);

f1v=ValueWhen(H>Ref(H,1)AND H>Ref(H,2)AND H >Ref(H,-1)AND H > Ref(H,-
2) OR

H==Ref(H,1)AND H>Ref(H,2)AND H>Ref(H,3)AND H >Ref(H,-1)AND H > Ref
(H,-2),MA(V,4),1);

f2v=ValueWhen(H>Ref(H,1)AND H>Ref(H,2)AND H >Ref(H,-1)AND H > Ref(H,-
2) OR

H==Ref(H,1)AND H>Ref(H,2)AND H>Ref(H,3)AND H >Ref(H,-1)AND H > Ref
(H,-2),MA(V,4),2);

/*market trend*/

market=Foreign("^dji", "(h+l)/2");

t=9;

Up=IIf(MArket>Ref(MArket,-1),abs(MArket-Ref(MArket,-1)),0);

Dn=IIf(MArket<Ref(MArket,-1),abs(MArket-Ref(MArket,-1)),0);

Ut=Wilders(Up,t);

Dt=Wilders(Dn,t);

RSIt=100*(Ut/(Ut+Dt));

mup=40;//40

mdown=60;//60

mmup=BarsSince(RSIt>70);

mmdown=BarsSince(RSIt<30);

////////////////////

//security trend

Aup=40;//40

Adown=60;//60

up=BarsSince(RSI(9)>70);

down=BarsSince(RSI(9)<30);

///////////////////

//market trading range

trading= mmup<mmdown AND LLV(RSIt,mmup)<mup AND RSIt>30

OR mmdown<mmup AND HHV(RSIt,mmdown)>mdown AND RSIt<70;

//market trending up

trendingup=mmup<mmdown AND LLV(RSIt,mmup)>mup;

//market trending down

trendingdown=mmup>mmdown AND HHV(RSIt,mmdown)<mdown;

test=trendingup OR trendingdown;

Buy=C>5 AND C<10

AND MA(V,22) > ((C*.8) * (C*.8)) * 1000

AND L<fractal1 AND fractal1>H

AND fractal1>fractal2

AND up<down AND LLV(RSI(9),up)>Aup

//and trendingup

AND f1v>f2v

//AND Ref(MA(V,18),-1)>Ref(MA(V,18),-18)

AND f2v/f1v<fractal2/fractal1*0.7

AND Lastrsi/thisrsi<fractal2/fractal1;






------------------------ Yahoo! Groups Sponsor ---------------------~-->
Get A Free Psychic Reading! Your Online Answer To Life's Important Questions.
http://us.click.yahoo.com/Lj3uPC/Me7FAA/ySSFAA/zMEolB/TM
---------------------------------------------------------------------~->

To unsubscribe from this group, send an email to:
Metastockusers-unsubscribe@xxxxxxxxxxx

 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/