Rank: Advanced Member
Groups: Registered, Registered Users Joined: 3/19/2005(UTC) Posts: 2,995
Was thanked: 14 time(s) in 10 post(s)
|
**** Reposted for denl ****
Instantaneous Trendline and Sinewave Indicator
by John Ehlers
Here is the MetaStock 6.52 or higher formula code for the Instantaneous Trendline and Sinewave Indicator as described by John Ehlers in his article “At Last! A Trend-Friendly Oscillator”. To implement them the following formulas must be created in MetaStock’s Indicator Builder. Each formula must be created separately and must be named exactly as it appears below. Only the last two formulas are plotted, so you may wish to prevent the others from being displayed in the Indicator QuickList by unchecking the “Display In QuickList” option when creating the formula.
To download and install the formulas use the following steps
Download the MS65FORM.DTA file into a temp folder
To Download the file for this formula click MS65FORM.DTA
Use the following instructions to Import the MS65FORM.DTA file from the temp file it was downloaded to.
1. Run MetaStock.
2. Choose Indicator Builder from the Tools menu.
3. Click the Organize button to launch the Formula Organizer Wizard.
4. Follow the on-screen instructions.
[code:1:a0acd3b632]Name: H cycle count 1a
value:= Fml("Hilbert cycle period - 1a");
If(Sum(value,6)>=360 AND Sum(value,5)<360 ,6,0) +
If(Sum(value,7)>=360 AND Sum(value,6)<360 ,7,0) +
If(Sum(value,8)>=360 AND Sum(value,7)<360 ,8,0) +
If(Sum(value,9)>=360 AND Sum(value,8)<360 ,9,0) +
If(Sum(value,10)>=360 AND Sum(value,9)<360 ,10,0) +
If(Sum(value,11)>=360 AND Sum(value,10)<360 ,11,0) +
If(Sum(value,12)>=360 AND Sum(value,11)<360 ,12,0) +
If(Sum(value,13)>=360 AND Sum(value,12)<360 ,13,0) +
If(Sum(value,14)>=360 AND Sum(value,13)<360 ,14,0) +
If(Sum(value,15)>=360 AND Sum(value,14)<360 ,15,0) [/code:1:a0acd3b632]
[code:1:a0acd3b632]Name: H cycle count 2a
value:= Fml("Hilbert cycle period - 1a");
If(Sum(value,16)>=360 AND Sum(value,15)<360 ,16,0) +
If(Sum(value,17)>=360 AND Sum(value,16)<360 ,17,0) +
If(Sum(value,18)>=360 AND Sum(value,17)<360 ,18,0) +
If(Sum(value,19)>=360 AND Sum(value,18)<360 ,19,0) +
If(Sum(value,20)>=360 AND Sum(value,19)<360 ,20,0) +
If(Sum(value,21)>=360 AND Sum(value,20)<360 ,21,0) +
If(Sum(value,22)>=360 AND Sum(value,21)<360 ,22,0) +
If(Sum(value,23)>=360 AND Sum(value,22)<360 ,23,0) +
If(Sum(value,24)>=360 AND Sum(value,23)<360 ,24,0) +
If(Sum(value,25)>=360 AND Sum(value,24)<360 ,25,0) [/code:1:a0acd3b632]
[code:1:a0acd3b632]Name: H cycle count 3a
value:= Fml("Hilbert cycle period - 1a");
If(Sum(value,26)>=360 AND Sum(value,25)<360 ,26,0) +
If(Sum(value,27)>=360 AND Sum(value,26)<360 ,27,0) +
If(Sum(value,28)>=360 AND Sum(value,27)<360 ,28,0) +
If(Sum(value,29)>=360 AND Sum(value,28)<360 ,29,0) +
If(Sum(value,30)>=360 AND Sum(value,29)<360 ,30,0) +
If(Sum(value,31)>=360 AND Sum(value,30)<360 ,31,0) +
If(Sum(value,32)>=360 AND Sum(value,31)<360 ,32,0) +
If(Sum(value,33)>=360 AND Sum(value,32)<360 ,33,0) +
If(Sum(value,34)>=360 AND Sum(value,33)<360 ,34,0) +
If(Sum(value,35)>=360 AND Sum(value,34)<360 ,35,0) [/code:1:a0acd3b632]
[code:1:a0acd3b632]Name: H ip sum 1
pd:=Int(Fml("Hilbert cycle period - final-a"));
pr:=(H+L)/2;
(Cos(0)*pr)+
(Cos(360*(1/pd))*Ref(pr,-1))+
(Cos(360*(2/pd))*Ref(pr,-2))+
(Cos(360*(3/pd))*Ref(pr,-3))+
(Cos(360*(4/pd))*Ref(pr,-4))+
(Cos(360*(5/pd))*Ref(pr,-5))+
If(pd>6, Cos(360*(6/pd))*Ref(pr,-6), 0)+
If(pd>7, Cos(360*(7/pd))*Ref(pr,-7), 0)+
If(pd>8, Cos(360*(8/pd))*Ref(pr,-8), 0)+
If(pd>9, Cos(360*(9/pd))*Ref(pr,-9), 0)+
If(pd>10, Cos(360*(10/pd))*Ref(pr,-10), 0)+
If(pd>11, Cos(360*(11/pd))*Ref(pr,-11), 0)+
If(pd>12, Cos(360*(12/pd))*Ref(pr,-12), 0)+
If(pd>13, Cos(360*(13/pd))*Ref(pr,-13), 0)+
If(pd>14, Cos(360*(14/pd))*Ref(pr,-14), 0) [/code:1:a0acd3b632]
[code:1:a0acd3b632]Name: H ip sum 2
pd:=Int(Fml("Hilbert cycle period - final-a"));
pr:=(H+L)/2;
If(pd>15, Cos(360*(15/pd))*Ref(pr,-15), 0)+
If(pd>16, Cos(360*(16/pd))*Ref(pr,-16), 0)+
If(pd>17, Cos(360*(17/pd))*Ref(pr,-17), 0)+
If(pd>18, Cos(360*(18/pd))*Ref(pr,-18), 0)+
If(pd>19, Cos(360*(19/pd))*Ref(pr,-19), 0)+
If(pd>20, Cos(360*(20/pd))*Ref(pr,-20), 0)+
If(pd>21, Cos(360*(21/pd))*Ref(pr,-21), 0)+
If(pd>22, Cos(360*(22/pd))*Ref(pr,-22), 0)+
If(pd>23, Cos(360*(23/pd))*Ref(pr,-23), 0)+
If(pd>24, Cos(360*(24/pd))*Ref(pr,-24), 0) [/code:1:a0acd3b632]
[code:1:a0acd3b632]Name: H ip sum 3
pd:=Int(Fml("Hilbert cycle period - final-a"));
pr:=(H+L)/2;
If(pd>25, Cos(360*(25/pd))*Ref(pr,-25), 0)+
If(pd>26, Cos(360*(26/pd))*Ref(pr,-26), 0)+
If(pd>27, Cos(360*(27/pd))*Ref(pr,-27), 0)+
If(pd>28, Cos(360*(28/pd))*Ref(pr,-28), 0)+
If(pd>29, Cos(360*(29/pd))*Ref(pr,-29), 0)+
If(pd>30, Cos(360*(30/pd))*Ref(pr,-30), 0)+
If(pd>31, Cos(360*(31/pd))*Ref(pr,-31), 0)+
If(pd>32, Cos(360*(32/pd))*Ref(pr,-32), 0)+
If(pd>33, Cos(360*(33/pd))*Ref(pr,-33), 0)+
If(pd>34, Cos(360*(34/pd))*Ref(pr,-34), 0) [/code:1:a0acd3b632]
Name: H rp sum 1
pd:=Int(Fml("Hilbert cycle period - final-a&q [ORIGINAL SUBMISSION TRUNCATED]
|