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

haDelta Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
glmus
Posted : Tuesday, October 18, 2011 10:09:12 AM
Gold Customer Gold Customer

Joined: 10/7/2004
Posts: 50
This is an oscillator for Heiken Ashi.  Is there a chance that someone can create a formula for this or add it to our indicators?
Bruce_L
Posted : Tuesday, October 18, 2011 10:23:24 AM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138
An internet search has not revealed how haDelta is calculated. We cannot create a formula unless we have this information.

-Bruce
Personal Criteria Formulas
TC2000 Support Articles
glmus
Posted : Tuesday, October 18, 2011 10:47:09 AM
Gold Customer Gold Customer

Joined: 10/7/2004
Posts: 50
Thanks, Bruce.  I will see if I can get the formula.
glmus
glmus
Posted : Tuesday, October 18, 2011 10:55:37 AM
Gold Customer Gold Customer

Joined: 10/7/2004
Posts: 50
Bruce, I just wrote an email to Dan Valcu at www.educofin.com asking for the formula.  If he sends it to me, I will pass it on.  If you want to try to see if he will share it directly with you, that would be great.
glmus
glmus
Posted : Wednesday, October 19, 2011 9:04:44 AM
Gold Customer Gold Customer

Joined: 10/7/2004
Posts: 50
Bruce, Dan at ha@educofin.com wrote the following to me about haDelta:

Gary,

Thanks for writing and your interest.

It's fair to let Worden get in touch with me.


Thus, if you write Dan, I believe that he will share haDelta with you so you can share it with us.
Thanks, Gary
glmus
Posted : Wednesday, October 19, 2011 4:40:19 PM
Gold Customer Gold Customer

Joined: 10/7/2004
Posts: 50
Bruce, re the haDelta indicator, please cook this oscillator up:

haclose - haopen.

This should rise when a stock is up and turn down when the stock is going down.

This idea came from a webinar I just attended.

Thanks, Gary
Bruce_L
Posted : Wednesday, October 19, 2011 5:02:43 PM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138
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

So an oscillator representing the Close minus the Open of TC2000 version 12's Heiken-Ashi candles would be:

(O + H + L + C) / 4 - (XAVGO3.1 + XAVGH3.1 + XAVGL3.1 + XAVGC3.1) / 4

I have found at least two other interpretations of Heiken-Ashi candles online however.

Heikin Ashi

-Bruce
Personal Criteria Formulas
TC2000 Support Articles
glmus
Posted : Wednesday, October 19, 2011 5:57:29 PM
Gold Customer Gold Customer

Joined: 10/7/2004
Posts: 50
Thanks, Bruce.  I am aware of other interpretations.  This is very helpful.
jmc7
Posted : Tuesday, August 14, 2012 4:46:07 PM
Registered User
Joined: 6/20/2012
Posts: 31

Bruce: Earlier, you posted these formulas.   My question is, how could I set up a scan to show the intial daily candle representing the Open=Low (no lower shadow) for the initial indication of a bullish trend and also for the Open=High (no upper wick) for the initial indication of a bearish trend?

 

QUOTE (Bruce_L)
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

So an oscillator representing the Close minus the Open of TC2000 version 12's Heiken-Ashi candles would be:

(O + H + L + C) / 4 - (XAVGO3.1 + XAVGH3.1 + XAVGL3.1 + XAVGC3.1) / 4

I have found at least two other interpretations of Heiken-Ashi candles online however.

Heikin Ashi

Bruce_L
Posted : Tuesday, August 14, 2012 4:57:53 PM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138

Open = Low would be:

(XAVGO3.1 + XAVGH3.1 + XAVGL3.1 + XAVGC3.1) / 4 <= L

Open = High would be:

(XAVGO3.1 + XAVGH3.1 + XAVGL3.1 + XAVGC3.1) / 4 >= H



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
jmc7
Posted : Tuesday, August 14, 2012 5:13:36 PM
Registered User
Joined: 6/20/2012
Posts: 31

Thanks Bruce.  This works nicely.  Is there also a way to scan for a new Open=Low or a new Open=High candle?  Doesn't necessariily have to be a new Red to Green or Green to Red.  In that case, I could just put both of them on the same scan. 

I'm looking to show each new Open=Low or Open=High even if the prior candle was the same color, but had either a lower shadow (then a new Open=Low) or upper wick (then a new Open=High).

Hope that makes sense.  Thanks for your help!

