- 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 - 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:>

of

> 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

> 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

> - 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: 100Value of slope of ma of XYZ on day 1: 110Value of slope of ma of XYZ on day 30: 400L=(30 -1) = 30Point 2 = (x2, y2) = (30, 401)Point 1 = (x1, y1) = (1, 101)slope = (400 - 100)/(30-1)= 300/30 =100Please note that y2 and y1 are data samples of the slope of the ma.Tri
--- On

**Thu, 1/1/09, Rick**wrote:*<rick2max@...>*From: Rick <rick2max@...>

Subject: [TOS_thinkscript] Re: MA "slope" determination

To: TOS_thinkscript@yahoogroups.com

Date: Thursday, January 1, 2009, 8:28 AMKevin,

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

> - 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**wrote:*<tringuyen99@...>*From: Tri Nguyen <tringuyen99@...>

Subject: Re: [TOS_thinkscript] Re: MA "slope" determination

To: TOS_thinkscript@yahoogroups.com

Date: Thursday, January 1, 2009, 9:16 AMGiven 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: 100Value of slope of ma of XYZ on day 1: 110Value of slope of ma of XYZ on day 30: 400L=(30 -1) = 30Point 2 = (x2, y2) = (30, 401)Point 1 = (x1, y1) = (1, 101)slope = (400 - 100)/(30-1)= 300/30 =100Please note that y2 and y1 are data samples of the slope of the ma.Tri

--- On**Thu, 1/1/09, Rick**wrote:*<rick2max@gmail. com>*From: Rick <rick2max@gmail. com>

Subject: [TOS_thinkscript] Re: MA "slope" determination

To: TOS_thinkscript@ yahoogroups. com

Date: Thursday, January 1, 2009, 8:28 AMKevin,

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

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