For our 21th episode of “How to thinkScript,” we’re going to be building a Cumulative TICK indicator for ThinkOrSwim in less than 21 minutes.

The Cumulative TICK indicator is useful for those who day trade, specifically the indices. Keeping track of Market Internals is often challenging and akin to counting cards during a game of Blackjack.

We’ll use some simple thinkScript to write the code for this indicator – in fact, our Cumulative TICK indicator uses less than 12 lines of code in total. Most of the “lessons” from this tutorial will be around learning how to read and use ThinkOrSwim documentation, to build any of your own future indicators.

There are two separate parts of this tutorial:

  • Part 1 — Free for everyone (this tutorial)
  • Part 2 — Free for Volatility Box members (available here)

For our Volatility Box members, we’ve taken this tutorial one step further, with an extra 1 hour and 15 minutes of content, in which we build the Cumulative TICK Pro indicator.

In the extended tutorial, we will:

  • Leverage Python and Jupyter Notebook to analyze a TICK data set using some basic, yet powerful statistical functions
  • Incorporate the results of our data analysis into our Cumulative TICK Pro indicator file to build a mini prediction model around future price action
  • Use some clever thinkScript code to use the appropriate TICK value, based on the market you’re looking at (ie. TICK for NYSE, TICK/Q for Nasdaq, TIKI for DOW)
  • We’ll also incorporate the Edge Signals indicator and massage the code to work seamlessly with the Cumulative TICK and give us concrete bullish and bearish signals
  • Polish up the Cumulative TICK indicator code to work flawlessly with our current set of tools, and format to provide us with actionable results

Regardless of your prior thinkScript experience, I think you’ll find the Cumulative TICK thinkScript episode to be a beginner-friendly tutorial, that is a gentle introduction into the world of coding in ThinkOrSwim.

Cumulative TICK Video Tutorial

Watch the video tutorial here, to follow along with the code snippets below, to learn more about how to build an unusual volume scanner in ThinkOrSwim:

The final Cumulative TICK indicator is available for free download below.

Volatility Box Invite

We are TOS Indicators.com, home of the Volatility Box.

The Volatility Box is our secret tool, to help us consistently profit from the market place. We’re a small team, and we spend hours every day, after the market close, doing nothing but studying thousands of data points to keep improving and perfecting the Volatility Box price ranges.

We have two different Volatility Boxes – a Futures Volatility Box and a Stock Volatility Box. 

The Futures Volatility Box comes with:

The Stock Volatility Box comes with:

  • Powerful web-based platform to help you trade stocks like a pro
  • Supports 8,200+ stocks and ETFs, with daily Volatility Box price levels
  • Real-time live scanner for all liquid stocks to find active Volatility Box setups, so you can pick, and choose, and simply add them to your Dashboard for price levels
  • Completely platform agnostic, so even if you don’t have ThinkOrSwim, you’re all good
  • Access to all members-only resources, including Squeeze Course, Cumulative TICK Pro and Unusual Volume Pro Scans

If you trade both stocks and futures, e-mail us at [email protected] and we can offer you a trader-friendly bundle deal. 

Start trading at the edge, with an edge, and join the Volatility Box family today. 

What is the Cumulative TICK?

The Cumulative TICK indicator helps us to keep track of the running total of the NYSE TICK throughout the day.

A great analogy to understand the power of keeping count of the total TICK count is thinking about Blackjack. When using the Ten Count Card counting system, a running total of two different sets of cards is what gives the player an edge.

With the running count, you can make smart predictions around the remaining cards left in the deck, and make bets using that information.

Similarly, with the Cumulative TICK indicator, we’re looking to do something similar. By keeping track on an aggregate basis of the total TICKs, we can then start to make educated guesses. Some ways that we use the Cumulative TICK in the Pro tutorial include:

  • When we have a likely trending day vs. when we expect choppy days
  • When the trend has exhauste and we expect a reversal
  • Zones that signify “extreme” Cumulative TICK readings

Example of Cumulative TICK

Let’s assume that we have the following TICK values:

Time (PT)TICK
6:300
6:35-700
6:40-500
6:45+1000
6:50-325
6:55+275
7:00+750

We’ll add in one extra column, to demonstrate what the Cumulative TICK value would look like:

Time (PT)TICKCumulative TICK
6:3000
6:35-700-700
6:40-500-1200
6:45+1000-200
6:50-325-525
6:55+275-250
7:00+750+500

Here’s the same data, illustrated in a chart format:

TICK vs. Cumulative TICK Comparison Graph

thinkScript Code for Cumulative TICK

Let’s start by writing the code for the Cumulative TICK indicator.

First, we need to start by introducing in the TICK value, and we’ll use the hlc3 to take the TICK’s (high + low + close)/3:

def tickData = hlc3(symbol="$TICK");

That gives us the value for just the TICK on the current bar. We need to now introduce a way to keep a running total of the TICK count.

To do so, we’ll create a new variable called Cumulative TICK Value. This variable will not only keep a running total of the TICK, but also reset it to zero whenever we have a “new day.” To do so, we can use the SecondsTillTime function (though there are multiple ways of solving this):

def cumulativeTickValue = if SecondsTillTime(930) < 0 and SEcondsTillTime(1600) > 0 then tickData + cumulativeTickValue[1] else 0;

And we can then take that value, and plot it separately, so we can paint using the Double.nan variable:

plot cumulativeTickPlot = if cumulativeTickValue != 0 then cumulativeTickValue else Double.nan;

Formatting Code

The last thing we need to do is “pretty” up the indicator with some formatting tricks.

To format the Cumulative TICK indicator, we’ll start by adjusting the painting strategy for our plot variable, CumulativeTICKPlot.

cumulativeTickPlot.setPaintingStrategy(PaintingStrategy.Line_VS_Points);
cumulativeTickPlot.AssignValueColor(if cumulativeTickPlot &gt; cumulativeTickPlot[1] then color.cyan else color.gray);

And finally, we add a vertical line to separate each new day, so we don’t see large gaps in between new days:

def newDay = GetDay() != GetDay()[1];
AddVerticalLine(newDay, "New Day", color.gray, curve.Short_Dash);

What Else Can I Do?

You can use some of the next steps that we use in the Cumulative TICK Pro indicator and pursue those yourself.

A good first step would be to use the GetSymbol() function and have the indicator automatically cycle through the appropriate TICK value based on the chart you’re currently on.

You can also leverage the Supply/Demand Edge indicator, and overlap that with the Cumulative TICK indicator to find areas of confluence for high confidence signals (we prefer the Edge Signals, if you have access to it).

The Cumulative TICK Pro indicator can be accessed here.

Download

Click the button below to download the Cumulative TICK indicator: