Welcome Guest, please sign in to participate in a discussion. | Search | Active Topics | |
Registered User Joined: 10/7/2004 Posts: 1
|
How do I program exponential stochastics in my PCF?
|
|
Registered User Joined: 1/28/2005 Posts: 6,049
|
You may be interested in this from an ealier post
of mine:
Value A:
STOC20.1
This is the "raw" stochastic value over 20 periods.
Also called %K
-------------------------------------------------------------------------------------------------
Value B:
STOC20.3
This is value A smoothed by a 3 period simple moving
average.
Also called "slow" stochastic.
---------------------------------------------------------------------------------------------------
Value C:
AVG(STOC20.3,3)
This is a 3 period simple smoothing applied to value B.
Also know as %D
-----------------------------------------------------------------------------------------------------
Value D:
XAVG(STOC20.3,3)
This is a 3 period exponential smoothing applied to value B.
Also know as %D
-------------------------------------------------------------------------------------------------------
Value E:
XAVG(STOC20.1,3)
This is value A "raw" stochastic with 3 period exponential smoothing.
--------------------------------------------------------------------------------------------------------
Value D Alternate:
.500488758553275 * (XAVG(STOC20,3) + .5 * (XAVG(STOC20.1.1,3) + .5 * (XAVG(STOC20.1.2,3) + .5 * (XAVG(STOC20.1.3,3) + .5 * (XAVG(STOC20.1.4,3) + .5 * (XAVG(STOC20.1.5,3) + .5 * (XAVG(STOC20.1.6,3) + .5 * (XAVG(STOC20.1.7,3) + .5 * (XAVG(STOC20.1.8,3) + .5 * (XAVG(STOC20.1.9,3)))))))))))
QUOTE (diceman)
How would historical values be written? All these values 7 bars ago?
Value A: STOC20.1.7
Value B: STOC20.3.7
Value C: AVG(STOC20.3.7,3)
Value D: XAVG(STOC20.3.7,3)
Value D Alternate: .500488758553275 * (XAVG(STOC20.1.7,3) + .5 * (XAVG(STOC20.1.8,3) + .5 * (XAVG(STOC20.1.9,3) + .5 * (XAVG(STOC20.1.10,3) + .5 * (XAVG(STOC20.1.11,3) + .5 * (XAVG(STOC20.1.12,3) + .5 * (XAVG(STOC20.1.13,3) + .5 * (XAVG(STOC20.1.14,3) + .5 * (XAVG(STOC20.1.15,3) + .5 * (XAVG(STOC20.1.16,3)))))))))))
Value E: XAVG(STOC20.1.7,3)
Thanks
diceman
|
|
Registered User Joined: 1/3/2005 Posts: 72
|
Thanks,
I wrote the pcf for the following pcf's for the following:
Stochastics 1,2,1 exponential <= 50
XAVG(STOC1.2,1) <= 50
This pcf works fine there are are few values above 50 but for the most part the majority atr under 50.
Stochastics 1,2,1 exponential >= 50
XAVG(STOC1.2,1) >= 50
This pcf has more stocks below 50 than above 50.
Any assistance is appreciated.
Thanks,
Mark
|
|
Registered User Joined: 1/1/2005 Posts: 2,645
|
QUOTE (mmulcahy) I wrote the pcf for the following pcf's for the following:
Stochastics 1,2,1 exponential <= 50
XAVG(STOC1.2,1) <= 50
Mark,
A PCF for Stochastics 1,2,1 exponential <= 50 should be:
XAVG(STOC1.1,2) <= 50
Unfortunately, there appears to be a bug and STOC1.n.0 does not calculate correctly (at least in my system). As far as I know, everything works fine except when the stochastic period is 1 and the delay 0 simlutaneously. There are work-arounds.
Thanks,
Jim Murphy
|
|
Registered User Joined: 1/1/2005 Posts: 2,645
|
Mark,
The following is a work-around for the bug:
Stochastics 1,2,1 exponential <= 50:
(2*100*(C-L)/(H-L+0.000001) + XAVG(STOC1.1.1,2))/3 <= 50
Please see:
http://www.worden.com/training/default.aspx?g=posts&t=5142
Thanks,
Jim Murphy
|
|
Registered User Joined: 1/3/2005 Posts: 72
|
Thanks a MILLION!!! The pcf works PERFECT!! I really appreciate your taking the time to assist in writing this pcf. There are some very talented people that help others in this forum. I'm very grateful for your assistance.
Thanks again,
Mark
|
|
Guest-1 |