logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
MS Support  
#1 Posted : Thursday, April 11, 2024 7:52:25 PM(UTC)
MS Support

Rank: Advanced Member

Groups: Moderators, Registered, Registered Users, Subscribers
Joined: 10/8/2010(UTC)
Posts: 1,934

Thanks: 85 times
Was thanked: 154 time(s) in 150 post(s)

Perry Kaufman’s article, “Gap Momentum,” introduced his new Gap Momentum Indicator and a trading system based on it. Below are the MetaStock formulas for the indicator and system test.  The system test formulas could also be used in an expert advisor.

Gap Momentum Indicator:

Code:
mpds:= Input("Gap Momentum Periods", 2, 500, 40);
spda:= Input("Signal Line Periods", 2, 200, 20);
gap:= OPEN - Ref(CLOSE, -1);
upgap:= Sum( If( gap > 0, gap, 0), mpds);
dngap:= Sum( If( gap < 0, Neg(gap), 0), mpds);
denom:= If(dngap = 0, -1, dngap);
gapratio:= If(denom = -1, 1, 100 * (upgap / denom));
sig:= Mov(gapratio, spda, S);
gapratio;
sig

Gap Momentum System Test:

Buy Order:

Code:
mpds:= 40;
spda:= 20;
gap:= OPEN - Ref(CLOSE, -1);
upgap:= Sum( If( gap > 0, gap, 0), mpds);
dngap:= Sum( If( gap < 0, Neg(gap), 0), mpds);
denom:= If(dngap = 0, -1, dngap);
gapratio:= If(denom = -1, 1, 100 * (upgap / denom));
sig:= Mov(gapratio, spda, S);
dir:= roc(sig, 1, $);
cross(dir, 0)

Sell Order:

​​​​​​​

Code:
mpds:= 40;
spda:= 20;
gap:= OPEN - Ref(CLOSE, -1);
upgap:= Sum( If( gap > 0, gap, 0), mpds);
dngap:= Sum( If( gap < 0, Neg(gap), 0), mpds);
denom:= If(dngap = 0, -1, dngap);
gapratio:= If(denom = -1, 1, 100 * (upgap / denom));
sig:= Mov(gapratio, spda, S);
dir:= roc(sig, 1, $);
cross(0, dir)

Users browsing this topic
Guest (Hidden)
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.