Bruce_L
Posted : Wednesday, August 15, 2012 7:23:20 AM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138

I do not understand how this differs from your Tuesday, August 14, 2012 4:46:07 PM ET request.



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
jmc7
Posted : Wednesday, August 15, 2012 9:14:11 AM
Registered User
Joined: 6/20/2012
Posts: 31

Only difference is the fact that I'd like to be able to scan for the first one of these HA candles where Open=Low or Open =High.  My scan with these values currently shows when that particular day qualified, but doesn't necessarily tell me if it was a new qualification as compared to prior days.  Is this possible to scan? 

Bruce_L
Posted : Wednesday, August 15, 2012 9:18:09 AM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138

Open = Low for the current bar and Open <> Low for the previous bar would be:

(XAVGO3.1 + XAVGH3.1 + XAVGL3.1 + XAVGC3.1) / 4 <= L AND (XAVGO3.2 + XAVGH3.2 + XAVGL3.2 + XAVGC3.2) / 4 > L1

Open = High for the current bar and Open <> High for the previous bar would be:

(XAVGO3.1 + XAVGH3.1 + XAVGL3.1 + XAVGC3.1) / 4 >= H AND (XAVGO3.2 + XAVGH3.2 + XAVGL3.2 + XAVGC3.2) / 4 < H1



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
jmc7
Posted : Wednesday, August 15, 2012 9:25:58 AM
Registered User
Joined: 6/20/2012
Posts: 31

Perfect!  Thanks so much Bruce, very much appreciated!

jmc7
Posted : Wednesday, August 15, 2012 11:12:49 AM
Registered User
Joined: 6/20/2012
Posts: 31

Hey Bruce, one more follow up question.  In some cases, a prior day red candle where Open=High will occur followed the next day by a green candle showing Open=Low. 

The formula above should still accomodate this occurence and show a stock as new Open=Low correct? 

Bruce_L
Posted : Wednesday, August 15, 2012 11:23:58 AM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138

Yes, the formula that checks for Open = Low only checks for Open = Low during the current bar and Open <> Low during the previous bar. It makes no checks for Open = High at all.



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
jmc7
Posted : Wednesday, August 15, 2012 1:41:45 PM
Registered User
Joined: 6/20/2012
Posts: 31

Perfect again, thanks so much.

jmc7
Posted : Wednesday, August 15, 2012 3:20:17 PM
Registered User
Joined: 6/20/2012
Posts: 31

Bruce:  Is it possible to show both Heikin Ashi and traditional candlesticks on the same chart?

Bruce_L
Posted : Wednesday, August 15, 2012 3:25:36 PM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138

Yes. You can select Add Indicator | Price History or click on an indicator and select Plot New Indicator here... | Price History. Once the extra Price History is added, you can click on it and select Edit to change Plot Style to Heiken-Ashi.



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
jmc7
Posted : Wednesday, August 15, 2012 3:46:05 PM
Registered User
Joined: 6/20/2012
Posts: 31

got it, thanks

julian1000
Posted : Wednesday, August 29, 2012 10:02:58 AM
Registered User
Joined: 9/12/2010
Posts: 121

Actually haDelta is exactly the same as a, say, an 8 period CCI. There was no need for any secret calculation from this other site.

Bruce_L
Posted : Wednesday, August 29, 2012 10:53:38 AM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138

Unless the haDelta is something other than the haClose - haOpen, the haDelta is not the same as an 8-Period CCI. An Indicator Formula for the haDelta is:

(O + H + L + C) / 4 - (XAVGO3.1 + XAVGH3.1 + XAVGL3.1 + XAVGC3.1) / 4

And the Indicator Formula for an 8-Period CCI is:

(H + L + C - AVGH8 - AVGL8 - AVGC8) * 1600 / 3 / (ABS(H + L + C - AVGH8 - AVGL8 - AVGC8) + ABS(H1 + L1 + C1 - AVGH8 - AVGL8 - AVGC8) + ABS(H2 + L2 + C2 - AVGH8 - AVGL8 - AVGC8) + ABS(H3 + L3 + C3 - AVGH8 - AVGL8 - AVGC8) + ABS(H4 + L4 + C4 - AVGH8 - AVGL8 - AVGC8) + ABS(H5 + L5 + C5 - AVGH8 - AVGL8 - AVGC8) + ABS(H6 + L6 + C6 - AVGH8 - AVGL8 - AVGC8) + ABS(H7 + L7 + C7 - AVGH8 - AVGL8 - AVGC8) + .000001)

