Page 1 of 1

Schaff Trend Cycle - BUG

Posted: Mon Apr 26, 2010 10:48 pm
by TimJS
In reviewing the latest version of Stocks & Commodities magazine, on page 96, the EasyLanguage code was provided for the Schaff Trend Cycle. Unfortunately, the code has a bug on line 2.

Plot1(_SchaffTC(TCLen,MA1,MA2), “Schaff_TLC”); The "_SchaffTC" code will not pass through the VERIFY command of TradeStation. Does anyone have any suggestions on how to resolve this?

Thanks.

TIM

Re: Schaff Trend Cycle - BUG

Posted: Tue Apr 27, 2010 9:40 am
by KWasserman S&C
Thank you for your comment. We will try to check into it.

Re: Schaff Trend Cycle - BUG

Posted: Tue Apr 27, 2010 10:39 am
by KWasserman S&C
Tim,
Apparently, the EasyLanguage code on page 96 of the April 2010 issue in the article "The Schaff Trend Cycle" may not work in the latest version of TradeStation. Please contact TradeStation technical support (http://www.TradeStation.com or https://www.tradestation.com/Discussion ... rum_ID=213) for assistance. They may be able to offer an updated version of this code.

Re: Schaff Trend Cycle - BUG

Posted: Tue Apr 27, 2010 11:23 am
by TimJS
Thanks, I spoke with TradeStation EasyLanguage team and they said that is was a BUG in the code not a TradeStation issue.

Re: Schaff Trend Cycle - BUG

Posted: Fri Apr 30, 2010 10:50 am
by KWasserman S&C
Tim,
You are correct that there were some errors in the EasyLanguage code that appeared on page 96 of the April 2010 issue of S&C. Thank you for letting us know of the problem.

The correct code will be posted at our website in the Subscriber's Area at http://technical.traders.com/sub/sublogin.asp as well as in our archived online version of the article at http://www.traders.com/Documentation/FE ... close.html, and also will be mentioned as a correction notice in the next issue of S&C.

Re: Schaff Trend Cycle - BUG

Posted: Sat Jun 19, 2010 8:26 am
by Fibbtrader
I could not find the code fix, has this fix been updated? Tim, were you able to make it work in TS. I'm getting the same error message
"This word has already been defined" .

Re: Schaff Trend Cycle - BUG

Posted: Sat Jun 19, 2010 8:44 am
by Fibbtrader
Has the code been corrected for the SchaffTrendCycle code for TradeStation that was part of the April 2010 issue? I get an error on line 5 Inputs:TCLen(NumericSimple),MA1(NumericSimple),MA2(NumericSimple); I get an error "This word has already been defined." And I get a warning "TCLen is an input, redefinition".

Any help would be greatly appreciated.

Thanks
Ash

Re: Schaff Trend Cycle - BUG

Posted: Sun Jun 20, 2010 3:15 pm
by Fibbtrader
Has the bug fix for Schaff Trend cycle posted for TS?

Thanks

Re: Schaff Trend Cycle - BUG

Posted: Mon Jun 21, 2010 1:17 pm
by JasonHutson S&C
Sorry. The best information we have on the bug is to redirect your question to Tradestation here:

https://www.tradestation.com/Discussion ... rum_ID=213

If they have posted a fix please re-post it here that would be greatly appreciated.

Re: Schaff Trend Cycle - BUG

Posted: Mon Jun 21, 2010 1:46 pm
by KWasserman S&C
The corrected EasyLanguage code for the Schaff trend cycle is as follows:

Code: Select all

Inputs: TCLen (10), MA1 (23), MA2 (50);
 
Plot1(_SchaffTC(TCLen,MA1,MA2), "Schaff_TLC");
Plot2(25);
Plot3 (75);
 
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;
 
{%Fast K of MACD}
Frac1=IFF(Value2 > 0, ((XMAC-Value1)/Value2) * 100,Frac1[1]);
 
{Smoothed Calculation for % Fast D of MACD}
PF=IFF(CurrentBar <=1,Frac1,PF[1]+ (Factor * (Frac1-PF[1])));
 
{2nd Stochastic: DCalculate Stochastic of smoothed Percent Fast D, 'PF', above}
Value3=Lowest(PF,TCLen);
Value4=Highest(PF,TCLen)-Value3;
 
{% of Fast K of PF}
FRAC2=IFF(Value4 > 0,((PF - Value3)/Value4) * 100,Frac2[1]);
 
{Smoothed Calculation for %Fast D of PF}
PFF=IFF(CurrentBar<=1,Frac2,PFF[1]+(Factor * (Frac2-PFF[1])));
 
{The STC Function is the % Fast D of PF}
_SchaffTC=PFF;

A correction notice ran in the July 2010 issue of STOCKS & COMMODITIES and the corrected code was posted in our Subscriber Area at http://technical.traders.com/sub/Codes/ ... Twomey.asp.

Incidentally, TradeStation Tech Support explains about the above EasyLanguage code that there are two sections to this code: the first three lines set up an indicator, and the rest is a function called ‘_SchaffTC’.

Please let us know if you have further difficulties.

For your interest only, a reader contributed some further discussion about this code in our June 2010 Letters to the Editor column in STOCKS & COMMODITIES. You will find it here: http://www.traders.com/Documentation/FE ... tters.html

Re: Schaff Trend Cycle - BUG

Posted: Mon Jul 23, 2012 1:23 pm
by doug4knfpu
KWasserman S&C wrote:The corrected EasyLanguage code for the Schaff trend cycle is as follows:

Code: Select all

Inputs: TCLen (10), MA1 (23), MA2 (50);
 
Plot1(_SchaffTC(TCLen,MA1,MA2), "Schaff_TLC");
Plot2(25);
Plot3 (75);
 
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;
 
{%Fast K of MACD}
Frac1=IFF(Value2 > 0, ((XMAC-Value1)/Value2) * 100,Frac1[1]);
 
{Smoothed Calculation for % Fast D of MACD}
PF=IFF(CurrentBar <=1,Frac1,PF[1]+ (Factor * (Frac1-PF[1])));
 
{2nd Stochastic: DCalculate Stochastic of smoothed Percent Fast D, 'PF', above}
Value3=Lowest(PF,TCLen);
Value4=Highest(PF,TCLen)-Value3;
 
{% of Fast K of PF}
FRAC2=IFF(Value4 > 0,((PF - Value3)/Value4) * 100,Frac2[1]);
 
{Smoothed Calculation for %Fast D of PF}
PFF=IFF(CurrentBar<=1,Frac2,PFF[1]+(Factor * (Frac2-PFF[1])));
 
{The STC Function is the % Fast D of PF}
_SchaffTC=PFF;

A correction notice ran in the July 2010 issue of STOCKS & COMMODITIES and the corrected code was posted in our Subscriber Area at http://technical.traders.com/sub/Codes/ ... Twomey.asp.

Incidentally, TradeStation Tech Support explains about the above EasyLanguage code that there are two sections to this code: the first three lines set up an indicator, and the rest is a function called ‘_SchaffTC’.

Please let us know if you have further difficulties.

For your interest only, a reader contributed some further discussion about this code in our June 2010 Letters to the Editor column in STOCKS & COMMODITIES. You will find it here: http://www.traders.com/Documentation/FE ... tters.html
Newbie here. Thank you for the update :)