Welcome Guest, please sign in to participate in a discussion. | Search | Active Topics | |
Registered User Joined: 3/31/2008 Posts: 7
|
In a recent issue of a trading magazine, the subject topic was discussed. Worden was allowed to submit their code and they chose the Blocks format. Can someone help me write the code for telchart or is it possible to transfer that code to telchart.
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
Welcome to the forums. A very good foundation for learning how to use TeleChart can be gained by reviewing the following:
If you are new to TeleChart READ THIS FIRST!
Whie it is probably possible to create a 10-Period Heikin-Ashi Zero Lag TEMA as described in the article within TeleChart, there is a reason we did it in Blocks instead. I took a look and to write this as a Custom Indicator would seem to involve uncascading the following, combining terms and manually expanding the Exponential Moving Averages (and I'm not even sure I have it right up to this point):
Warning: This is not a functional Personal Criteria Formula or Custom Indicator and will not evaluate in TeleChart.
6 * XAVG((8 * XAVGC3.1 + 3 * (H + L) + 2 * (ABS(H - XAVGC3.1) - ABS(L - XAVGC3.1)) + O + C) / 16,10) - 6 * XAVG(XAVG((8 * XAVGC3.1 + 3 * (H + L) + 2 * (ABS(H - XAVGC3.1) - ABS(L - XAVGC3.1)) + O + C) / 16,10),10) + 2 * XAVG(XAVG(XAVG((8 * XAVGC3.1 + 3 * (H + L) + 2 * (ABS(H - XAVGC3.1) - ABS(L - XAVGC3.1)) + O + C) / 16,10),10),10) - 3 * XAVG(6 * XAVG((8 * XAVGC3.1 + 3 * (H + L) + 2 * (ABS(H - XAVGC3.1) - ABS(L - XAVGC3.1)) + O + C) / 16,10) - 6 * XAVG(XAVG((8 * XAVGC3.1 + 3 * (H + L) + 2 * (ABS(H - XAVGC3.1) - ABS(L - XAVGC3.1)) + O + C) / 16,10),10) + 2 * XAVG(XAVG(XAVG((8 * XAVGC3.1 + 3 * (H + L) + 2 * (ABS(H - XAVGC3.1) - ABS(L - XAVGC3.1)) + O + C) / 16,10),10),10),10) + 3 * XAVG(XAVG(6 * XAVG((8 * XAVGC3.1 + 3 * (H + L) + 2 * (ABS(H - XAVGC3.1) - ABS(L - XAVGC3.1)) + O + C) / 16,10) - 6 * XAVG(XAVG((8 * XAVGC3.1 + 3 * (H + L) + 2 * (ABS(H - XAVGC3.1) - ABS(L - XAVGC3.1)) + O + C) / 16,10),10) + 2 * XAVG(XAVG(XAVG((8 * XAVGC3.1 + 3 * (H + L) + 2 * (ABS(H - XAVGC3.1) - ABS(L - XAVGC3.1)) + O + C) / 16,10),10),10),10),10) - XAVG(XAVG(XAVG(6 * XAVG((8 * XAVGC3.1 + 3 * (H + L) + 2 * (ABS(H - XAVGC3.1) - ABS(L - XAVGC3.1)) + O + C) / 16,10) - 6 * XAVG(XAVG((8 * XAVGC3.1 + 3 * (H + L) + 2 * (ABS(H - XAVGC3.1) - ABS(L - XAVGC3.1)) + O + C) / 16,10),10) + 2 * XAVG(XAVG(XAVG((8 * XAVGC3.1 + 3 * (H + L) + 2 * (ABS(H - XAVGC3.1) - ABS(L - XAVGC3.1)) + O + C) / 16,10),10),10),10),10),10)
I've spent quite a bit of time on it already, but I really can't imagine having enough time to actually convert it into a functional PCF or Custom Indicator (and am not sure it would be short enough to be practical even if I did go through the entire process of doing so). You may wish to review the following:
Cascades of Moving Averages
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Worden Trainer
Joined: 10/1/2004 Posts: 18,819
|
double12,
We had no choice, only Blocks is capable of what was presented in that article.
- Craig Here to Help!
|
|
Registered User Joined: 3/31/2008 Posts: 7
|
thanks for the help.
I would like to combine 10-day zero lagging TEMA and use it with TSV, MACD & Stoch. I thought I read, which may have been in error, that TSV does not run within Blocks. Is that true?
TIA
Double 12
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
double12,
TSV is available within Blocks, but BOP and MS are not available yet.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 3/31/2008 Posts: 7
|
Awesome & thanks.
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
double12,
You're welcome. Our pleasure.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 1/1/2005 Posts: 2,645
|
Bruce,
I believe you have two errors in the formula you presented.
We will start by developing the two moving averages required, one of a Heikin-Ashi Close of the Heikin-Ashi Candle and the other of Typical Price
The Heikin-Ashi Candle is calculated with the following formula:
Heikin-Ashi Close: haClose = (Open + High + Low + Close) / 4
Heikin-Ashi Open: haOpen = (yesterday's haOpen + yesterday's haClose) / 2
Heikin-Ashi High: haHigh = the higher of today's High, and today's haOpen
Heikin-Ashi Low: haLow = the lower of today's Low, and today's haOpen
The Heikin-Ashi Close of the Heikin-Ashi Candle is:
haC = (haOpen + haHigh + haLow + haClose)/4
Typical Price is given by:
tp = (High + Low + Close)/3
The required moving average is a zero-lag moving average defined as follows:
E - Exponential Moving Average of fixed period.
T - Triple Exponential Moving Average defined by:
T = 3*E-3*EE+1*EEE
The two moving average indicators required are:
MA(haC) = (2*T - TT)(haC)
and
MA(tp) = (2*T -TT)(tp)
Note: Let Mov be any LTI moving average with the usual constraints. Then, the Double Mov:
DMov = 2*Mov - MovMov
and the Triple Mov:
TMov = 3*Mov - 3*MovMov + 1*MovMovMov
are both zero-lag moving averages.
We will obtain PCFs for haC and tp. First:
haClose = (O+H+L+C)/4
haOpen = (XAVGO3.1+XAVGH3.1+XAVGL3.1+XAVGC3.1)/4
haHigh = (H+(XAVGO3.1+XAVGH3.1+XAVGL3.1+XAVGC3.1)/4
+ABS(H-(XAVGO3.1+XAVGH3.1+XAVGL3.1+XAVGC3.1)/4))/2
haLow = (L+(XAVGO3.1+XAVGH3.1+XAVGL3.1+XAVGC3.1)/4
-ABS(L-(XAVGO3.1+XAVGH3.1+XAVGL3.1+XAVGC3.1)/4))/2
Thus, haC is given by the PCF:
((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
+(L+(XAVGO3.1+XAVGH3.1+XAVGL3.1+XAVGC3.1)/4
-ABS(L-(XAVGO3.1+XAVGH3.1+XAVGL3.1+XAVGC3.1)/4))/2
+(O+H+L+C)/4)/4
The tp is given by the PCF:
(H+L+C)/3
The PCFs for haC and tp can be plotted as Custom Indicators with "Plot using price scale" checked. The only built-in zero-lag moving average available in TeleChart is the Moving Linear Regression. This can be applied to the Custom Indicators.
Bruce,
Your first error is that you used XAVGC3.1 in place of (XAVGO3.1+XAVGH3.1+XAVGL3.1+XAVGC3.1)/4 in the PCF for haC.
Your second error is that your final MA is ( 2*T-2*TT) in place of (2*T-TT).
If I had to do a series expansion for (2T - TT), I believe I would get you to combine all of the coefficients into one for each term using your "magic machine".
Your comments will be appreciated.
Thanks,
Jim Murphy
|
|
Registered User Joined: 2/28/2005 Posts: 825
|
I got lost in all the math mumbo. Are you therefore saying that the two pcf's given should give us a Heikin-Ashi candle scan???
ie:
We will obtain PCFs for haC and tp. First:
haClose = (O+H+L+C)/4
haOpen = (XAVGO3.1+XAVGH3.1+XAVGL3.1+XAVGC3.1)/4
haHigh = (H+(XAVGO3.1+XAVGH3.1+XAVGL3.1+XAVGC3.1)/4
+ABS(H-(XAVGO3.1+XAVGH3.1+XAVGL3.1+XAVGC3.1)/4))/2
haLow = (L+(XAVGO3.1+XAVGH3.1+XAVGL3.1+XAVGC3.1)/4
-ABS(L-(XAVGO3.1+XAVGH3.1+XAVGL3.1+XAVGC3.1)/4))/2
Thus, haC is given by the PCF:
((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
+(L+(XAVGO3.1+XAVGH3.1+XAVGL3.1+XAVGC3.1)/4
-ABS(L-(XAVGO3.1+XAVGH3.1+XAVGL3.1+XAVGC3.1)/4))/2
+(O+H+L+C)/4)/4
The tp is given by the PCF:
(H+L+C)/3
|
|
Guest-1 |