Leavitt Slope and Leavitt Acceleration Indicators For ThinkOrSwim


Staff member
The TOS Slope and Acceleration Indicators were created by Jay Leavitt. His premise is that slopes rarely appear in market analysis because slope can only be taken of smooth functions and the market at any time scale is very choppy. Therefore, he uses a two-part smoothing process to create a straight smooth line (Leavitt Projections) from which the slope can be calculated. The Acceleration indicator is a derivative of slope showing the ROC of Slope.


Here is a shared link: http://tos.mx/9XiG3f4

The assumptions about trends so far are just best guesses. This is still a HUGE work-in-progress and not ready for prime-time trading.

I am hoping if anyone has experience with these indicators they will chime in. They are so fascinating! I am hoping to use the ROC of slope and slope to pick the most profitable stocks to invest in.
Last edited:

Join useThinkScript to post your question to a community of 21,000+ developers and traders.

Very interesting. Here is a demo of vertical lines on for the top chart.

def LCAcceleration = reference LeavittConvolutionAcceleration();
def LCSlope = reference LeavittConvolutionSlope();

def trendState = if LCSlope[1]>LCSlope[2] and LCSlope<LCSlope[1] and LCAcceleration<LCAcceleration[1] then 1
                else if LCSlope[1]<LCSlope[2] and LCSlope>LCSlope[1] and LCAcceleration>LCAcceleration[1] then 2
                else if LCSlope>LCSlope[1] and LCAcceleration>LCAcceleration[1] then 3
                else if LCSlope>LCSlope[1] then 4
                else if LCSlope<=LCSlope[1] and LCAcceleration<=LCAcceleration[1] then 5
                else if LCSlope<LCSlope[1] then 6 else 0;

AddVerticalLine(trendState[1] != 1 and trendState == 1, "Slope End", Color.RED);
AddVerticalLine(trendState[1] != 2 and trendState == 2, "Slope Begin", Color.GREEN);
AddVerticalLine(trendState[1] != 3 and trendState == 3, "Slope & acceleration rising", Color.WHITE);
AddVerticalLine(trendState[1] != 4 and trendState == 4, "Slope rising-acceleration not", Color.WHITE);
AddVerticalLine(trendState[1] != 5 and trendState == 5, "Slope & acceleration falling", Color.WHITE);
AddVerticalLine(trendState[1] != 6 and trendState == 6, "Slope falling-acceleration not", Color.WHITE);
AddVerticalLine(trendState[1] != 0 and trendState == 0, "Slope neutral", Color.GRAY);

DefineGlobalColor("pretrend", CreateColor(50, 200, 255)) ;
DefineGlobalColor("TrendBEGIN", CreateColor(0, 0, 255)) ;
DefineGlobalColor("rising",  CreateColor(0, 165, 0)) ;
DefineGlobalColor("maxxed", CreateColor(255, 139 ,61)) ;
DefineGlobalColor("TrendEnd", CreateColor(255, 204, 0)) ;
DefineGlobalColor("falling",  CreateColor(225, 0, 0)) ;
DefineGlobalColor("neutral",  CreateColor(153, 153, 255)) ;

if LCSlope[1]>LCSlope[2] and LCSlope<LCSlope[1] and LCAcceleration<LCAcceleration[1] then GlobalColor("TrendEnd") else 
if LCSlope[1]<LCSlope[2] and LCSlope>LCSlope[1] and LCAcceleration>LCAcceleration[1] then GlobalColor("TrendBEGIN") else
if LCSlope>LCSlope[1] and LCAcceleration>LCAcceleration[1] then GlobalColor("rising") else
if LCSlope>LCSlope[1] then GlobalColor("neutral") else
if LCSlope<=LCSlope[1] and LCAcceleration<=LCAcceleration[1] then GlobalColor("falling") else
if LCSlope<LCSlope[1] then GlobalColor("falling") else GlobalColor("neutral")
Not too long ago I started exploring acceleration and slopes for other MA's not for Leavitt. I use an excel sheet (lol)
@barbaros I incorporated your vertical lines in my 1st post. Wow! Besides being an awesome visual tool. They REALLY helped with debugging my logic. This is still a very raw product but I see great potential not only in being able to make projections about slope and acceleration but it starting to look like it will also be very useful in identifying chop!

