Schaff Trend Cycle - BUG

Locked
TimJS

Schaff Trend Cycle - BUG

Post by TimJS » Mon Apr 26, 2010 10:48 pm

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

KWasserman S&C
Posts: 16
Joined: Mon Jan 18, 2010 3:22 pm

Re: Schaff Trend Cycle - BUG

Post by KWasserman S&C » Tue Apr 27, 2010 9:40 am

Thank you for your comment. We will try to check into it.

KWasserman S&C
Posts: 16
Joined: Mon Jan 18, 2010 3:22 pm

Re: Schaff Trend Cycle - BUG

Post by KWasserman S&C » Tue Apr 27, 2010 10:39 am

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.

TimJS

Re: Schaff Trend Cycle - BUG

Post by TimJS » Tue Apr 27, 2010 11:23 am

Thanks, I spoke with TradeStation EasyLanguage team and they said that is was a BUG in the code not a TradeStation issue.

KWasserman S&C
Posts: 16
Joined: Mon Jan 18, 2010 3:22 pm

Re: Schaff Trend Cycle - BUG

Post by KWasserman S&C » Fri Apr 30, 2010 10:50 am

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.

Fibbtrader

Re: Schaff Trend Cycle - BUG

Post by Fibbtrader » Sat Jun 19, 2010 8:26 am

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

Fibbtrader

Re: Schaff Trend Cycle - BUG

Post by Fibbtrader » Sat Jun 19, 2010 8:44 am

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

Fibbtrader

Re: Schaff Trend Cycle - BUG

Post by Fibbtrader » Sun Jun 20, 2010 3:15 pm

Has the bug fix for Schaff Trend cycle posted for TS?

Thanks

JasonHutson S&C
Posts: 17
Joined: Mon Jan 11, 2010 4:22 pm

Re: Schaff Trend Cycle - BUG

Post by JasonHutson S&C » Mon Jun 21, 2010 1:17 pm

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.

KWasserman S&C
Posts: 16
Joined: Mon Jan 18, 2010 3:22 pm

Re: Schaff Trend Cycle - BUG

Post by KWasserman S&C » Mon Jun 21, 2010 1:46 pm

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

doug4knfpu
Posts: 1
Joined: Fri Jul 20, 2012 11:13 am

Re: Schaff Trend Cycle - BUG

Post by doug4knfpu » Mon Jul 23, 2012 1:23 pm

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 :)

Locked

Who is online

Users browsing this forum: No registered users and 70 guests