Discussions
»
Product and Service Development
»
Formula Assistance
»
Can anyone help me with getting the slope of a moving averag
Rank: Advanced Member
Groups: Registered, Registered Users Joined: 4/21/2005(UTC) Posts: 33
|
average line? I realize that it is fluid and not a straight line most of the time, but if someone could help me figure out code to reference the current moving average, and then a point somewhere in the past of that same moving average line and calculating a slope from it--that would be great. Or really a linear regression line slope would do basically the same thing. I just can't figure out how to reference a point on the same line in the past and then calculate the slope from those two points. thanks for any help
biff
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers, Unverified Users Joined: 10/28/2004(UTC) Posts: 3,111 Location: Perth, Western Australia
Was thanked: 16 time(s) in 16 post(s)
|
How you want to define slope?
In percent? As a function of price?
Have a look at the ROC() function, it may help you out.
wabbit :D
|
|
|
|
Rank: Newbie
Groups: Registered, Registered Users Joined: 7/8/2005(UTC) Posts: 3 Location: Seattle area
|
Where the value of a 20 peroid Simple Moving Average of closing prices referenced 5 bars ago is Greater than the value of the same average times a variable (dividing by the same variable results in a similar down slope)
Ref(Mov(C,20,S)-5 >Mov(C,20,S)*Opt1
Where the value of a 20 peroid Simple Moving Average of closing prices referenced 5 bars ago is divided by the value of the same average results in a number close to one 1.01 would be 1% advance in 5 periods.
Ref(Mov(C,20,S)-5 / Mov(C,20,S)
|
|
|
|
Users browsing this topic |
Guest (Hidden)
|
Discussions
»
Product and Service Development
»
Formula Assistance
»
Can anyone help me with getting the slope of a moving averag
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.