# Can anybody convert this metastock formula to amibroker afl

#### velmont86

##### Active Member
{Col A:}

{Filter}
+DI()>Ref(+DI(),-1) AND
Ref(+DI(),-1)>Ref(+DI(),-2) AND
Ref(+DI(),-2)>Ref(+DI(),-3) AND
V>100000

#### johnnypareek

##### Well-Known Member
{Col A:}

{Filter}
+DI()>Ref(+DI(),-1) AND
Ref(+DI(),-1)>Ref(+DI(),-2) AND
Ref(+DI(),-2)>Ref(+DI(),-3) AND
V>100000

Guess It will help.
HTML:
``````z=ADX(14);
x=PDI(14);
trend=z>20 AND z>Ref(z,-1) AND Ref(z,-1)>Ref(z,-2) AND Ref(z,-2)>Ref(z,-3) AND x>Ref(x,-1) AND Ref(x,-1)>Ref(x,-2) AND Ref(x,-2)>Ref(x,-3) AND V>1000001;
Filter=trend;

#### rkkarnani

##### Well-Known Member
{Col A:}

{Filter}
+DI()>Ref(+DI(),-1) AND
Ref(+DI(),-1)>Ref(+DI(),-2) AND
Ref(+DI(),-2)>Ref(+DI(),-3) AND
V>100000
What Reports does this Exploration give? What does the result indicate?

#### velmont86

##### Active Member
{Col A:}

{Filter}
+DI()>Ref(+DI(),-1) AND
Ref(+DI(),-1)>Ref(+DI(),-2) AND
Ref(+DI(),-2)>Ref(+DI(),-3) AND
V>100000

Guess It will help.
HTML:
``````z=ADX(14);
x=PDI(14);
trend=z>20 AND z>Ref(z,-1) AND Ref(z,-1)>Ref(z,-2) AND Ref(z,-2)>Ref(z,-3) AND x>Ref(x,-1) AND Ref(x,-1)>Ref(x,-2) AND Ref(x,-2)>Ref(x,-3) AND V>1000001;
Filter=trend;
not working johny bhai

#### velmont86

##### Active Member
What Reports does this Exploration give? What does the result indicate?

to fine trending stock

#### KelvinHand

##### Well-Known Member
not working johny bhai
not working {sat sun.} johny bhai [?]
Do not [Scan], use [Explore]
Code:
``````z=ADX(14);
x=PDI(14);
Filter=z>20 AND z>Ref(z,-1) AND Ref(z,-1)>Ref(z,-2) AND Ref(z,-2)>Ref(z,-3) AND x>Ref(x,-1) AND Ref(x,-1)>Ref(x,-2) AND Ref(x,-2)>Ref(x,-3) AND V>1000001;

SetOption("NoDefaultColumns", True );
AddColumn( DateTime(), "Date", formatDateTime, colorDefault,colorDefault, 80 );

Last edited:

#### marketblog

##### New Member
HI ..

can anybody also help me to convert this Metastock indicator to amibroker?

pds1:=Input("HHV (long) breakout periods", 1,252,21);
pds2:=Input("LLV (short) breakout periods", 1,252,10);
x:=Input("use Open=1 High=2 Low=3 Close=4 Volume=5 P=6",1,6,4);
delay:=Input("Entry and Exit delay",0,3,0);

x:=If(x=1,O,If(x=2,H,If(x=3,L,If(x=5,V,If(x=6,P,C)))));
In:=x>Ref(HHV(x,pds1),-1);
Out:=x<Ref(LLV(x,pds2),-1);

Init:=Cum(In+Out>-1)=1;
InInit:=Cum(In)=1;