Schaff Trend Cycle Indicator - futures io
futures io futures trading



Schaff Trend Cycle Indicator


Discussion in ThinkOrSwim

Updated
      Top Posters
    1. looks_one nlenz with 5 posts (4 thanks)
    2. looks_two HectorPriamedes with 3 posts (0 thanks)
    3. looks_3 cbritton with 2 posts (7 thanks)
    4. looks_4 jamesnettle with 2 posts (0 thanks)
    1. trending_up 16,031 views
    2. thumb_up 11 thanks given
    3. group 10 followers
    1. forum 21 posts
    2. attach_file 4 attachments




Welcome to futures io: the largest futures trading community on the planet, with well over 125,000 members
  • Genuine reviews from real traders, not fake reviews from stealth vendors
  • Quality education from leading professional traders
  • We are a friendly, helpful, and positive community
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts
  • We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community.  It's free and simple.

-- Big Mike, Site Administrator

(If you already have an account, login at the top of the page)

 
Search this Thread
 

Schaff Trend Cycle Indicator

(login for full post details)
  #1 (permalink)
Atlanta, Georgia
 
Experience: Intermediate
Platform: NT
Broker: DDT
Trading: ZN, ZB
 
cbritton's Avatar
 
Posts: 224 since Mar 2010
Thanks: 152 given, 249 received

Does anyone use this indicator? Here's the link to the released code:

https://www.google.com/url?sa=t&source=web&ct=res&cd=4&ved=0CCAQFjAD&url=http%3A%2F%2Fmediaserver.fxstreet.com%2FReports%2F99afdb5f-d41d-4a2c-802c-f5d787df886c%2Febfbf387-4b27-4a0f-848c-039f4ab77c00.pdf&rct=j&q=schaff+trend+cycle+indicator+pdf&ei=fmbkS5DFAYT58AaDzrHTDg&usg=AFQjCNE1pANibFs5BQNkl9UgNKds9Z_zJA&sig2=z8Lw0zJxj08DVIz_0lmFgg

I've converted this code to ToS and wanted to compare my results to others for confirmation.

Thanks,
-C

“Strategy without tactics is the slowest route to victory. Tactics without strategy is the noise before defeat.” - Sun Tzu
Attached Thumbnails
Click image for larger version

Name:	stc1.png
Views:	1007
Size:	61.0 KB
ID:	13014  
Attached Files
Register to download File Type: ts STCSTUDY.ts (1.0 KB, 262 views)
Started this thread Reply With Quote
The following 6 users say Thank You to cbritton for this post:

Can you help answer these questions
from other members on futures io?
Automatic pattern research with NT
Elite Algorithmic NinjaTrader Trading
COTbase for quant trading?
Elite Algorithmic NinjaTrader Trading
NT8 indicator to simulate a Funding Evaluation where to …
NinjaTrader
Help Needed: TOS Options Chain IV & IMPL MOVE Calcul …
ThinkOrSwim
MACD line not plotting after change of plot order
NinjaTrader
 
 
(login for full post details)
  #3 (permalink)
Florida
 
Experience: Intermediate
Platform: NT7
Trading: CL, NQ, NG
 
Posts: 469 since Jun 2009
Thanks: 1,401 given, 402 received


Hey C,

Thanks for sharing this...

I can't read ts code unless it's in a text version - hopefully some other TS coders will have a look.

Appreciate the article and his use overlaying STC on the Double Stochastic.

Thanks again, good luck

Kirk

Reply With Quote
 
(login for full post details)
  #4 (permalink)
Atlanta, Georgia
 
Experience: Intermediate
Platform: NT
Broker: DDT
Trading: ZN, ZB
 
cbritton's Avatar
 
Posts: 224 since Mar 2010
Thanks: 152 given, 249 received


zeller4 View Post
Hey C,

Thanks for sharing this...

I can't read ts code unless it's in a text version - hopefully some other TS coders will have a look.

Kirk

Kirk,

No problem with sharing. I hope through sharing, we can make use of this indicator and make it better.

.ts files are text files. You can open them with wordpad, notepad or any other text editor. Try it out, let me know what you think.

