Loading ...
Sorry, an error occurred while loading the content.

MA "slope" determination

Expand Messages
  • kevin38cleveland
    Hello all ToS ers. I ve got a question with TS.. specifically if anyone has recommendations on how to determine slope of MA line/s. I m trying to determine
    Message 1 of 5 , Jan 1, 2009
    • 0 Attachment
      Hello all ToS'ers. I've got a question with TS.. specifically if
      anyone has recommendations on how to determine "slope" of MA line/s.
      I'm trying to determine entry/exit and one of the criteria is slope of
      the trend as compared to another trend. I've looked at the function
      listing and I'm not seeing either a function or how to derive it.
      Frustrating language..

      Thanks in advance,
      -Kevin
    • Rick
      Kevin, Here is an idea. You can calculate a slope value by using the percentage of the difference of 2 MA values. Try this formula: Slope=(MA1-MA2)/MA1
      Message 2 of 5 , Jan 1, 2009
      • 0 Attachment
        Kevin,

        Here is an idea. You can calculate a slope value by using the
        percentage of the difference of 2 MA values. Try this formula:
        Slope=(MA1-MA2)/MA1

        Example 1: MA1=100, MA2=90
        Slope=(100-90)/100 or 10

        Example 2: MA1=100, MA2=50
        Slope=(100-50)/100 or 50

        The greater the difference the steeper the slope.

        I hope this helps.

        Rick






        --- In TOS_thinkscript@yahoogroups.com, "kevin38cleveland"
        <pavdog@...> wrote:
        >
        > Hello all ToS'ers. I've got a question with TS.. specifically if
        > anyone has recommendations on how to determine "slope" of MA line/s.
        > I'm trying to determine entry/exit and one of the criteria is slope
        of
        > the trend as compared to another trend. I've looked at the function
        > listing and I'm not seeing either a function or how to derive it.
        > Frustrating language..
        >
        > Thanks in advance,
        > -Kevin
        >
      • Tri Nguyen
        Given Point 1 (x1, y1) and Point 2 (x2, y2), the formula for a slope is:   slope = (y2 - y1)/(x2 - x1)   so, given an MA for length L (L would be 30 if you
        Message 3 of 5 , Jan 1, 2009
        • 0 Attachment
          Given Point 1 (x1, y1) and Point 2 (x2, y2), the formula for a slope is:
           
          slope = (y2 - y1)/(x2 - x1)
           
          so, given an MA for length L (L would be 30 if you have a 30 period moving average).
           
          In our case L=x2 -x1.
           
          slope=(y2-y1)/L.
           
          Example.  Say you put a 30 day moving avverage on XYZ and it goes up 10 points a day.
           
          Value of slope of ma of XYZ on day 0: 100
          Value of slope of ma of XYZ on day 1: 110
          Value of slope of ma of XYZ on day 30: 400
           
          L=(30 -1) = 30
           
          Point 2 = (x2, y2) = (30, 401)
          Point 1 = (x1, y1) = (1, 101)
           
          slope = (400 - 100)/(30-1)
                   = 300/30 =100
           
          Please note that y2 and y1 are data samples of the slope of the ma.
           
          Tri


          --- On Thu, 1/1/09, Rick <rick2max@...> wrote:
          From: Rick <rick2max@...>
          Subject: [TOS_thinkscript] Re: MA "slope" determination
          To: TOS_thinkscript@yahoogroups.com
          Date: Thursday, January 1, 2009, 8:28 AM

          Kevin,

          Here is an idea. You can calculate a slope value by using the
          percentage of the difference of 2 MA values. Try this formula:
          Slope=(MA1-MA2) /MA1

          Example 1: MA1=100, MA2=90
          Slope=(100-90) /100 or 10

          Example 2: MA1=100, MA2=50
          Slope=(100-50) /100 or 50

          The greater the difference the steeper the slope.

          I hope this helps.

          Rick

          --- In TOS_thinkscript@ yahoogroups. com, "kevin38cleveland"
          <pavdog@...> wrote:
          >
          > Hello all ToS'ers. I've got a question with TS.. specifically if
          > anyone has recommendations on how to determine "slope" of MA line/s.
          > I'm trying to determine entry/exit and one of the criteria is slope
          of
          > the trend as compared to another trend. I've looked at the function
          > listing and I'm not seeing either a function or how to derive it.
          > Frustrating language..
          >
          > Thanks in advance,
          > -Kevin
          >

        • Tri Nguyen
          by the way, an moving averages are slopes themselves.  To put a slope on the MA of the price, one could use the moving average function on the MA of the
          Message 4 of 5 , Jan 1, 2009
          • 0 Attachment
            by the way, an moving averages are slopes themselves.  To put a slope on the MA of the price, one could use the moving average function on the MA of the price.
             
            Tri

            --- On Thu, 1/1/09, Tri Nguyen <tringuyen99@...> wrote:
            From: Tri Nguyen <tringuyen99@...>
            Subject: Re: [TOS_thinkscript] Re: MA "slope" determination
            To: TOS_thinkscript@yahoogroups.com
            Date: Thursday, January 1, 2009, 9:16 AM

            Given Point 1 (x1, y1) and Point 2 (x2, y2), the formula for a slope is:
             
            slope = (y2 - y1)/(x2 - x1)
             
            so, given an MA for length L (L would be 30 if you have a 30 period moving average).
             
            In our case L=x2 -x1.
             
            slope=(y2-y1) /L.
             
            Example.  Say you put a 30 day moving avverage on XYZ and it goes up 10 points a day.
             
            Value of slope of ma of XYZ on day 0: 100
            Value of slope of ma of XYZ on day 1: 110
            Value of slope of ma of XYZ on day 30: 400
             
            L=(30 -1) = 30
             
            Point 2 = (x2, y2) = (30, 401)
            Point 1 = (x1, y1) = (1, 101)
             
            slope = (400 - 100)/(30-1)
                     = 300/30 =100
             
            Please note that y2 and y1 are data samples of the slope of the ma.
             
            Tri


            --- On Thu, 1/1/09, Rick <rick2max@gmail. com> wrote:
            From: Rick <rick2max@gmail. com>
            Subject: [TOS_thinkscript] Re: MA "slope" determination
            To: TOS_thinkscript@ yahoogroups. com
            Date: Thursday, January 1, 2009, 8:28 AM

            Kevin,

            Here is an idea. You can calculate a slope value by using the
            percentage of the difference of 2 MA values. Try this formula:
            Slope=(MA1-MA2) /MA1

            Example 1: MA1=100, MA2=90
            Slope=(100-90) /100 or 10

            Example 2: MA1=100, MA2=50
            Slope=(100-50) /100 or 50

            The greater the difference the steeper the slope.

            I hope this helps.

            Rick

            --- In TOS_thinkscript@ yahoogroups. com, "kevin38cleveland"
            <pavdog@...> wrote:
            >
            > Hello all ToS'ers. I've got a question with TS.. specifically if
            > anyone has recommendations on how to determine "slope" of MA line/s.
            > I'm trying to determine entry/exit and one of the criteria is slope
            of
            > the trend as compared to another trend. I've looked at the function
            > listing and I'm not seeing either a function or how to derive it.
            > Frustrating language..
            >
            > Thanks in advance,
            > -Kevin
            >

          • Tom Mosher
            Kevin, Using a classical arithmetic slope (rise/run) is going to cause you a problem because the slopes of two stocks with different prices will not be
            Message 5 of 5 , Jan 1, 2009
            • 0 Attachment
              Kevin,

              Using a classical arithmetic slope (rise/run) is going to cause you a problem because the slopes of two
              stocks with different prices will not be comparable.  To illustrate, say you are computing a 3-day slope.
              If both GE and GOOG rise by 30 points in 3 days, their slopes will be the same, 10pts/day.  But I'm
              sure you'll agree that a 10 point/day rise in GE is far more significant than the same move in GOOG.

              You're better off basing your indicator on price ratios rather than price differences.  Then everything
              will be apples to apples.

              TOS' RateOfChange indicator can be used to do what you need.  The following should work:

                input maLength = 50;
                input lookback = 20;

                plot maSlope = reference
                 rateOfChange(price=average(close,maLength), length=lookback).roc;


              Tom


            Your message has been successfully submitted and would be delivered to recipients shortly.