Rank: Advanced Member
Groups: Registered, Registered Users Joined: 3/19/2005(UTC) Posts: 2,995
Was thanked: 14 time(s) in 10 post(s)
|
Hey Neal-
There has been some discussion on slope in the past, but unfortunately, the forum search feature is hosed... Perhaps you can Google the site as previously suggested by other members. Anyhow... the slope solution will depend upon your definition of slope. There are quite a few ways to determine rise and fall. If you want to play with simple ratios and lookback periods, you might try this quick example that I made:
[code:1:ec2d60e8ef]
{_g4_ComparativeAnalysis v1.0, g_stockman, 2006}
{ user inputs }
i1:=Input("RSI periods",1,100,14);
i2:=Input("Lookback periods",1,100,10);
i3:=Input("Data Array (Open=1 High=2 Low=3 Close=4)",1,4,4);
i3:=If(i3=1,O,If(i3=2,H,If(i3=3,L,C)));
i4:=Input("Plot (Slope=1 Signals=2)",1,2,1);
{ comparative calculations }
a1:=RSI(i3,i1);
a2:=Ref(a1,-i2);
b1:=Min(a1,a2)/Max(a1,a2)*100;
{ signals }
up:=If(a1>a2,1,0);
dn:=If(a1<a2,-1,0);
{ plot }
plot:=
If(i4=1,b1,
If(up=1 AND BarsSince(Ref(up, -1)) > 0,1,
If(dn=-1 AND BarsSince(Ref(dn, -1)) > 0,-1,0)));
if(i4=1,plot,0);
plot
[/code:1:ec2d60e8ef]
|