Regards,
-C

“Strategy without tactics is the slowest route to victory. Tactics without strategy is the noise before defeat.” - Sun Tzu
Started this thread Reply With Quote
The following user says Thank You to cbritton for this post:
 
(login for full post details)
  #5 (permalink)
Haifa, Israel
 
 
Posts: 5 since Jun 2010
Thanks: 0 given, 1 received

Hi,

Thank you for this indicator. I tested it against a version that I found for MT4 and when it didn't match I fixed a few things and now it matches exactly and also gives great results.
I also changed the overbought and oversold levels to 80/20 instead of 75/25 but you can change it back if you want. (MT4's version has my 80/20 levels).

Noam

Attached Files
Register to download File Type: ts STCSTUDY.ts (1.0 KB, 252 views)
Reply With Quote
The following 4 users say Thank You to nlenz for this post:
 
(login for full post details)
  #6 (permalink)
Cincinnati, OH
 
 
Posts: 1 since Jul 2010
Thanks: 0 given, 0 received

Hi Folks:

I'm looking for a version of the Schaff Trend indicator for the MT4 - BTW I have no idea how to "program" this - I think I have to "code" but am needing info as to how to get it into MT4?

Any help would be appreciated!

LC

Reply With Quote
 
(login for full post details)
  #7 (permalink)
the coin hunter
virginia
 
Experience: Intermediate
Platform: ninja
Trading: NQ
 
cory's Avatar
 
Posts: 6,030 since Jun 2009
Thanks: 845 given, 7,894 received

installation instr included
Schaff Trend Cycle Metatrader Indicator | Great Trading Systems

Reply With Quote
 
(login for full post details)
  #8 (permalink)
NYC + NY / USA
 
Experience: Advanced
Platform: "I trade, therefore, I AM!"; Theme Song: "Atomic Dog!"
Trading: EMD, 6J, ZB
 
kronie's Avatar
 
Posts: 798 since Oct 2009

just heard of this inidicator, and took a look at its picture above

it seems to lag a move, irrespective of the interval on the chart, and generally with indicators like these, one get's advance notice of a move by doing mental counts of the Ticks from the Dome, not by watching prices stream by on T&S

another indicator that is highly effective and remains so, whether or not those HFT analytics fade these common retail indicators.

Williams %R has great value in that its just like a Stochastic in having almost zero lag wit price action and helps one to see what phase relative to most recent price action, a potential trade might be in,

namely if the W%R is peaking then going long from those levels might not be best, although it still works under some conditions

conversely, if the W%R is base-lining then going short at that point might be the worse possible time to short

so how does this Schaff indicator beat or exceed those existing established ones?

Reply With Quote
 
(login for full post details)
  #9 (permalink)
OMAHA, NEBRASKA
 
Experience: Intermediate
Platform: MULTICHARTS + TOS
Broker: TRADESTATION + TOS
Trading: FUTURES
 
HectorPriamedes's Avatar
 
Posts: 23 since Sep 2011
Thanks: 29 given, 30 received

Hi guys,

I am trying to augment he STCStudy.TS indicator for back testing use in ThinkorSwim. I am usually able to augment an indicator and get it to add an order without problem. Unfortunately it will not let me add an order no matter how I play with this code. Among other attempts, I tried replacing the final lines of code like so:

From:

[.....

# smoothed calculation for %FastD of PF
rec PFF = compoundValue(1, PFF[1] + (Factor * (Frac2 - PFF[1])), Frac2);

plot SchaffTC = PFF;
plot overbought = 80;
overbought.SetDefaultColor(Color.gray);
plot oversold = 20;
oversold.SetDefaultColor(Color.gray);

]




I tried to changing the above into:




[

# smoothed calculation for %FastD of PF
rec PFF = CompoundValue(1, PFF[1] + (factor * (Frac2 - PFF[1])), Frac2);


def SchaffOutput= PFF;

def condition1 = SchaffOutput[0] < SchaffOutput[1];


AddOrder(OrderType.SELL_AUTO, condition1, close, 1, tickcolor = GetColor(0), arrowcolor = GetColor(0));

]



But no matter what I try, it will not add an order on the chart. I know I must be doing something wrong from the point where I am opting to define SchaffTC instead of plotting it as a study. But I don't know what exactly...


Thank you in advance for any help!

Reply With Quote
 
(login for full post details)
  #10 (permalink)
OMAHA, NEBRASKA
 
Experience: Intermediate
Platform: MULTICHARTS + TOS
Broker: TRADESTATION + TOS
Trading: FUTURES
 
HectorPriamedes's Avatar
 
Posts: 23 since Sep 2011
Thanks: 29 given, 30 received


Hey never mind, I solved it. thanks anyways guys.

Reply With Quote
 
(login for full post details)
  #11 (permalink)
Haifa, Israel
 
 
Posts: 5 since Jun 2010
Thanks: 0 given, 1 received


HectorPriamedes View Post
Hey never mind, I solved it. thanks anyways guys.

Would you be willing to share the results if they are good?

Thank you

p.s. I tried to reply to your PM and was denied due to having less than 5 posts.

Reply With Quote
 
(login for full post details)
  #12 (permalink)
OMAHA, NEBRASKA
 
Experience: Intermediate
Platform: MULTICHARTS + TOS
Broker: TRADESTATION + TOS
Trading: FUTURES
 
HectorPriamedes's Avatar
 
Posts: 23 since Sep 2011
Thanks: 29 given, 30 received

The results are terrible thus far. However, I am willing to share in hopes that someone can improve on my work, and share back, that way we can all benefit.

As it is now, there is too much whipsawing with the Schaff and And TOS' backtesting format is not the best. I feel like the exit criteria should not necessarily be a reversal in the SCHAFF Cycle but maybe something else. In any event you play with it and post improvements. Here is how to send a short order when the SCHAFF fires short.

Add the following as a STRATEGY (not as a study)
Begin code:



input TCLen = 10;
input MA1 = 23;
input MA2 = 50;
def factor = 0.5;
input AverageType = {SMA, default EMA};
input TradeSize = 1;
input ShaffUpperLimit = 80;


# calculate the MACD
rec XMac = MACD(MA1, MA2, 9, AverageType).Value;

# 1st Stochastic: Calculate the Stochastic of a MACD
rec Value1 = Lowest(XMac, TCLen);
rec Value2 = Highest(XMac, TCLen) - Value1;

# %FastK of MACD
rec Frac1 = if Value2 > 0 then ((XMac - Value1) / Value2) * 100 else Frac1[1];

# smoothes calcuation for %FastD of MACD
rec PF = CompoundValue(1, PF[1] + (factor * (Frac1 - PF[1])), Frac1);

# 2nd stochastic: calculate stochastic of smoothed percent FastD, 'PF', above.
rec Value3 = Lowest(PF, TCLen);
rec Value4 = Highest(PF, TCLen) - Value3;

# %FastK of PF
rec Frac2 = if Value4 > 0 then ((PF - Value3) / Value4) * 100 else Frac2[1];

# smoothed calculation for %FastD of PF
rec PFF = CompoundValue(1, PFF[1] + (factor * (Frac2 - PFF[1])), Frac2);


def SchaffOutput= PFF;

def condition1 = SchaffOutput[1] < SchaffOutput[2];

def condition2 = SchaffOutput[2] > ShaffUpperLimit;


def x0 = condition1 and condition2;


AddOrder(OrderType.SELL_AUTO, x0, close[0], TradeSize, tickcolor = GetColor(0), arrowcolor = GetColor(0));



End Code.

That's for shorting. Go through the code and flip it for longs. I am still messing with the short side.

Please post improvements!

Reply With Quote
 
(login for full post details)
  #13 (permalink)
Haifa, Israel
 
 
Posts: 5 since Jun 2010
Thanks: 0 given, 1 received


HectorPriamedes View Post
The results are terrible thus far. However, I am willing to share in hopes that someone can improve on my work, and share back, that way we can all benefit.

As it is now, there is too much whipsawing with the Schaff and And TOS' backtesting format is not the best.

Please post improvements!

Thank you. I am not surprised, because many indicators which look great in theory fail when subjected to backtests.

Reply With Quote
 
(login for full post details)
  #14 (permalink)
Carlsbad CA USA
 
 
Posts: 2 since Mar 2015
Thanks: 0 given, 0 received

Hello Everyone!
I'm new hear.
I'm looking for the TOS code for the Schaff Trend Cycle indicator. No tweaks, no changes. I found one file / attachment called STCSTUDY.ts, but it wants to open in a media player. ??? I believe the thinkscript is just straight text.
Can anyone help? THANKS IN ADVANCE

Reply With Quote
 
(login for full post details)
  #15 (permalink)
Puerto Rico
 
Experience: Intermediate
Platform: thinkorswim
Broker: TD Ameritrade
Trading: ES
 
rmejia's Avatar
 
Posts: 377 since Oct 2010
Thanks: 3,600 given, 432 received


jamesnettle View Post
Hello Everyone!
I'm new hear.
I'm looking for the TOS code for the Schaff Trend Cycle indicator. No tweaks, no changes. I found one file / attachment called STCSTUDY.ts, but it wants to open in a media player. ??? I believe the thinkscript is just straight text.
Can anyone help? THANKS IN ADVANCE

Open a chart in thinkorswim, then go to Edit Studies and Strategies and select the Import on the bottom left, then select the file. You can also right click the file, Open With and select Notepad, copy the code, then in the Edit Studies and Strategies select New... and paste the code there.

Attached Thumbnails
Click image for larger version

Name:	import.png
Views:	72
Size:	75.7 KB
ID:	179471  
Reply With Quote
 
(login for full post details)
  #16 (permalink)
Haifa, Israel
 
 
Posts: 5 since Jun 2010
Thanks: 0 given, 1 received


jamesnettle View Post
Hello Everyone!
I'm new hear.
I'm looking for the TOS code for the Schaff Trend Cycle indicator. No tweaks, no changes. I found one file / attachment called STCSTUDY.ts, but it wants to open in a media player. ??? I believe the thinkscript is just straight text.
Can anyone help? THANKS IN ADVANCE

Hi James,

It won't work by double clicking. What you have to do is from within the TOS application open a chart, then in the "studies menu"->"edit studies..." a window will open and on the lower left of that window click "Import..." and finally navigate to the file on your computer from that TOS window and click "Open". After that the study will be available in the list of studies for usage.

Reply With Quote
 
(login for full post details)
  #17 (permalink)
Carlsbad CA USA
 
 
Posts: 2 since Mar 2015
Thanks: 0 given, 0 received


nlenz View Post
Hi James,

It won't work by double clicking. What you have to do is from within the TOS application open a chart, then in the "studies menu"->"edit studies..." a window will open and on the lower left of that window click "Import..." and finally navigate to the file on your computer from that TOS window and click "Open". After that the study will be available in the list of studies for usage.

Sir, you are a gentleman and a scholar. Followed your instructions and all went well.
Thank you. JIM

Reply With Quote
 
(login for full post details)
  #18 (permalink)
Haifa, Israel
 
 
Posts: 5 since Jun 2010
Thanks: 0 given, 1 received


jamesnettle View Post
Sir, you are a gentleman and a scholar. Followed your instructions and all went well.
Thank you. JIM

You are welcome - glad it worked out. And thank you for the compliment

Reply With Quote
 
(login for full post details)
  #19 (permalink)
Sydney NSW Australia
 
 
Posts: 3 since Jul 2017
Thanks: 0 given, 0 received

Hi - hoping someone can help me out with this code below -
Question In "rec Frac1 = if Value2 > 0 then ((XMac - Value1) / Value2) * 100 else Frac1[1];
What is "Frac1[1]"
Question again in "rec PF = CompoundValue(1, PF[1] + (factor * (Frac1 - PF[1])), Frac1);
What is PF[1]? and also same with Frac2[1] and PFF[1]?????? where do I get those values from? does the bracket [] just mean default the Frac1 value to 1 if Value2<=0 and so on with the others?

Would appreciate some assistance with this
Will V L

input TCLen = 10;
input MA1 = 23;
input MA2 = 50;
def factor = 0.5;
input AverageType = {SMA, default EMA};
input TradeSize = 1;
input ShaffUpperLimit = 80;


# calculate the MACD
rec XMac = MACD(MA1, MA2, 9, AverageType).Value;

# 1st Stochastic: Calculate the Stochastic of a MACD
rec Value1 = Lowest(XMac, TCLen);
rec Value2 = Highest(XMac, TCLen) - Value1;

# %FastK of MACD
rec Frac1 = if Value2 > 0 then ((XMac - Value1) / Value2) * 100 else Frac1[1];

# smoothes calcuation for %FastD of MACD
rec PF = CompoundValue(1, PF[1] + (factor * (Frac1 - PF[1])), Frac1);

# 2nd stochastic: calculate stochastic of smoothed percent FastD, 'PF', above.
rec Value3 = Lowest(PF, TCLen);
rec Value4 = Highest(PF, TCLen) - Value3;

# %FastK of PF
rec Frac2 = if Value4 > 0 then ((PF - Value3) / Value4) * 100 else Frac2[1];

# smoothed calculation for %FastD of PF
rec PFF = CompoundValue(1, PFF[1] + (factor * (Frac2 - PFF[1])), Frac2);

Reply With Quote
 
(login for full post details)
  #20 (permalink)
 
 
Posts: 2,230 since Apr 2013
Thanks: 409 given, 1,471 received

wvl1211,

take a look at chapter 1 in the TOS Learning Center, it explains what [1] will do:
Learning Center - Chapter 1. Defining Variables

Regards,

ABCTG


wvl1211 View Post
Hi - hoping someone can help me out with this code below -
Question In "rec Frac1 = if Value2 > 0 then ((XMac - Value1) / Value2) * 100 else Frac1[1];
What is "Frac1[1]"
Question again in "rec PF = CompoundValue(1, PF[1] + (factor * (Frac1 - PF[1])), Frac1);
What is PF[1]? and also same with Frac2[1] and PFF[1]?????? where do I get those values from? does the bracket [] just mean default the Frac1 value to 1 if Value2<=0 and so on with the others?

Would appreciate some assistance with this
Will V L


Follow me on Twitter Reply With Quote
 
(login for full post details)
  #21 (permalink)
Sydney NSW Australia
 
 
Posts: 3 since Jul 2017
Thanks: 0 given, 0 received

Hi
Ok understand the [] means just previous value - no worries and thank you - so Just a bit more help needed if possible
In the line below for the STC calculation what does "CompoundValue" mean?
I know the rest but for the life of me don't get CompoundValue
Thx
Will V L

# smoothes calcuation for %FastD of MACD
rec PF = CompoundValue(1, PF[1] + (factor * (Frac1 - PF[1])), Frac1);

Reply With Quote
 
(login for full post details)
  #22 (permalink)
 
 
Posts: 2,230 since Apr 2013
Thanks: 409 given, 1,471 received

wvl1211,

this should get you going:

Learning Center - CompoundValue

The ToS help section is quite comprehensive and you can find all the functionality explained there.

Regards,

ABCTG


wvl1211 View Post
Hi
Ok understand the [] means just previous value - no worries and thank you - so Just a bit more help needed if possible
In the line below for the STC calculation what does "CompoundValue" mean?
I know the rest but for the life of me don't get CompoundValue
Thx
Will V L

# smoothes calcuation for %FastD of MACD
rec PF = CompoundValue(1, PF[1] + (factor * (Frac1 - PF[1])), Frac1);


Follow me on Twitter Reply With Quote


futures io Trading Community Platforms and Indicators ThinkOrSwim > Schaff Trend Cycle Indicator


Last Updated on July 26, 2017


Upcoming Webinars and Events
 

NinjaTrader Indicator Challenge!

Ongoing
 

Battlestations! Show us your trading desk - $1,500 in prizes!

March
 

Importance of Finding Your Own Way w/Adam Grimes

Elite only
 

Journal Challenge w/Jigsaw

April
     



Copyright © 2021 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, info@futures.io
All information is for educational use only and is not investment advice.
There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
no new posts