in Search

Calculating slope of a an indicator

Last post 03-11-2006, 21:11 by StorkBite. 2 replies.
Sort Posts: Previous Next
  •  02-27-2006, 23:05 15114

    Calculating slope of a an indicator

    This is probably a dumb question but here goes.

    If I have a buy signal contingent on (among other things) the RSI sloping net higher over the last 10 days, what indicator do I use in my formula to calculate the slope of the RSI?
  •  03-11-2006, 19:12 15448 in reply to 15114

    Re: Calculating slope of a an indicator

    neal:
    This is probably a dumb question but here goes.

    If I have a buy signal contingent on (among other things) the RSI sloping net higher over the last 10 days, what indicator do I use in my formula to calculate the slope of the RSI?


    get the rate of change of it i thin
  •  03-11-2006, 21:11 15451 in reply to 15114

    Re: Re: Calculating slope of a an indicator

    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:

    {_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

    Traders' Consortium
View as RSS news feed in XML