PureBytes Links
Trading Reference Links
|
Here is a holy grail system for the Tick Line Momentum Oscillator. Try
this TLMO system with your equity index or futures in data1 and TICK in
data2. Optimize the Len1,Len2,overbought OB, oversold OS, and the K factor
(exponential smoothing of momentum). You may be surprised at the results.
Feel free to improve the amaturish coding and share it with the rest of us.
BobR
{Index in data1, TICK in data2, K is the exponential smoothing constant.
0.333 is default for 5 day smoothing.
Other values for K for different smoothing:
2 day K = 0.667
3 day K = 0.50
5 day K = 0.333
7 day K = 0.25
9 day K = 0.20
19 day K = 0.1}
Inputs: Price(C of data2), Len1(10),Len2(5),OB(2),OS(-2),K(0.333);
Vars: XMA(0), Rating(0),OnBalTick(1),TLM(0),TLMA(0),TLMO(0);
XMA = XAverage(Price,Len1); {expontial average of TICK}
Rating = IFF(Price>XMA[1],1,(IFF(Price<XMA[1],-1,0))); {1 if C>xma, -1 if
C<XMA, O if C=XMA}
OnBalTick = Rating + Rating[1]; {running total of the rating
classification}
TLM = OnBalTick - OnBalTick[Len2]; {momentum for period Len2, 5 day default}
TLMA = Average(TLM,Len2); {simple average of the momentum}
TLMO = K*(TLMA-TLMA[1]) +TLMA[1]; {exponential average of momentum}
If TLMO < OS and TLMO > TLMO[1] then buy on close;
If TLMO > OB and TLMO < TLMO[1] then sell on close;
Attachment Converted: "c:\eudora\attach\Tlmosys.ela"
|