Rank: Advanced Member
Groups: Moderators, Registered, Registered Users, Subscribers Joined: 10/8/2010(UTC) Posts: 1,960
Thanks: 92 times Was thanked: 155 time(s) in 150 post(s)
|
Max Gardner’s article, “Trading Indexes with the Hull Moving
Average” describes the Hull Moving Average and a system using it.
You can add the average to MetaStock with
these steps:
- Tools menu, select New to open the Indicator Editor
for a new indicator.
-
hmap := input("Moving Average Periods",1, 200,
20);
Mov((2*Mov(C,hmap/2,W))-Mov(C,hmap,W),
LastValue(Sqrt(hmap)),W)
- Ok to close the Indicator Editor.
The system test formulas require MetaStock 10.0 or
later.
- Tools > the New
- Buy Order tab and enter the
following formula.
hmap:= 4; { Hull
Moving Average time periods }
hma:= Mov((2*Mov(C,hmap/2,W))-Mov(C,hmap,W),
LastValue(Sqrt(hmap)),W);
el:=C > Mov(C,50,S) AND
ROC(hma,1,$) > 0 AND
RSI(hma,9) < 50 AND
C > Ref(C, -59);
xl:= RSI(hma,9) > 90;
trade:= If(PREV<=0, If( el, C, 0),
If((C-PREV)/PREV < -0.05, -1,
If((C-PREV)/PREV > 0.15, -2,
If(xl, -3, PREV))));
Cross(trade >0, 0.5)
- Sell Order tab and enter
the following formula.
hmap:= 4; { Hull
Moving Average time periods }
hma:= Mov((2*Mov(C,hmap/2,W))-Mov(C,hmap,W),
LastValue(Sqrt(hmap)),W);
el:=C > Mov(C,50,S) AND
ROC(hma,1,$) > 0 AND
RSI(hma,9) < 50 AND
C > Ref(C, -59);
xl:= RSI(hma,9) > 90;
trade:= If(PREV<=0, If( el, C, 0),
If((C-PREV)/PREV < -0.05, -1,
If((C-PREV)/PREV > 0.15, -2,
If(xl, -3, PREV))));
trade <0
- OK to close the system editor.
|
|