NYSE Tick & Breadth: Thinkorswim Chart Setup

Trading with the market internals such as the NYSE tick and market breadth can lead to increased efficiency in your entry’s and exits. While it is most commonly used for intraday trading, it is possible to trade larger timeframes. The NYSE tick is only available during regular trading hours of 9:30 AM EST – 4:00 PM EST as the data is derived from the New York Stock Exchange.

Here I have optimized the setup my NYSE tick chart for day trading the E-mini S&P Futures.

 

Instructions for Installing the Code:

To setup your chart per the video above, click on

Studies > Edit Studies > New Study (bottom left)

Delete ‘plot Data = Close;’ and paste the following code below.

Note: You can modify the parameters in the properties box

NYSE Tick Range Code

(Original code courtesy of thinkscripter, but it has since been modified)

Copy this tick range code into the new study box in Thinkorswim.

NYSE Tick, Breadth, & AD Line

Breadth Box Code

Same as above, copy this code into a new study, save and activate.

def A = close(“$UVOL”);
def D = close (“$DVOL”);
def ADL = Round(A / D, 1);
def ADR = if A > D then Round(A / D, 1) else Round(-D / A, 1);
input mode = {default Ratio};
def modeSwitch = if mode == mode.Ratio then 1 else 0;
AddLabel(yes, Concat(
if modeSwitch then ADR else ADL, Concat(” “,
if modeSwitch then “:1″ else ” “)),
if modeSwitch then if ADR > ADR[1] then Color.GREEN else Color.RED else if ADL > ADL[1] then Color.GREEN else Color.RED);
plot null = Double.NaN;

Advance/Decline Box Code

def A = close(“$ADVN”);
def D = close (“$DECN”);
def ADL = Round(A / D);
def ADR = if A > D then Round(A – D) else Round (-D + A);
input mode = {default Ratio};
def modeSwitch = if mode == mode.Ratio then 1 else 0;
AddLabel(yes, Concat(
if modeSwitch then ADR else ADL, Concat(” “,
if modeSwitch then ” ” else ” “)),
if modeSwitch then if ADR > ADR[1] then Color.GREEN else Color.RED else if ADL > ADL[1] then Color.GREEN else Color.RED);
plot null = Double.NaN;

My Top 5 Trading Tools
Get My Top 5 Trading Tools + Plus 3 Free Chapters of my eBook, "Trading Rules for the ES & 6E Futures!" Just enter your name and email below:

About Tim Racette

Tim is a full-time trader in the futures and stock markets and founder of EminiMind.com. He is also a Chicago-land native, competitive mountain biker, adventurer, and ASU Sun Devil.

