Registered User Joined: 12/30/2004 Posts: 369
|
Hello,
Are you able to plot the "Laguerre RSI" and the "Fisher Transform" as a custom indicator in Telechart?
Thanks, -amberpax
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
The limited information I've found makes it doubtful that I am understanding these Indicators correctly, but you may wish to try the following:
A Laguerre RSI with a gamma of .5 could be created as a Custom Indicator as follows:
Select Chart Template | Add Indicator | Indicator. - Visible: Checked - Center Zero Line: Unchecked - Plot using price scale: Unchecked - Smoothing Average: 1 - Average Type: Doesn't matter (because the Smoothing Average is 1) - Indicator Formula: (ABS(C >= XAVGC3.1) * (XAVGC3 - XAVGC3.1) + ABS(C1 >= XAVGC3.2) * (XAVGC3.1 - XAVGC3.2) + ABS(C2 >= XAVGC3.3) * (XAVGC3.2 - XAVGC3.3))/ (ABS(XAVGC3 - XAVGC3.1) + ABS(XAVGC3.1 - XAVGC3.2) + ABS(XAVGC3.2 - XAVGC3.3) + .0000001)
Adjusting the gamma would involving changing the Exponential Moving Average Period used within the Indicator Formula.
A Fisher Transform (using a Stochastic of Price for normalization instead of a Stochastic of (H + L) / 2) could be created as a Custom Indicator as follows (the Stochastic Period and Smoothing Average can both be adjusted):
Select Chart Template | Add Indicator | Indicator. - Visible: Checked - Center Zero Line: Unchecked - Plot using price scale: Unchecked - Smoothing Average: 3 - Average Type: Exponential - Indicator Formula: LOG((ABS(STOC10 = 0) * .000001 + STOC10 / 50) / (ABS(STOC10 = 100) * .000001 + 2 - STOC10 / 50)) / 2
You may wish to review the following:
Plotting Custom Indicators with Examples Handy PCF example formulas to help you learn the syntax of PCFs! PCF Formula Descriptions
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 12/30/2004 Posts: 369
|
Thank you Bruce! -amberpax
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
You're welcome. As already indicated, I'm not sure they are actually correct. If you have another source to use as a comparison, I would do so.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 12/30/2004 Posts: 369
|
Bruce,
Your indicators are very close and I could work with them. However here are the formulas that I've found on another site.
Laguerre RSI:
_SECTION_BEGIN("Laguree RSI"); SetBarsRequired(200, 0);
// Ehlers formulas // from Ehlers, John F. Cybernetic Analysis for Stocks and Futures. Wiley. 2004. // Chapter 14, p. 213. Code on p. 221.
function LRSI(array, gamma) // Figure 14.8 on p. 221. { L0 = array; // Initialize as array L1 = array; L2 = array; L3 = array; LRSIValue = array;
for(i = 1; i < BarCount; i++) { L0 = (1 - gamma)*array + gamma*L0[i-1]; L1 = - gamma * L0 + L0[i-1] + gamma * L1[i-1]; L2 = - gamma * L1 + L1[i-1] + gamma * L2[i-1]; L3 = - gamma * L2 + L2[i-1] + gamma * L3[i-1];
CU = 0; CD = 0; if (L0 >= L1) CU = L0 - L1; else (CD = L1 - L0); if (L1 >= L2) CU = CU + L1 - L2; else CD = CD + L2 - L1; if (L2 >= L3) CU = CU + L2 - L3; else CD = CD + L3 - L2;
if (CU + CD != 0) LRSIValue = CU / (CU + CD); } return LRSIValue; }
Plot(LRSI(C, 0.5), "Laguerre RSI", colorRed, styleLine); PlotGrid(.8); PlotGrid(.5); PlotGrid(.2); _SECTION_END();
Fisher Transform:
_SECTION_BEGIN("Fisher Transform"); SetBarsRequired(200, 0);
// Ehlers formulas // from Ehlers, John F. Cybernetic Analysis for Stocks and Futures. Wiley. 2004. // Chapter 1, p. 1. Code on p. 7.
function InverseFisher(array) { e2y = exp(2 * array); return (e2y - 1)/(e2y + 1); }
function Normalize(array, arraylen) // Figure 1.7 on p. 7 { MaxH = HHV(array, arraylen); MinL = LLV(array, arraylen); Value1[0] = array[0]; // Initialize as array
for(i = 1; i < BarCount; i++) { Value1 = .5 * 2 * ((array - MinL) / (MaxH - MinL) - .5) + .5 * Value1[i-1]; if (Value1 > .9999) Value1 = .9999; if (Value1 < -.9999) Value1 = -.9999; } return Value1; }
function Fisher(array) // Figure 1.7 on p. 7 { F = array; F = .25 * log((1+ array)/(1 - array)) + .5 * Ref(F, -1); return F; }
Med = (H+L)/2;
// Fisher Transform FisherXform = Fisher(Normalize(Med, 10)); Plot(FisherXform, "Fisher Transform", colorRed, styleLine); Plot(Ref(FisherXform, -1), "", colorBlue, styleLine); PlotGrid(2); PlotGrid(-2);
|
|
Registered User Joined: 8/21/2007 Posts: 58
|
Amberpax,
You have intrigued me with your questions.
What are those indicators? What are the advantages of Laguerre's RSI over standard RSI?
Why have you personally chosen them?
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
amberpax, I may be missing something (I'm not familiar with the language used for the code), but I don't notice any differences between the algorithm presented in the Laguerre RSI code and the formula in the Custom Indicator I presented.
The only difference I can find in the algorithm presented for the Fisher Transform and the formula in the Custom Indicator I presented was already noted in my post. The presented Code does a Stochastic of (H + L) / 2 while I use a Stochastic of the entire range of Price. I will not be creating a version based on a Stochastic of (H + L) / 2 because every instance of STOC10 in the Custom Indicator would need to be replaced by something similar to:
(H + L - (H + L + H1 + L1 - ABS(H + L - H1 - L1 ) + 2 * (H2 + L2 ) - ABS(H + L + H1 + L1 - ABS(H + L - H1 - L1 ) - 2 * (H2 + L2 )) + 2 * (H3 + L3 + H4 + L4 - ABS(H3 + L3 - H4 - L4 )) - ABS(H + L + H1 + L1 - ABS(H + L - H1 - L1 ) + 2 * (H2 + L2 ) - ABS(H + L + H1 + L1 - ABS(H + L - H1 - L1 ) - 2 * (H2 + L2 )) - 2 * (H3 + L3 + H4 + L4 - ABS(H3 + L3 - H4 - L4 ))) + H5 + L5 + H6 + L6 - ABS(H5 + L5 - H6 - L6 ) + 2 * (H7 + L7 ) - ABS(H5 + L5 + H6 + L6 - ABS(H5 + L5 - H6 - L6 ) - 2 * (H7 + L7 )) + 2 * (H8 + L8 + H9 + L9 - ABS(H8 + L8 - H9 - L9 )) - ABS(H5 + L5 + H6 + L6 - ABS(H5 + L5 - H6 - L6 ) + 2 * (H7 + L7 ) - ABS(H5 + L5 + H6 + L6 - ABS(H5 + L5 - H6 - L6 ) - 2 * (H7 + L7 )) - 2 * (H8 + L8 + H9 + L9 - ABS(H8 + L8 - H9 - L9 ))) - ABS(H + L + H1 + L1 - ABS(H + L - H1 - L1 ) + 2 * (H2 + L2 ) - ABS(H + L + H1 + L1 - ABS(H + L - H1 - L1 ) - 2 * (H2 + L2 )) + 2 * (H3 + L3 + H4 + L4 - ABS(H3 + L3 - H4 - L4 )) - ABS(H + L + H1 + L1 - ABS(H + L - H1 - L1 ) + 2 * (H2 + L2 ) - ABS(H + L + H1 + L1 - ABS(H + L - H1 - L1 ) - 2 * (H2 + L2 )) - 2 * (H3 + L3 + H4 + L4 - ABS(H3 + L3 - H4 - L4 ))) - H5 - L5 - H6 - L6 + ABS(H5 + L5 - H6 - L6 ) - 2 * (H7 + L7 ) + ABS(H5 + L5 + H6 + L6 - ABS(H5 + L5 - H6 - L6 ) - 2 * (H7 + L7 )) - 2 * (H8 + L8 + H9 + L9 - ABS(H8 + L8 - H9 - L9 )) + ABS(H5 + L5 + H6 + L6 - ABS(H5 + L5 - H6 - L6 ) + 2 * (H7 + L7 ) - ABS(H5 + L5 + H6 + L6 - ABS(H5 + L5 - H6 - L6 ) - 2 * (H7 + L7 )) - 2 * (H8 + L8 + H9 + L9 - ABS(H8 + L8 - H9 - L9 ))))) / 16) / ((H + L + H1 + L1 + ABS(H + L - H1 - L1 ) + 2 * (H2 + L2 ) + ABS(H + L + H1 + L1 + ABS(H + L - H1 - L1 ) - 2 * (H2 + L2 )) + 2 * (H3 + L3 + H4 + L4 + ABS(H3 + L3 - H4 - L4 )) + ABS(H + L + H1 + L1 + ABS(H + L - H1 - L1 ) + 2 * (H2 + L2 ) + ABS(H + L + H1 + L1 + ABS(H + L - H1 - L1 ) - 2 * (H2 + L2 )) - 2 * (H3 + L3 + H4 + L4 + ABS(H3 + L3 - H4 - L4 ))) + H5 + L5 + H6 + L6 + ABS(H5 + L5 - H6 - L6 ) + 2 * (H7 + L7 ) + ABS(H5 + L5 + H6 + L6 + ABS(H5 + L5 - H6 - L6 ) - 2 * (H7 + L7 )) + 2 * (H8 + L8 + H9 + L9 + ABS(H8 + L8 - H9 - L9 )) + ABS(H5 + L5 + H6 + L6 + ABS(H5 + L5 - H6 - L6 ) + 2 * (H7 + L7 ) + ABS(H5 + L5 + H6 + L6 + ABS(H5 + L5 - H6 - L6 ) - 2 * (H7 + L7 )) - 2 * (H8 + L8 + H9 + L9 + ABS(H8 + L8 - H9 - L9 ))) + ABS(H + L + H1 + L1 + ABS(H + L - H1 - L1 ) + 2 * (H2 + L2 ) + ABS(H + L + H1 + L1 + ABS(H + L - H1 - L1 ) - 2 * (H2 + L2 )) + 2 * (H3 + L3 + H4 + L4 + ABS(H3 + L3 - H4 - L4 )) + ABS(H + L + H1 + L1 + ABS(H + L - H1 - L1 ) + 2 * (H2 + L2 ) + ABS(H + L + H1 + L1 + ABS(H + L - H1 - L1 ) - 2 * (H2 + L2 )) - 2 * (H3 + L3 + H4 + L4 + ABS(H3 + L3 - H4 - L4 ))) - H5 - L5 - H6 - L6 - ABS(H5 + L5 - H6 - L6 ) - 2 * (H7 + L7 ) - ABS(H5 + L5 + H6 + L6 + ABS(H5 + L5 - H6 - L6 ) - 2 * (H7 + L7 )) - 2 * (H8 + L8 + H9 + L9 + ABS(H8 + L8 - H9 - L9 )) - ABS(H5 + L5 + H6 + L6 + ABS(H5 + L5 - H6 - L6 ) + 2 * (H7 + L7 ) + ABS(H5 + L5 + H6 + L6 + ABS(H5 + L5 - H6 - L6 ) - 2 * (H7 + L7 )) - 2 * (H8 + L8 + H9 + L9 + ABS(H8 + L8 - H9 - L9 ))))) / 16 - (H + L + H1 + L1 - ABS(H + L - H1 - L1 ) + 2 * (H2 + L2 ) - ABS(H + L + H1 + L1 - ABS(H + L - H1 - L1 ) - 2 * (H2 + L2 )) + 2 * (H3 + L3 + H4 + L4 - ABS(H3 + L3 - H4 - L4 )) - ABS(H + L + H1 + L1 - ABS(H + L - H1 - L1 ) + 2 * (H2 + L2 ) - ABS(H + L + H1 + L1 - ABS(H + L - H1 - L1 ) - 2 * (H2 + L2 )) - 2 * (H3 + L3 + H4 + L4 - ABS(H3 + L3 - H4 - L4 ))) + H5 + L5 + H6 + L6 - ABS(H5 + L5 - H6 - L6 ) + 2 * (H7 + L7 ) - ABS(H5 + L5 + H6 + L6 - ABS(H5 + L5 - H6 - L6 ) - 2 * (H7 + L7 )) + 2 * (H8 + L8 + H9 + L9 - ABS(H8 + L8 - H9 - L9 )) - ABS(H5 + L5 + H6 + L6 - ABS(H5 + L5 - H6 - L6 ) + 2 * (H7 + L7 ) - ABS(H5 + L5 + H6 + L6 - ABS(H5 + L5 - H6 - L6 ) - 2 * (H7 + L7 )) - 2 * (H8 + L8 + H9 + L9 - ABS(H8 + L8 - H9 - L9 ))) - ABS(H + L + H1 + L1 - ABS(H + L - H1 - L1 ) + 2 * (H2 + L2 ) - ABS(H + L + H1 + L1 - ABS(H + L - H1 - L1 ) - 2 * (H2 + L2 )) + 2 * (H3 + L3 + H4 + L4 - ABS(H3 + L3 - H4 - L4 )) - ABS(H + L + H1 + L1 - ABS(H + L - H1 - L1 ) + 2 * (H2 + L2 ) - ABS(H + L + H1 + L1 - ABS(H + L - H1 - L1 ) - 2 * (H2 + L2 )) - 2 * (H3 + L3 + H4 + L4 - ABS(H3 + L3 - H4 - L4 ))) - H5 - L5 - H6 - L6 + ABS(H5 + L5 - H6 - L6 ) - 2 * (H7 + L7 ) + ABS(H5 + L5 + H6 + L6 - ABS(H5 + L5 - H6 - L6 ) - 2 * (H7 + L7 )) - 2 * (H8 + L8 + H9 + L9 - ABS(H8 + L8 - H9 - L9 )) + ABS(H5 + L5 + H6 + L6 - ABS(H5 + L5 - H6 - L6 ) + 2 * (H7 + L7 ) - ABS(H5 + L5 + H6 + L6 - ABS(H5 + L5 - H6 - L6 ) - 2 * (H7 + L7 )) - 2 * (H8 + L8 + H9 + L9 - ABS(H8 + L8 - H9 - L9 ))))) / 16)
That results in a formula that is too long to be practical as a Personal Criteria Formula, let alone for use as a Custom Indicator.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 10/7/2004 Posts: 426
|
Bruce,
Would you please make the Laguerre RSI and the Fisher Transform indicators for Blocks?
|
|
Registered User Joined: 12/30/2004 Posts: 369
|
Bruce,
The only reason that I've posted the code is because you were saying that I should compare the results given by you with another known code and the results were just a little different, more than likely because of different parameter usage. As always, I thank you for your expert help and my earlier response was not in any way a form of criticism. -amberpax
|
|
Registered User Joined: 12/30/2004 Posts: 369
|
nikolail,
The best thing to do is to compare the two RSI indicators. But Laguerre RSI in the middle window (as was provided by Bruce) and Wilder's RSI in the bottom window. You will see that Laguerre RSI is a lot more responsive, as it uses four filters vs. Wilder's RSI two. -amberpax
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
Booker, Please save the attached .pane files to:
My Documents\Blocks Files\Tool Parts\Chart
You can add them to any chart using the ADD STUDY button and then selecting Add Study | My Computer.
You can use QuickEdit to adjust the settings or view the Block Diagrams.Attachments: Laguerre RSI.pane - 10 KB, downloaded 745 time(s). Fisher Transform.pane - 11 KB, downloaded 710 time(s).
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 10/7/2004 Posts: 426
|
Thanks Bruce
|
|
Registered User Joined: 2/26/2005 Posts: 8
|
Bruce:
You've listed a pcf for the Laguerre RSI with a gamma of .5. Could I bother you to give us pcf's with gammas of .6 and .8.
Thanks.
Nicholas
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
QUOTE (TLOTLAT) Could I bother you to give us pcf's with gammas of .6...
(ABS(C >= XAVGC4.1) * (XAVGC4 - XAVGC4.1) + ABS(C1 >= XAVGC4.2) * (XAVGC4.1 - XAVGC4.2) + ABS(C2 >= XAVGC4.3) * (XAVGC4.2 - XAVGC4.3))/ (ABS(XAVGC4 - XAVGC4.1) + ABS(XAVGC4.1 - XAVGC4.2) + ABS(XAVGC4.2 - XAVGC4.3) + .0000001)
QUOTE (TLOTLAT) ...and .8.
(ABS(C >= XAVGC9.1) * (XAVGC9 - XAVGC9.1) + ABS(C1 >= XAVGC9.2) * (XAVGC9.1 - XAVGC9.2) + ABS(C2 >= XAVGC9.3) * (XAVGC9.2 - XAVGC9.3))/ (ABS(XAVGC9 - XAVGC9.1) + ABS(XAVGC9.1 - XAVGC9.2) + ABS(XAVGC9.2 - XAVGC9.3) + .0000001)
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 2/26/2005 Posts: 8
|
Bruce:
Thank you for the .6 gamma and .8 gamma, Laguerre pcf's.
Nicholas
|
|
Registered User Joined: 2/26/2005 Posts: 8
|
Bruce:
If this is the pcf for Laguerre RSI with .5 gamma
(ABS(C >= XAVGC3.1) * (XAVGC3 - XAVGC3.1) + ABS(C1 >= XAVGC3.2) * (XAVGC3.1 - XAVGC3.2) + ABS(C2 >= XAVGC3.3) * (XAVGC3.2 - XAVGC3.3))/ (ABS(XAVGC3 - XAVGC3.1) + ABS(XAVGC3.1 - XAVGC3.2) + ABS(XAVGC3.2 - XAVGC3.3) + .0000001)
and this is the pcf for Laguerre RSI with .6 gamma
(ABS(C >= XAVGC4.1) * (XAVGC4 - XAVGC4.1) + ABS(C1 >= XAVGC4.2) * (XAVGC4.1 - XAVGC4.2) + ABS(C2 >= XAVGC4.3) * (XAVGC4.2 - XAVGC4.3))/ (ABS(XAVGC4 - XAVGC4.1) + ABS(XAVGC4.1 - XAVGC4.2) + ABS(XAVGC4.2 - XAVGC4.3) + .0000001)
would this be the pcf for Laguerre RSI with a .8 or a .11 gamma?
(ABS(C >= XAVGC9.1) * (XAVGC9 - XAVGC9.1) + ABS(C1 >= XAVGC9.2) * (XAVGC9.1 - XAVGC9.2) + ABS(C2 >= XAVGC9.3) * (XAVGC9.2 - XAVGC9.3))/ (ABS(XAVGC9 - XAVGC9.1) + ABS(XAVGC9.1 - XAVGC9.2) + ABS(XAVGC9.2 - XAVGC9.3) + .0000001)
It seems like the mathematical pattern is different in the third pcf and not consistant with the first two pcf's. The numbers part of the pcf, not the formula.
Thank you.
Nicholas
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
TLOTLAT,
The XAVGC3 results from (n-1)/(n+1) = (3-1)/(3+1) = 2 / 4 = .5
The XAVGC4 results from (n-1)/(n+1) = (4-1)/(4+1) = 3 / 5 = .6
The XAVGC9 results from (n-1)/(n+1) = (9-1)/(9+1) = 8 / 10 = .8
Many gammas will not result in whole number periods that can actually be used for the Exponential Moving Average in TeleChart. For example, a gamma of .11 would require a period of 111/89. You may wish to review the following:
Cascades of Moving Averages
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 2/26/2005 Posts: 8
|
Bruce:
Thank you for the explanation.
Nicholas
|
|
Registered User Joined: 10/24/2015 Posts: 5
|
Bruce,
I found the topic about the laguerre RSI but not clear about a couple things. First, do you have a formula that will provide an indicator on the chart showing the correct Laguerre RSI values?
Also, if the indicator is possible can this be scanned for crossing selected values?
Even if the indicator is not possible can it still be scanned?
I am interested in a formula witha a gamma value of .9 and obviously it would be best to have an indicator where the value can be changed.
Thanks,
David
QUOTE (Bruce_L) The limited information I've found makes it doubtful that I am understanding these Indicators correctly, but you may wish to try the following:
A Laguerre RSI with a gamma of .5 could be created as a Custom Indicator as follows:
Select Chart Template | Add Indicator | Indicator.
- Visible: Checked
- Center Zero Line: Unchecked
- Plot using price scale: Unchecked
- Smoothing Average: 1
- Average Type: Doesn't matter (because the Smoothing Average is 1)
- Indicator Formula: (ABS(C >= XAVGC3.1) * (XAVGC3 - XAVGC3.1) + ABS(C1 >= XAVGC3.2) * (XAVGC3.1 - XAVGC3.2) + ABS(C2 >= XAVGC3.3) * (XAVGC3.2 - XAVGC3.3))/ (ABS(XAVGC3 - XAVGC3.1) + ABS(XAVGC3.1 - XAVGC3.2) + ABS(XAVGC3.2 - XAVGC3.3) + .0000001)
Adjusting the gamma would involving changing the Exponential Moving Average Period used within the Indicator Formula.
A Fisher Transform (using a Stochastic of Price for normalization instead of a Stochastic of (H + L) / 2) could be created as a Custom Indicator as follows (the Stochastic Period and Smoothing Average can both be adjusted):
Select Chart Template | Add Indicator | Indicator.
- Visible: Checked
- Center Zero Line: Unchecked
- Plot using price scale: Unchecked
- Smoothing Average: 3
- Average Type: Exponential
- Indicator Formula: LOG((ABS(STOC10 = 0) * .000001 + STOC10 / 50) / (ABS(STOC10 = 100) * .000001 + 2 - STOC10 / 50)) / 2
You may wish to review the following:
Plotting Custom Indicators with Examples
Handy PCF example formulas to help you learn the syntax of PCFs!
PCF Formula Descriptions
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
You can use a 19 period exponential moving average in the formula for a gamma of .9.
(ABS(C >= XAVGC19.1) * (XAVGC19 - XAVGC19.1) + ABS(C1 >= XAVGC19.2) * (XAVGC19.1 - XAVGC19.2) + ABS(C2 >= XAVGC19.3) * (XAVGC19.2 - XAVGC19.3)) / (ABS(XAVGC19 - XAVGC19.1) + ABS(XAVGC19.1 - XAVGC19.2) + ABS(XAVGC19.2 - XAVGC19.3) + .0000001)
The only way to really convert the formulas is to convert the gamma into the correct period exponential moving average. There is no way to create a Custom PCF Indicator for this which would just allow you to enter the gamma into the formula.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Guest-1 |