Registered User Joined: 10/7/2004 Posts: 4
|
I am looking for the correct formula for CLOSE (C) in HA format.
I understand that HA CLOSE is defined as "(Open + High + Low + Close)/4" or the average price of the current bar.
According to Bruce L, posted 1/13/2011, "Close = C".
To me, that does not compute. It is not cosistent with the HA definition!.
Can you help me?
Gordo1
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
The calculations for in Heiken-Ashi candles built into TC2000 version 12 changed between the post you found and the current calculations.
A formula for the Open of TC2000 version 12's Heiken-Ashi candles would be:
(XAVGO3.1 + XAVGH3.1 + XAVGL3.1 + XAVGC3.1) / 4
A formula for the High of TC2000 version 12's Heiken-Ashi candles would be:
(H + (XAVGO3.1 + XAVGH3.1 + XAVGL3.1 + XAVGC3.1) / 4 + ABS(H - (XAVGO3.1 + XAVGH3.1 + XAVGL3.1 + XAVGC3.1) / 4)) / 2
A formula for the Low of TC2000 version 12's Heiken-Ashi candles would be:
(L + (XAVGO3.1 + XAVGH3.1 + XAVGL3.1 + XAVGC3.1) / 4 - ABS(L - (XAVGO3.1 + XAVGH3.1 + XAVGL3.1 + XAVGC3.1) / 4)) / 2
A formula for the Close of TC2000 version 12's Heiken-Ashi candles would be:
(O + H + L + C) / 4
I have found at least two other interpretations of Heiken-Ashi candles online however.
Heikin Ashi
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 4/27/2008 Posts: 5
|
I'm really new to TC2000, so pardon the dumb question here...but how do you replace each of the OHLC values with the Heiken Ashi values? Meaning, now that we know the formula (as given above), how do you assign the new Close to be
(XAVGO3.1 + XAVGH3.1 + XAVGL3.1 + XAVGC3.1) / 4
|
Please advise!
Thanks much,
~newbie
|
|
Registered User Joined: 10/7/2004 Posts: 4
|
Thanks, Bruce, for your response. It answered my question.
With that info, I created a tedious HA pcf.......... which works!
Now, I would like to Copy and Paste it to a new pcf, then add more conditions. It ould the easier way without making typo errors.
I have been unable to do this.
CAN YOU HELP ME?
Gordo1
|
|
Registered User Joined: 12/15/2009 Posts: 91
|
Gordo,
Control-C to copy and Control-V to paste. Works in any windows program and TC2000 V12
Don
|
|
Registered User Joined: 11/21/2010 Posts: 3
|
I am trying to use a pcf to show whenever there is no bottom or top wick for the currecnt HA candle. The below catches most of these cases but it doesnt catch all of them. Is this the correct way to do this or is there a better way?
For no top wick im having the current HA open = current HA high
(XAVGO3.1 + XAVGH3.1 + XAVGL3.1 + XAVGC3.1) / 4 = (H + (XAVGO3.1 + XAVGH3.1 + XAVGL3.1 + XAVGC3.1) / 4 + ABS(H - (XAVGO3.1 + XAVGH3.1 + XAVGL3.1 + XAVGC3.1) / 4)) / 2
For no bottom wick im having current HA open = current HA Low
(XAVGO3.1 + XAVGH3.1 + XAVGL3.1 + XAVGC3.1) / 4 = (L + (XAVGO3.1 + XAVGH3.1 + XAVGL3.1 + XAVGC3.1) / 4 - ABS(L - (XAVGO3.1 + XAVGH3.1 + XAVGL3.1 + XAVGC3.1) / 4)) / 2
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
You theoretically need to check for either the HA Open or HA Close to be equal to the HA High:
(H <= (XAVGO3.1 + XAVGH3.1 + XAVGL3.1 + XAVGC3.1) / 4) OR ((O + H + L + C) / 4 = (H + (XAVGO3.1 + XAVGH3.1 + XAVGL3.1 + XAVGC3.1) / 4 + ABS(H - (XAVGO3.1 + XAVGH3.1 + XAVGL3.1 + XAVGC3.1) / 4)) / 2)
And either the HA Open or HA Close to be equal to the HA Low:
(L >= (XAVGO3.1 + XAVGH3.1 + XAVGL3.1 + XAVGC3.1) / 4) OR ((O + H + L + C) / 4 = (L + (XAVGO3.1 + XAVGH3.1 + XAVGL3.1 + XAVGC3.1) / 4 - ABS(L - (XAVGO3.1 + XAVGH3.1 + XAVGL3.1 + XAVGC3.1) / 4)) / 2)
But I don't think either the HA High or HA Low will exactly equal the HA Close very often.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 11/21/2010 Posts: 3
|
Thanks for your help Bruce.
What I ended up doing because although sometimes the numbers may match in the view that comes when you click the mouse (may be rounded), they may not exactly match so I gave it some buffer room as seen below.
No / very small bottom wick HA:
((XAVGO3.1 + XAVGH3.1 + XAVGL3.1 + XAVGC3.1) / 4) + .00003 >= (H + (XAVGO3.1 + XAVGH3.1 + XAVGL3.1 + XAVGC3.1) / 4 + ABS(H - (XAVGO3.1 + XAVGH3.1 + XAVGL3.1 + XAVGC3.1) / 4)) / 2
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
That is an excellent idea. I am happy you shared it.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 12/18/2004 Posts: 89
|
Bruce old thread here...
Can you please reverse the formula mgreco19 wrote? That one alerts for small/no UPPER wicks.. I need it for no/small lower wicks as well.
Thanks in advance...
|
|
Registered User Joined: 12/18/2004 Posts: 89
|
Ideally the goal is to be alerted when this wick-less bar is the first one (condition is NOT true for the bar before)....
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
Reversing the mgreco19's formula results in the following.
((XAVGO3.1 + XAVGH3.1 + XAVGL3.1 + XAVGC3.1) / 4) - .00003 <= (L + (XAVGO3.1 + XAVGH3.1 + XAVGL3.1 + XAVGC3.1) / 4 - ABS(L - (XAVGO3.1 + XAVGH3.1 + XAVGL3.1 + XAVGC3.1) / 4)) / 2
Adding the requirement that the formula not be true during the previous bar results in the following.
((XAVGO3.1 + XAVGH3.1 + XAVGL3.1 + XAVGC3.1) / 4) - .00003 <= (L + (XAVGO3.1 + XAVGH3.1 + XAVGL3.1 + XAVGC3.1) / 4 - ABS(L - (XAVGO3.1 + XAVGH3.1 + XAVGL3.1 + XAVGC3.1) / 4)) / 2 AND ((XAVGO3.2 + XAVGH3.2 + XAVGL3.2 + XAVGC3.2) / 4) - .00003 > (L1 + (XAVGO3.2 + XAVGH3.2 + XAVGL3.2 + XAVGC3.2) / 4 - ABS(L1 - (XAVGO3.2 + XAVGH3.2 + XAVGL3.2 + XAVGC3.2) / 4)) / 2
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 12/18/2004 Posts: 89
|
QUOTE (Bruce_L)
Addng the requirement that the formula not be true during the previous bar results in the following..
((XAVGO3.1 + XAVGH3.1 + XAVGL3.1 + XAVGC3.1) / 4) - .00003 <= (L + (XAVGO3.1 + XAVGH3.1 + XAVGL3.1 + XAVGC3.1) / 4 - ABS(L - (XAVGO3.1 + XAVGH3.1 + XAVGL3.1 + XAVGC3.1) / 4)) / 2 AND ((XAVGO3.2 + XAVGH3.2 + XAVGL3.2 + XAVGC3.2) / 4) - .00003 > (L1 + (XAVGO3.2 + XAVGH3.2 + XAVGL3.2 + XAVGC3.2) / 4 - ABS(L1 - (XAVGO3.2 + XAVGH3.2 + XAVGL3.2 + XAVGC3.2) / 4)) / 2
Bruce.. This is for no lower wicks right (BULLISH reversal) ? If so please do it for the no upper wick as well... MUCH appreciated.
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
Adding the requirement that the formula not be true during the previous bar to emgreco19's original formula results in the following.
((XAVGO3.1 + XAVGH3.1 + XAVGL3.1 + XAVGC3.1) / 4) + .00003 >= (H + (XAVGO3.1 + XAVGH3.1 + XAVGL3.1 + XAVGC3.1) / 4 + ABS(H - (XAVGO3.1 + XAVGH3.1 + XAVGL3.1 + XAVGC3.1) / 4)) / 2 AND ((XAVGO3.2 + XAVGH3.2 + XAVGL3.2 + XAVGC3.2) / 4) + .00003 < (H1 + (XAVGO3.2 + XAVGH3.2 + XAVGL3.2 + XAVGC3.2) / 4 + ABS(H1 - (XAVGO3.2 + XAVGH3.2 + XAVGL3.2 + XAVGC3.2) / 4)) / 2
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 12/18/2004 Posts: 89
|
Thanks..!
|
|
Registered User Joined: 12/18/2004 Posts: 89
|
Bruce...
One small question... Are these referring to the current bar or the prior bar just closed? The "L" and "H" is throwing me off... I know what I need to do to make prior if not..
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
The formulas are for the current bar.
The formulas which check for something on the current bar and for that something to not be happening on the previous bar do use data for the previous bar in the second half of the formula, but I would still consider to the formulas to be for the current bar.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 12/18/2004 Posts: 89
|
Bruce,
This rewrite of the last formula you wrote therefore looks for prior bar?
((XAVGO3.2 + XAVGH3.2 + XAVGL3.2 + XAVGC3.2) / 4) + .00003 >= (H1 + (XAVGO3.2 + XAVGH3.2 + XAVGL3.2 + XAVGC3.2) / 4 + ABS(H1 - (XAVGO3.2 + XAVGH3.2 + XAVGL3.2 + XAVGC3.2) / 4)) / 2 AND ((XAVGO3.3 + XAVGH3.3 + XAVGL3.3 + XAVGC3.3) / 4) + .00003 < (H2 + (XAVGO3.3 + XAVGH3.3 + XAVGL3.3 + XAVGC3.3) / 4 + ABS(H2 - (XAVGO3.3 + XAVGH3.3 + XAVGL3.3 + XAVGC3.3) / 4)) / 2
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
It looks correct to me and the spikes seem to happen exactly one bar after the original version of the formula when used as a Custom PCF % True Indicator.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 12/18/2004 Posts: 89
|
Thanks Bruce... problem is HA already is a lagging bar (good..).. this lags another bar... i will test open/filled body and see what happens... like this..
(XAVGO3.2 + XAVGH3.2 + XAVGL3.2 + XAVGC3.2) / 4 > (O1 + H1 + L1 + C1) / 4 AND
(XAVGO3.3 + XAVGH3.3 + XAVGL3.3 + XAVGC3.3) / 4 < (O2 + H2 + L2 + C2) / 4
https://www.dropbox.com/s/yqvihxebwki5z8t/3-11-2015%203-58-51%20PM.png?dl=0
Not sure why it is skipping some filled body to empty body reverses...?
Thanks again..
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
Your formula isn't for filled to empty, it is for the bar after empty to filled.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 12/18/2004 Posts: 89
|
Thanks.. "blushing".....
|
|
Registered User Joined: 12/30/2004 Posts: 123
|
I have a couple of HA indicators that show a spike in a Pct True custom indicator. The first is HA Red to Green and the second is HA Green to Red. I color the first green and the second red. If this pair helps your timing for a swing trade, I am glad to share. After you place them on the chart, you can set an alert to show you when these indicators are greater than zero. When that occurs, HA color has turned either Red to Green or Green to Red depending on which indicator your alert is set.
HA Red to Green (Label)
O + H + L + C >= XAVGO3.1 + XAVGH3.1 + XAVGL3.1 + XAVGC3.1 AND O1 + H1 + L1 + C1 < XAVGO3.2 + XAVGH3.2 + XAVGL3.2 + XAVGC3.2
HA Green to Red (Label)
O + H + L + C < XAVGO3.1 + XAVGH3.1 + XAVGL3.1 + XAVGC3.1 AND O1 + H1 + L1 + C1 >= XAVGO3.2 + XAVGH3.2 + XAVGL3.2 + XAVGC3.2
|
|
Registered User Joined: 12/18/2004 Posts: 89
|
Key is adding MINLn (Long) and MAXHn (short) to these so you are alerted only in key price areas..
|
|
Registered User Joined: 12/30/2004 Posts: 123
|
With regard to the use of the HA Red to Green and HA Green to Red: I use these indicators as an alert on my favorites, often ETFs, to signal me when to do a quick bit of futher research. Like charts with Bollinger Bands, Fibs, and a series of other charts in various time frames, to get an idea if a posisition should be taken or taken off. Sometimes you get a false signal, but the majority of times, it is a quick and dirty primary swing indicator. I have used it for years and it is one of the best quick tell indicators to start with. It helps keep you out of trouble. I never bet opposite of what these indicators tell.
|
|
Registered User Joined: 12/18/2004 Posts: 89
|
Good words..
Just started tinkering with it and basically it prevents top and bottom picking - forces patience... Of course you can break ANY rule you want. My Plan is to use it for entry on smaller Time Frames when the larger one runs into Support/Resistance.. Forex only...
|
|
Registered User Joined: 9/29/2010 Posts: 4
|
Is there a way to sort Heikin-Ashi by color, like if I want to find stocks with 4 red bars in a row?
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
At least four red bars in a row can be written as follows.
TrueInRow(O + H + L + C < XAVG(O1 + H1 + L1 + C1, 3), 4) = 4
Exactly four red bars in a row can be written as follows.
TrueInRow(O + H + L + C < XAVG(O1 + H1 + L1 + C1, 3), 5) = 4
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 9/29/2010 Posts: 4
|
Thank you!!!!!
|
|
Registered User Joined: 5/12/2016 Posts: 13
|
I am interested in buying tc2000 if it can produce a scan based on Heikin Ashi candles. I want to be able to find all stocks that have their s2 above 0. A scan that could also find which s2's are increasing would be nice as well. thanks in advance.
delta = close - open
plot(delta, color=black)
s2=ema(delta, 03)
plot(s2, color = red)
plot(s2, color=red, style=line)
c_color=s2 < 0 ? (s2 < s2[1] ? red : lime) : (s2 >= 0 ? (s2 > s2[1] ? lime : red) : na)
plot(s2, color=c_color, style=circles, linewidth=2)
h0 = hline(0)
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
delta is:
(O + H + L + C - XAVG(O1 + H1 + L1 + C1, 3)) / 4
s2 above zero could be written as follows.
XAVG(O + H + L + C - XAVG(O1 + H1 + L1 + C1, 3), 3) / 4 > 0
You don't actually need the / 4 part:
XAVG(O + H + L + C - XAVG(O1 + H1 + L1 + C1, 3), 3) > 0
s2 increasing can be written as follows.
XAVG(O + H + L + C - XAVG(O1 + H1 + L1 + C1, 3), 3) / 4 > XAVG(O1 + H1 + L1 + C1 - XAVG(O2 + H2 + L2 + C2, 3), 3) / 4
Or as the slightly shorter version below.
O + H + L + C - XAVG(O1 + H1 + L1 + C1, 3) > XAVG(O + H + L + C - XAVG(O1 + H1 + L1 + C1, 3), 3)
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 5/12/2016 Posts: 13
|
Thanks Bruce!
|
|
Registered User Joined: 5/12/2016 Posts: 13
|
I am not sure this is working because on trading view I am getting a value of 1.11 for today for the EMA value using Heikin Ashi candles, TC shows 6.5 with this formula. It seems to use HA candles there is much more to the formula than below. Suggestions?
You don't actually need the / 4 part:
XAVG(O + H + L + C - XAVG(O1 + H1 + L1 + C1, 3), 3) > 0
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
Trading view is showing a value of 1.11 for what exactly? delta? s2? For what symbol? What time frame?
The HA close is just:
(O + H + L + C) / 4
And the HA open is just:
XAVG(O1 + H1 + L1+ C1, 3) / 4
So HA delta is just:
(O + H + L + C - XAVG(O1 + H1 + L1 + C1, 3)) / 4
And s2 is just:
XAVG(O + H + L + C - XAVG(O1 + H1 + L1 + C1, 3), 3) / 4
There really shouldn't be anything more to it than that.
If you want to know if s2 is above zero or increasing, the / 4 part doesn't matter because it will still be above zero increasing without it.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 5/12/2016 Posts: 13
|
showing 1.11 for the delta, daily TF.
|
|
Registered User Joined: 5/12/2016 Posts: 13
|
I could have messed up and now been on MSFT when I ran it, can you check your end since my free preview is gone?
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
I am currently showing 1.09 for delta and 1.16 for s2 for MSFT on a daily time frame..
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 5/12/2016 Posts: 13
|
Great those match up thanks for the assistance. I might be reaching out to you for help convert another formula from tradingview to TC2000, thanks!
|
|
Registered User Joined: 5/12/2016 Posts: 13
|
how do I create a condition to show when the formula below crossed above 0 and not just greater than zero.
(O + H + L + C - XAVG(O1 + H1 + L1 + C1, 3)) / 4
|
|
Registered User Joined: 5/12/2016 Posts: 13
|
nevermind I think I am going to just add a column and look for it there manually.
|
|
Guest-1 |