Registered User Joined: 2/13/2009 Posts: 3
|
Could you help me with the necessary formulas to set up a custom indicator of the Schaff Trend Cycle (STC).
|
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!
You may wish to review the Market Trend Cycle PCFs? topic.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
Registered User Joined: 2/13/2009 Posts: 3
|
Bruce, thanks again for the info. I have some thoughts. I have created two STC based on your short formula approximations dated October 30, 2007. How close are these to the actual STC? What is the difference in the two fotmulas. I note they are close together except on extreme bottom.
Also, I found this on line. Is this something I could program into Telechart or is this proprietary? Is this something you could use to make a STC in Telechart. Also, I am willing to run a test on the two formulas.
Attached formula found on line.
The Code for the Schaff Trend Cycle
The code for the STC indicator and function are below, in TradeStation EasyLanguage format.
Comments to the code are written in light green.
{*******************************************************************
Description : This Indicator plots the Schaff Trend Cycle
Provided By : FX-Strategy, Inc. (c) Copyright 1999
********************************************************************}
Inputs: TCLen(10), MA1(23), MA2(50);
plot1(_SchaffTC(TCLen,MA1,MA2),"Schaff_TLC");
plot2(25);
plot3(75);
{*******************************************************************
Description : This is the Schaff Trend Cycle function
Provided By : FX-Strategy.com (c) Copyright 1999
********************************************************************}
Inputs: TCLen(NumericSimple), MA1(NumericSimple), MA2(NumericSimple);
Variables: XMac(0), Frac1(0), PF(0), PFF(0), Frac2(0), Factor(.5);
{Calculate a MACD Line}
XMac = MACD(c,MA1,MA2) ;
{1st Stochastic: Calculate Stochastic of a MACD}
Value1 = Lowest(XMac, TCLen);
Value2 = Highest(XMac, TCLen) - Value1;
{%FastK of MACD}
Frac1 = IFF(Value2 > 0, ((XMac - Value1) / Value2) * 100, Frac1[1]);
{Smoothed calculation for %FastD of MACD}
PF = IFF(CurrentBar<=1, Frac1, PF[1] + (Factor * (Frac1 - PF[1])));
{2nd Stochastic: Calculate Stochastic of Smoothed Percent FastD, ‘PF’, above.}
Value3 = Lowest(PF, TCLen);
Value4 = Highest(PF, TCLen) - Value3;
{%FastK of PF}
Frac2 = IFF(Value4 > 0, ((PF - Value3) / Value4) * 100, Frac2[1]);
{Smoothed calculation for %FastD of PF}
PFF = IFF(CurrentBar<=1, Frac2, PFF[1] + (Factor * (Frac2 - PFF[1])));
{The STC function is the %FastD of PF}
_SchaffTC= PFF;
Any further thoughts?
Brian
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
It can be created perfectly in StockFinder. I've done it. Even with this as a basis of comparison, I would not wish to render an opinion as to if the TeleChart approximation is "close enough".
The problem with creating it in TeleChart (as mentioned in the Market Trend Cycle PCFs? topic) is the Stochastic. Calculating the Minimums and Maximums required for its calculation results in formulas that are way too long to be practical (or to even fit in the Windows clipboard for copy and paste). The modified Stochastic is really just calculating the Stochastic (with an Exponential %SK applied) and then feeding that result into the same Stochastic (with the same Smoothing). The fact that the Stochastic is calculated twice makes the resulting formula much longer than if it were applied just once (which was the assumption in the original topic).
-Bruce Personal Criteria Formulas TC2000 Support Articles
|