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

HEIKIN-ASHI CANDLESTICK OSCILLATOR Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
Snegir
Posted : Wednesday, June 22, 2011 3:03:11 AM
Registered User
Joined: 10/7/2004
Posts: 80
Is it possible to reproduce in TC2000 a formula for HEIKIN-ASHI CANDLESTICK OSCILLATOR which in Stockfinder looks like that:RealCode: 'Green Candle v1Static haOpen As SingleStatic haC As SingleIf isFirstBar Then haOpen = Price.OpenElse haOpen = (haOpen+(Price.Open(1)+Price.High(1)+Price.Low(1)+Price.Last(1))/4)/2End IfhaC = ((Price.Open+Price.High+Price.Low+Price.Last)/4+haOpen+ _ System.Math.Max(Price.High,haOpen)+System.Math.Min(Price.Low,haOpen))/4If haC >= haOpen Then Pass see: http://www.traders.com/documentation/FEEDbk_docs/2008/12/TradersTips.html#10
Bruce_L
Posted : Wednesday, June 22, 2011 8:28:49 AM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138
Your formula would appear to be a RealCode Condition designed to identify "first version of the green candle". I believe it could be converted into a Boolean Personal Criteria Formula as:

((O + H + L + C) / 4 + (XAVGO3 + XAVGH3 + XAVGL3 + XAVGC3) / 4 + (H + (XAVGO3 + XAVGH3 + XAVGL3 + XAVGC3) / 4 + ABS(H - (XAVGO3 + XAVGH3 + XAVGL3 + XAVGC3) / 4)) / 2 + (L + (XAVGO3 + XAVGH3 + XAVGL3 + XAVGC3) / 4 - ABS(L - (XAVGO3 + XAVGH3 + XAVGL3 + XAVGC3) / 4)) / 2) / 4 >= (XAVGO3 + XAVGH3 + XAVGL3 + XAVGC3) / 4

PCF Formula Descriptions
Handy PCF example formulas to help you learn the syntax of PCFs!

-Bruce
Personal Criteria Formulas
TC2000 Support Articles
jason.rennie
Posted : Sunday, January 29, 2012 5:29:53 PM
Registered User
Joined: 12/28/2011
Posts: 120
I'm quite new to TC2000.. so this might be really simple.... I'm looking for a condition which is true when the previous Heiken Ashi candle was red and the current one is green. To look for trend changes..I found this forum topic but when I put the formula above into TC2000 it _seems_ to just return true when the most recent Heiken Ashi candle is green... Regardless of the color of the preceding candle.. So I get a LOT more ticks than I want..Really I dont understand why the formula above uses Averages and not just calculations based on the preceding 2 OHLC values...Hope you can help !-Jason
jason.rennie
Posted : Sunday, January 29, 2012 5:54:24 PM
Registered User
Joined: 12/28/2011
Posts: 120
I think I may have found an answer to my own question ! Does this look correct to you ??? (((O + H + L + C) / 4 - (XAVGO3.1 + XAVGH3.1 + XAVGL3.1 + XAVGC3.1) / 4) > 0.0 ) AND (((O1 + H1 + L1 + C1) / 4 - (XAVGO4.2 + XAVGH4.2 + XAVGL4.2 + XAVGC4.2) / 4) < 0.0 ) Its a simple adaptation of a formula I found here http://forums.worden.com/default.aspx?g=posts&t=53959 (ps.. I'm a platinum member but my last post just said I was a "Registered user" Is my subscription setup correctly ?)
Bruce_L
Posted : Monday, January 30, 2012 9:17:18 AM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138
Assuming you have the color of Price History based on Open vs Close, I think your formula should work just fine.

-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.