Download software Tutorial videos
Subscription & data-feed pricing Class schedule


New account application Trading resources
Margin rates Stock & option commissions

Attention: Discussion forums are read-only for extended maintenance until further notice.
Welcome Guest, please sign in to participate in a discussion. Search | Active Topics |

PCF using Exponential Stochastics Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
sumpho
Posted : Monday, December 24, 2007 10:13:05 AM
Registered User
Joined: 10/7/2004
Posts: 1
How do I program exponential stochastics in my PCF?
diceman
Posted : Monday, December 24, 2007 11:34:57 AM
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
 
 
 
mmulcahy
Posted : Sunday, March 9, 2008 10:28:33 AM
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

bustermu
Posted : Sunday, March 9, 2008 1:27:09 PM
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
bustermu
Posted : Sunday, March 9, 2008 3:06:51 PM
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
mmulcahy
Posted : Sunday, March 9, 2008 10:50:10 PM
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
Users browsing this topic
Guest-1

Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.