Really appreciate your contribution!

To have vertical lines and labels in upper chart:
  1. Dragged study to upper chart
  2. Click on the gear icon and click on hide plots

Last edited:
I have a setup with Leavitt study sets combined with OpenRangeBreakout and Something called DV Clearance Range.

The Setup can give long or short direction for the day after 30 mins, to be used on 5m chart for Openrange to show the range, DV Clearing Range can work on 15m and lower, I am still working on this setup to test it out during trade hours or perhaps in an On-Demand.

Leavitt_Grid: https://tos.mx/q3HQTcw


Backtested this with on-demand, was painful to load the charts but was able to pull it off in about 3 hours, SQ and MSFT were the tickers and the date was default selected to Feb 27th.

SQ was a scalp and MSFT was a swing in to opening of next day came out to 18410$ profit (SQ - 14contracts Call Scalp MSFT - 22 Contracts Put Swing)

@barbaros Sure.
  • In addition to what was originally listed in the original post, I have additional indicators, all of them are free.
  • Open_Range_Breakout, Consolidation_Breakout, Compression_Box_Breakout and DV_Clearing_Range.
  • Compression_Box is a nice visual representation, to identify choppy zone. A nice visualization that is all.
  • Consolidation_Box is also a nice visual representation, to plot pivot levels on break out.
  • Most of the magic is happening with the rest of them, OpenRange_Breakout and DV_Clearing_Range and Leavitt Suite.
  • Set Open_Range_BreakOut, rage from 9:30 - 9:45 and 9:30 - 10:00.
  • Set DV_Clearing_Range Breach 15min.
The way to use:
  • ORB is plotting the hight low and pivot point of the first 30 mins.
  • DV_Clearing Range, if sufficient data is available is alerting trade direction with in the set Breach period. Along with stop levels for both long and short. (Please note: in my setting Breach is set to 15min, could be changed to 30min too).
  • Leavitt_suite are are a whole bunch of top and bottom chart indicators, along with custom code posted by @MerryDay and you (@barbaros), to indicate Bull/Bear end and start after entering the tread.
So, I set it in 5m charts till we past the first 30 mins of the trading day and to see if we have a trade decision on a ticker, once a trade is entered, switch over to 15m charts, to monitor Leavitt signals to see through the trade.

Exit the trade, when the candles are falling below Leavitt_Convolution plot, on upper chart area. (for long and he reverse of for short)

Hope this helps.

@SuryaKiranC Very helpful. Thank you for detailed explanation. I will definitely watch this tomorrow opening.

Do you prefer to trade with options or directly the equity?
Thread starter Similar threads Forum Replies Date
J007RMC Leavitt Projection Indicator for ThinkorSwim Indicators 12

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
292 Online
Create Post

Similar threads

Similar threads

The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
  • Exclusive indicators
  • Proven strategies & setups
  • Private Discord community
  • ‘Buy The Dip’ signal alerts
  • Exclusive members-only content
  • Add-ons and resources
  • 1 full year of unlimited support

Frequently Asked Questions

What is useThinkScript?

useThinkScript is the #1 community of stock market investors using indicators and other tools to power their trading strategies. Traders of all skill levels use our forums to learn about scripting and indicators, help each other, and discover new ways to gain an edge in the markets.

How do I get started?

We get it. Our forum can be intimidating, if not overwhelming. With thousands of topics, tens of thousands of posts, our community has created an incredibly deep knowledge base for stock traders. No one can ever exhaust every resource provided on our site.

If you are new, or just looking for guidance, here are some helpful links to get you started.

What are the benefits of VIP Membership?
VIP members get exclusive access to these proven and tested premium indicators: Buy the Dip, Advanced Market Moves 2.0, Take Profit, and Volatility Trading Range. In addition, VIP members get access to over 50 VIP-only custom indicators, add-ons, and strategies, private VIP-only forums, private Discord channel to discuss trades and strategies in real-time, customer support, trade alerts, and much more. Learn all about VIP membership here.
How can I access the premium indicators?
To access the premium indicators, which are plug and play ready, sign up for VIP membership here.