They do have similar construction but the haDelta adds the open to its calculations, uses exponential instead of simple moving averages and drops the attempt to normalize the results using mean absolute deviation.



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
jmc7
Posted : Wednesday, August 29, 2012 12:11:43 PM
Registered User
Joined: 6/20/2012
Posts: 31

Hi Bruce:

Is it possible to scan for the Lagging Span line crossing up/down the historical price?   Do I need to add another formula?

Bruce_L
Posted : Wednesday, August 29, 2012 12:37:03 PM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138

Lagging Span is just price from 26-bars in the future.

It is not possible to write a PCF for the Lagging Span where it is plotted because the Personal Criteria Formula Language does not have syntax for negative offsets.

If you shifted this 26-bars into the future to plot the most recent available value of the Lagging Span it would just be a PCF for the current price:

C

A Condition Formula for the most recent Lagging Span crossing up price would be the same as the formula for the current price crossing up through the price of 26-bars ago:

C > C26 AND C1 <= C27

The crossing down formula would reverse the > and < signs:

C < C26 AND C1 >= C27



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
jmc7
Posted : Wednesday, November 14, 2012 3:03:45 PM
Registered User
Joined: 6/20/2012
Posts: 31

Hey Bruce:

 

I'm using the Heikin Ashi candle formulas you helped me with above to show the Open=Low or Open=High on a new candle.  At times, the actual price movement will move in the opposite direction of the Heikin Ashi candle color and movment, so I'm curious the formula for simply having price move up or price move down for the current day?  Should I simply just use "moving up smart" or "moving down smart" and have the slider all the way to the left to allow for all movement in that direction to show or does that exclude even some of the slower movers in that direction?

 

Thanks again.

Bruce_L
Posted : Wednesday, November 14, 2012 3:09:36 PM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138

I could be misunderstanding, but it reads like you are interested in the actual price instead of the values being displayed by the Heiken-Ashi Candles? If so, C > C1 would check for the actual closing price to be above the previous actual closing price while C < C1 would check for the actual closing price to be below the previous actual closing price.



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
jmc7
Posted : Wednesday, November 14, 2012 4:08:00 PM
Registered User
Joined: 6/20/2012
Posts: 31

Yes, that would work and when I test that vs. price moving slowly in either direction, it actually gives me the same results. Thanks.

jmc7
Posted : Tuesday, November 27, 2012 12:17:19 PM
Registered User
Joined: 6/20/2012
Posts: 31

Hi Bruce:

Per your formula in the above post dated 8/15 at 9:18am, you indicated that this will show a new Open=High in the Heikin Ashi candles.  In my scan, I'm currently showing stock EXXI, just as it showed yesterday.  I'm using live data and yesterday's open and High in the HA candle were both 33.81, while today also showed the open=high of 33.18.  Can you confirm if you show the same data and if the below formula is correct?  thanks so much.

(XAVGO3.1 + XAVGH3.1 + XAVGL3.1 + XAVGC3.1) / 4 >= H AND (XAVGO3.2 + XAVGH3.2 + XAVGL3.2 + XAVGC3.2) / 4 < H1

 


 

 

 

 

Bruce_L
Posted : Tuesday, November 27, 2012 12:39:52 PM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138

The HaOpen for EXXI on 11/26/2012 was 33.80927 while the HaHigh for EXXI on 11/26/2012 is 33.81. So the HaOpen was below the HaHigh on 11/26/2012. They were not equal.



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
jmc7
Posted : Tuesday, November 27, 2012 12:57:59 PM
Registered User
Joined: 6/20/2012
Posts: 31

Okay, where did you pull that data from?  When I click on the chart and hold it over 11/26, it gives me the High and open as 33.81.  Can I adust my settings to show the additional decimal places?

Bruce_L
Posted : Tuesday, November 27, 2012 1:08:19 PM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138

I just added a Custom PCF Indicator to the chart with the following formula:

(XAVGO3.2 + XAVGH3.2 + XAVGL3.2 + XAVGC3.2) / 4

And then I clicked on it and selected Show Values in WatchList. To get more than 2 digits past the decimal to display I right-clicked on the WatchList Column Header for the WatchList Column and selected Edit so I could change the Decimal Places setting.



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
jmc7
Posted : Tuesday, November 27, 2012 1:29:14 PM
Registered User
Joined: 6/20/2012
Posts: 31

