New version 18 available now


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


New account application Trading resources
Margin rates Stock & option commissions

Welcome Guest, please sign in to participate in a discussion. Search | Active Topics |

Heikin-Ashi coding in PCF Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
HarleyBD
Posted : Friday, June 01, 2018 10:12:04 AM
Gold Customer Gold Customer

Joined: 6/30/2014
Posts: 31

Hi.  I've enjoyed coding in PSF and the discussion on this website for several years now.  It's a great addition to my stock trading.   I've looked at Heikin-Ashi recently and naturally have the question:  "Can we program using the Heikin model in PCF?".  I am asking this question but DO NOT WANT TO ROCK ANY BOATS!

VALUE       Heikin-Ashi Definition

Close  = (Open+High+Low+Close)/4
Open   = (Open (previous bar) + Close (previous bar))/2
High   = Max (High, Open or Close)
Low    = Min (Low, Open or Close)

 

These definitions would put into question the PCF values of C, H, L, O.

Thanks

Bruce_L
Posted : Friday, June 01, 2018 10:38:33 AM


Worden Trainer

Joined: 10/7/2004
Posts: 63,442

Yes, we can write formulas using HA values.

HA Open (I know it doesn't look like you definition, but it really does match):

XAVG(O1 + H1 + L1 + C1, 3) / 4

HA High:

GREATEST(H, XAVG(O1 + H1 + L1 + C1, 3) / 4)

HA Low:

LEAST(L, XAVG(O1 + H1 + L1 + C1, 3) / 4)

HA Close:

(O + H + L + C) / 4

So it is generally just a matter of substituting in the desired values into your formulas in place of the normal O, H, L, or C syntax.

There are quite a few questions about HA already in the forums, so if you have something in particular you want to do, you may find somebody else has already tried to do it (in which case you might be able to find it with a search).

Learn how to use the forums: post a new topic, reply, Search existing topics



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
HarleyBD
Posted : Friday, June 01, 2018 12:02:11 PM
Gold Customer Gold Customer

Joined: 6/30/2014
Posts: 31

Wow!  You did it again, Bruce.  Like Al G. Ive had too much coffee and sent the request twice.

So for both StockGuy and Bruce  thanks!

 

 

Bruce_L
Posted : Friday, June 01, 2018 12:32:26 PM


Worden Trainer

Joined: 10/7/2004
Posts: 63,442

You're welcome.



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
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.