32 Responses to “NYSE Tick & Breadth: Thinkorswim Chart Setup”

  1. Tim this is brilliant! Thanks very much, specially for the Breadth Box Code. I’ve seen it on your setup before, it’s great that you shared it :)

  2. just came across your site. thanks. it’s great

  3. Free advice that really works is rare. Thank-you for this insight. You clearly have some great ideas for making day trading a bit easier.

  4. I’m really enjoying all the free info on your site, much appreciated.

    I’m a struggling ES trader looking to get better. I’m using ToS and have implemented your tools on this page.

    Thanks!

  5. I have seen your webinar with IF this week, and I’m really amazed of your E-mini S%P trading system, its simplicity is a great catch; now I see your site and I’m astonished for all the free info you share,
    Thanks!

  6. Hi Tim, is ToS Think or Swim a charting software service run by Ameritrade simular to Esignal Supercharts etc.?Ill get to your web site asap. Take care, eat well, sleep well, live well, and of course…..trade well.

    • Yes it is John. TDAmeritrade acquired Thinkorswim in June of 2011. Esignal and Tradestation offer very comparable platforms, I’ve just been with TOS for the past 6 years and thus built some platform loyalty.

  7. Hello, I having trouble copying the code. The next message appear:

    Invalid statement: AddChartLabel at 7:1

  8. Yeah I am getting the same error, Nato did you get it figured out?

  9. I think AddChartLabel has been replaced by addlabel, so the code should be:

    def A = close(“$UVOL”);
    def D = close (“$DVOL”);
    def ADL = Round(A / D, 1);
    def ADR = if A > D then Round(A / D, 1) else Round(-D / A, 1);
    input mode = {default Ratio};
    def modeSwitch = if mode == mode.Ratio then 1 else 0;
    addlabel(yes, concat(
    if modeSwitch then ADR else ADL, concat(” “,
    if modeSwitch then “:1″ else ” “)),
    if modeSwitch then if ADR > ADR[1] then color.green else color.red else if ADL > ADL[1] then color.green else color.red);
    plot null = Double.NaN;

    I am NOT positive this is doing the same thing as the original code, so use at your own risk, but as of 11/18/2012 this removes the error on the TOS platform.

  10. I cannot get the Breadth Box code to work correctly in TOS. I am getting an error when I try to create the study.

  11. I tried the modified code in Prescott’s post and still get an error from line 7 “addlabel” down through the end of the code.

  12. The script work. But they doesn’t refresh data. Any help please!

  13. Nick over at thinkorswim informed me that the last update caused an issue with the ‘AddLabel’ command. The latest update has since fixed the issue and the code above is working correctly on my system. You should be good to go!

  14. Tim, I use Infinity as the broker and Sierra Charts for charting. I have looked for something like this on their system with no luck, any ideas about how to build the above in Sierra?

    • That I don’t Robert. Have you asked Jim or your individual broker at Infinity? I just Googled “Market Internals for Sierra Charts” and there were a couple of forum posts that might be helpful.

  15. I was having the same problem with the “breath box” not working in TOS, but I got it to work. Here is the script again. Thanks so much for this Tim.

    def A = close(“$UVOL”);
    def D = close (“$DVOL”);
    def ADL = Round(A / D, 1);
    def ADR = if A > D then Round(A / D, 1) else Round(-D / A, 1);
    input mode = {default Ratio};
    def modeSwitch = if mode == mode.Ratio then 1 else 0;
    AddLabel(yes, Concat(
    if modeSwitch then ADR else ADL, Concat(” “,
    if modeSwitch then ”:1 ” else ” “)),
    if modeSwitch then if ADR > ADR[1] then Color.GREEN else Color.RED else if ADL > ADL[1] then Color.GREEN else Color.RED);
    plot null = Double.NaN;

  16. Sorry I should clarify how I made the change. At line 7, I deleted all info. from that line down, and then copied and pasted the code from the “ADVN/DECN that Tim has above.
    Then all I added was :1
    For some reason, even tho’ the codes are exactly the same from line 7 onward…the breath box code does not seem to want to compute in TOS, but A/D will. So now it should work.

  17. I’m copying and pasting what Trader69 has above and its not working.

  18. Hi Maurice, this is copied directly from my TOS Studies Editor…

    def A = close(“$UVOL”);
    def D = close (“$DVOL”);
    def ADL = Round(A / D, 1);
    def ADR = if A > D then Round(A / D, 1) else Round(-D / A, 1);
    input mode = {default Ratio};
    def modeSwitch = if mode == mode.Ratio then 1 else 0;
    AddLabel(yes, Concat(
    if modeSwitch then ADR else ADL, Concat(” “,
    if modeSwitch then “:1″ else ” “)),
    if modeSwitch then if ADR > ADR[1] then Color.GREEN else Color.RED else if ADL > ADL[1] then Color.GREEN else Color.RED);
    plot null = Double.NaN;

  19. Awesome new share study in thinkorswim allows me to share the studies as links. Here are the Breadth and AD Line Studies:

    Breadth: http://tos.mx/s2f72s
    AD Line: http://tos.mx/n5rvRm

    TickRange: http://tos.mx/n5rvRm

  20. Tim, thanks for sharing. I am enjoying your site the education and knowledge sharing by you.

  21. Awesome site. Downloaded the breadth indicator. Quick question, how can i get the data box to show with the opening bredth so I can see where it is in relation to where it started…like you have on the market internals bredth page

    • Hi Matt, I think this code will work as it has in there NBO for NYSE breadth open and QBO for NASDAQ breadth open.

      def UV = close(“$UVOL”);
      def DV = close (“$DVOL”);
      def UVQ = close(“$UVOL/Q”);
      def DVQ = close (“$DVOL/Q”);
      def PosR = if UV > DV then round(UV / DV,1) else round(-DV / UV,1);
      def PosRQ = if UVQ > DVQ then round(UVQ / DVQ,1) else round(-DVQ / UVQ,1);

      def AV = close(“$ADVN”);
      def DC = close (“$DECN”);
      def Market_Open_Time = 0930;

      rec TheDaysOpen = if(secondsTillTime (931) == 0, PosR, TheDaysOpen[1]);
      rec TheDaysOpenQ = if(secondsTillTime (931) == 0, PosRQ, TheDaysOpenQ[1]);
      Def TimeCondition1= secondsFromTime(959) == 0;
      Def TimeCondition2= secondsFromTime(1059) == 0;
      Def TimeCondition3= secondsFromTime(1159) == 0;
      Def TimeCondition4= secondsFromTime(1259) == 0;
      Def TimeCondition5= secondsFromTime(1359) == 0;
      Def TimeCondition6= secondsFromTime(1029) == 0;
      Def TimeCondition7= secondsFromTime(1129) == 0;
      Def TimeCondition8= secondsFromTime(1459) == 0;
      Def TimeCondition9= secondsFromTime(1544) == 0;

      AddChartLabel(YES, concat(
      “NBO=” ,TheDaysOpen),
      if TheDaysOpen >=0 then color.green else color.red);

      AddChartLabel(YES, concat(
      if UV > DV then round(UV / DV, 1) else round(-DV / UV, 1), “:1 NBreath”),
      if PosR > TheDaysOpen then color.green else color.red);

      input timeFrame = {default DAY, “2 DAYS”, “3 DAYS”, “4 DAYS”, WEEK, MONTH, “OPT EXP”};

      AddChartLabel(YES, concat(
      “QBO=” ,TheDaysOpenQ),
      if TheDaysOpenQ >=0 then color.green else color.red);

      AddChartLabel(YES, concat(
      if UVQ > DVQ then round(UVQ / DVQ, 1) else round(-DVQ / UVQ, 1), “:1 QBreath”),
      if PosRQ > TheDaysOpenQ then color.green else color.red);

      AddChartLabel(YES, concat(
      if AV > DC then round(AV / DC, 1) else round(-DC / AV, 1), “:1 ADratio”),
      if AV > DC then color.green else color.red);

      AddChartLabel(YES,concat (
      AV – DC,”A/D”),
      if ((AV – DC)> 400 or (AV – DC)< -400) then color.wHITE else color.daRK_GRAY);

  22. WOW! Thanks A LOT!

Leave a Reply