Okay, the confirm the accuracy of the original HA Open=Low New and HA Open=High New forumlas, shown again here.  These will still show a true/false reading regardless of decimal places correct?  In other words these don't round to the nearest 2 decimal places?  In the case of EXXI, it showed up in the scan at 3:30 when I entered my trades, then when I checked later in the day it wasn't there which could be explained by a rise price therefore a rise in the HA high for the day, even though my chart shows they rounded to the same value.  As long as the condition shows the new open=high new open=low in actual values extended out in decimal places, it doesn't matter to me they values in the charts round up/down.

(XAVGO3.1 + XAVGH3.1 + XAVGL3.1 + XAVGC3.1) / 4 <= L AND (XAVGO3.2 + XAVGH3.2 + XAVGL3.2 + XAVGC3.2) / 4 > L1

(XAVGO3.1 + XAVGH3.1 + XAVGL3.1 + XAVGC3.1) / 4 >= H AND (XAVGO3.2 + XAVGH3.2 + XAVGL3.2 + XAVGC3.2) / 4 < H1

 


 

Bruce_L
Posted : Tuesday, November 27, 2012 1:41:21 PM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138

I can confirm that the formulas are as accurate as they are going to get. The results are not rounded internally when the calculations are done, while the values being displayed on the charts are rounded.

Assuming that the symbol was showing yesterday, your guess that the actual high of the day went above the HaOpen at a later point in the day is probably correct.

That said, the formulas are only approximations of the charted HaValues. I think the exponential moving averages in the Personal Criteria Formula Language use about five times as many bars in their calculations as the period of the EMA. The EMAs on the chart are going to use differing numbers of bars in their calculations depending on where they are on the chart.



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
jmc7
Posted : Tuesday, November 27, 2012 1:44:45 PM
Registered User
Joined: 6/20/2012
Posts: 31

Got it, thanks.  You answered it when you said the results are not rouned internally when the caluclations are done. 

thanks again for your help.

jmc7
Posted : Monday, December 10, 2012 9:48:11 AM
Registered User
Joined: 6/20/2012
Posts: 31

Bruce, I'm trying to scan for stocks that have shown an increase/decrease of a certain percentage over the last 1 or 2 days, but in the current day are showing a pull back.  So I'm trying to set up 4 different scans, and I'd like to be able to adjust the percentage changes within the criteria, in case I'm not seeing good results with 1% I mention below.

1st scan--Price has risen 1% or more over each of the last 2 days, and fallen by 1% or more in the current day

2nd scan-Price has risen 1% or more in the prior day, and fallen by 1% or more in the current day

3rd scan-Price has fallen by 1% or more over each of the last 2 days, and risen by 1% or more in the current day.

4th scan-Price has fallen by 1% or more in the prior day, and risen by 1% or more in the current day.

 

I'm showing price changes as percentages, as I'm assuing this would be an easier formula to write than showing the price movements as smart up/down correct?

Thanks so much!

Bruce_L
Posted : Monday, December 10, 2012 10:20:53 AM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138

Are the percentages based on actual prices or Heiken-Ashi candles?

I would normally calculate the percent changes based on the net change from close to close, but some candlestick practitioners seem to prefer the change from the open to close. Which is of interest to you?

I can't create formulas for smart up/down at all, so percent changes are definitely easier.



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
jmc7
Posted : Monday, December 10, 2012 10:41:47 AM
Registered User
Joined: 6/20/2012
Posts: 31

the percentages are based on actual prices and percentage change from close to close is what I'm looking for.

 

jmc7
Posted : Monday, December 10, 2012 10:43:46 AM
Registered User
Joined: 6/20/2012
Posts: 31

based on closed to closed, I suppose that would make the calculation for percentage change-2 days prior to be based on the change from the closing price from 3 days back to the closing price from 2 days back, correct?

Bruce_L
Posted : Monday, December 10, 2012 10:47:11 AM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138

1st scan:

C <= .99 * C1 AND C1 >= 1.01 * C2 AND C2 >= 1.02 * C3

2nd scan:

C <= .99 * C1 AND C1 >= 1.01 * C2

3rd scan:

C >= 1.01 * C1 AND C1 <= .99 * C2 AND C2 <= .99 * C3

4th scan:

C >= 1.01 * C1 AND C1 <= .99 * C2

Yes, the percent change 2-days prior would be based on the percent change between 3-days prior and 2-days prior.



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