- Katılım
- 23 Eki 2020
- Mesajlar
- 1,826
Is the name of an article in the December issue of TASC, written by Dennis Meyers. In it he describes what he calls "The Recursive Moving Trend Average". I wont go into all the article right now, but here is my translationof his math (for Metastock 6.5) : |
|
Recursive Moving Trend Average Lb:=Input("Look-Back Period?",3,100,21); Alpha:=2/(LB+1); Bot:=(1-Alpha)*(If(Cum(1)<Lb,C,PREV))+C; RMTA:=(1-Alpha)*(If(Cum(1)<Lb,C,PREV))+ (Alpha*Abs(C+Bot-Ref(Bot,-1))); RMTA; |
|
He then explains how to make an oscillator by subtracting an Exponential MAform the Recursive MA...... again here is the code: |
|
TOSC Oscillator Lb:=Input("Look-Back Period?",3,100,21); Alpha:=2/(LB+1); Bot:=(1-Alpha)*(If(Cum(1)<Lb,C,PREV))+C; RMTA:=(1-Alpha)*(If(Cum(1)<Lb,C,PREV))+ (Alpha*Abs(C+Bot-Ref(Bot,-1))); TOSC:=RMTA-Mov(C,lb,E); TOSC; |
|
Here is the code for System Testing : |
|
Recursive Moving Trend Average System Test Buy Long: Lb:=opt1; ent:=3; Alpha:=2/(LB+1); Bot:=(1-Alpha)*(If(Cum(1)<Lb,C,PREV))+C; RMTA:=(1-Alpha)*(If(Cum(1)<Lb,C,PREV))+(Alpha*Abs(C+Bot-Ref(Bot,-1))); TOSC:=RMTA-Mov(C,lb,E); Cross(tosc,(0-Abs(ent))) Sell short: Lb:=opt1; ent:=3; Alpha:=2/(LB+1); Bot:=(1-Alpha)*(If(Cum(1)<Lb,C,PREV))+C; RMTA:=(1-Alpha)*(If(Cum(1)<Lb,C,PREV))+(Alpha*Abs(C+Bot-Ref(Bot,-1))); TOSC:=RMTA-Mov(C,lb,E); Cross((0+Abs(ent)),tosc) Opt1 is the look- back periods, of 3 to 30 |
Opt2 is the entry value of the oscillator, 0 to 5 Now, after all the hours spent on figuring out the code, I havediscoveredthat the RMTA plots very similar to the DEMA, oh well............ Adam Hefner e-mail: VonHef@itlnet.net | |
| |
Source / From: |