in Search

anyone can help code these formulae

Last post 11-04-2009, 1:21 by bull&bear. 4 replies.
Sort Posts: Previous Next
  •  10-22-2009, 21:49 30988

    anyone can help code these formulae

    1) the nr of days macd > than its signal line.

    2)the nr of days macd > 0

    3)the nr of days close > parabolic stop & reversal (0.2, 0.02)

    4)the nr of days ema20 > ema5

    5)the nr of days counting backwards from today golden cross(ema20cross over & cut above ema50) has taken place.

  •  10-24-2009, 21:02 30995 in reply to 30988

    Re: anyone can help code these formulae

       I am assuming "nr" = number so you would want to use the
       BarsSince() function which gives you the # bars since the function was last
       true.

  •  10-29-2009, 3:51 31028 in reply to 30995

    Re: anyone can help code these formulae

    Are these correct? :

    barssince(c-sar(0.02,0.2)>0)

    barssince((mov(c,26,e))-(mov(c,12,e))>0)

    Pls adv

  •  10-29-2009, 20:54 31037 in reply to 31028

    Re: anyone can help code these formulae

     Yes, if that is what you are looking for. Now put them in two new indicators
      and plot them to find out:
     Like:

     a1:=barssince(c-sar(0.02,0.2)>0);

    a1

    and

    b1:=barssince((mov(c,26,e))-(mov(c,12,e))>0);

    b1



  •  11-04-2009, 1:21 31095 in reply to 31037

    Re: anyone can help code these formulae

    I have tried above 2 formulae,but do not work.

    the chart shows closing price is above sar,yet the result is 0 or the price is below sar,the result is 5 days above sar.

    there are even NA

    by the way why got na,data explored are > 200days.

    it is the same for macd,conflicting & wrong results

    any expert can adv futher ?

View as RSS news feed in XML