Welcome Guest, please sign in to participate in a discussion. | Search | Active Topics | |
Platinum Customer
Joined: 12/6/2005 Posts: 10
|
I'm brand new to TC2000 and am trying to create a custom indicator that I use in other programs. Basically it's a 3 period exponential moving average of a stochastic of a stochastic, but I haven't been able to figure out the way to write it in TC2000. I've gotten close, but am not getting the same oscillator pattern.
Here's the formula I use in another program:
P0:=Mov(((C-LLV(L,10))/(HHV(H,10)-LLV(L,10)))*100,3,E);
A0:=Mov(((P0-LLV(P0,10))/(HHV(P0,10)-LLV(P0,10)))*100,3,E); A0;
Basically it creates an indicator "PO" by subtracting the Lowest Lows of 10 periods from the Close ..., etc.
Then after that calculation is done for "PO", I use that formula as part of the second formula "A0" and then just plot "AO."
I really love TC2000 and would like to be able to use this indicator with it if possible.
Can anyone help me reproduce this in TC2000 please?
|
|
Worden Trainer
Joined: 10/1/2004 Posts: 18,819
|
You will have to modify this to fit your settings:
A 10-period STOC of a STOC20.30
When you add the custom indicator, set the period to 3 exponential and use this formula (change to fit your settings):
100*(STOC20.30 - MIN(STOC20.30,10))/(MAX(STOC20.30,10)-MIN(STOC20.30,10))
replace the 10, 20 and 30 in the formula to match the settings you like. I am not sure but your code looks like
A 10-period STOC of a STOC10.3
- Craig Here to Help!
|
|
Platinum Customer
Joined: 12/6/2005 Posts: 10
|
Thanks Craig,
Wow, you're fast! Very impressive.
Yes, I like the parameters of the 10,3. I did as you said and it is VERY, VERY close, but still a little off in a few areas. Not sure why. Will keep tweaking. Let me know if anything comes to mind.
|
|
Registered User Joined: 1/1/2005 Posts: 2,645
|
mmentors,
The reason you are off is that the first moving average Craig used is a Simple Moving Average rather than an Exponential Moving Average as you requested.
One can write a PCF for exactly what you requested, but its length makes it well beyond what even Bruce would write. As you can see, it is quite trivial if you are willing to settle for the first MA being an SMA.
Thanks, Jim Murphy
|
|
Guest-1 |