Free Indicators

Stock Market Crash Indicator for TradeStation [Free Code]

image of Barry Taylor from Emini-Watch.com

Barry Taylor

Youtube video

Better Crash is a free TradeStation indicator that plots two trailing levels on an index chart: a 10% Correction level and a 20% Crash level, both measured down from the highest high of the last year. When price breaches a level for the first time, the indicator drops a dot on that bar and labels it “Correction” or “Crash”. It then waits for a new high before it will fire again.

That is all it does. It does not forecast. It defines. A correction is 10% off the high, a crash is 20% off the high, and the indicator shows you the exact bar where each one became official. It runs on daily, weekly or monthly charts - you set one input to match.

weekly S&P500 Emini chart, 2018 to 2026, with cyan Correction line and red Crash line trailing under price, and the Correction and Crash dots and lables
Better Crash on a weekly S&P 500 Emini chart marking the 10% corrections and 20% crashes since 2018

My setup: Weekly chart of the S&P 500 ES continuous contract with the defaults: LookBack 52, Correction 10%, Crash 20%, both packages on. That is the chart I keep open. The Correction line is the most important one - it tells me at a glance how far the current pullback has to run before it becomes a story.

Download Better Crash Indicator

The zip contains the .ELD import file and the EasyLanguage source code as plain text.

What You Get

ElementTriggerDefault colourDefault state
Correction Level lineTrails 10% below the rolling LookBack highCyanOn
Correction dot and labelFirst bar where the Low touches the Correction LevelCyanOn
Crash Level lineTrails 20% below the rolling LookBack highRedOn
Crash dot and labelFirst bar where the Low touches the Crash LevelRedOn

Each package (line, dot and label) has its own on-off switch, so you can run the Crash level alone on a long-term chart or the Correction level alone on a daily chart.

How It Works

The indicator keeps a high watermark. On every bar, it asks one question: is this bar’s High the highest High of the last LookBack bars? If yes, the watermark resets to that High, and both alerts arm.

From the watermark, it projects two levels down: the watermark times 0.90 for the Correction Level and the watermark times 0.80 for the Crash Level. These are the two trailing lines on the chart. They step up on every new high and stay flat while price is below the high.

When the Low of a bar touches or crosses the Correction Level while the correction alert is armed, the indicator fires once - a dot on the level and a label - and disarms. Same logic for the Crash Level. Neither will fire again until price makes a new LookBack high and re-arms the system. So you get one dot per decline, not a dot on every bar under the line.

The watermark is a rolling high, not an all-time high. That matters in a long bear market. After the 1929 peak, the Dow did not make a new all-time high until 1954, and an all-time-high version of this indicator would have sat silent for 25 years. With a rolling one-year lookback, the watermark rolls down with the market, the levels reset off the lower highs, and the indicator keeps marking each fresh 20% leg down.

monthly Dow Jones chart 1923 to 1948 with red Crash dots at the 1929, 1937 and 1939 breaches
Monthly Dow Jones 1923 to 1948 - Better Crash marks the 1929, 1937 and 1939 crashes

Daily, Weekly or Monthly

The only input you need to change between timeframes is LookBack. It is the number of bars in the rolling high, so it should always equal roughly one year of bars.

ChartLookBackWhy
Daily250About 250 trading days in a year
Weekly5252 weeks. This is the default.
Monthly1212 months. Use this for 50 to 100 year history charts.

Everything else stays the same. A 20% drop is a 20% drop whether it took three weeks in 2020 or three years in 1930.

Installation

  1. Download BetterCrash.zip and unzip it. You get BetterCrash.ELD and BetterCrash.txt.
  2. In TradeStation, go to File, then Import/Export EasyLanguage.
  3. Choose “Import EasyLanguage file (ELD, ELS or ELA)” and select BetterCrash.ELD.
  4. Open a daily, weekly or monthly chart of an index, insert the indicator _BetterCrash, and set LookBack to match the chart.
  5. On the Scaling tab, set it to “Same Axis as Underlying Data”.

The .txt file is the full source code. Open it in any editor to read the logic. There is no NinjaTrader or TradingView version yet.

Better Crash Settings

InputDefaultWhat it does
ShowCorrectionTrueSwitches the whole Correction package on or off: trailing line, dot and label
ShowCrashTrueSwitches the whole Crash package on or off
LookBack52Bars in the rolling high. 250 Daily, 52 Weekly, 12 Monthly
CorrectionPct10Percentage drop from the high that counts as a Correction
CrashPct20Percentage drop from the high that counts as a Crash
CorrectionColorCyanColour of the Correction line, dot and label
CrashColorRedColour of the Crash line, dot and label

Colours accept any TradeStation colour name (see TradeStation’s EasyLanguage colour list) or an RGB value. To change the dot size, open Format Indicator, go to the Style tab, and set the weight on the “Correction” and “Crash” plots. The two “Level” plots are the trailing lines and should stay as points.

Stock Market Crash Indicator FAQ

What counts as a correction and what counts as a crash?
The convention is a 10% fall from a recent high for a correction and 20% for a crash, which is also the standard definition of a bear market. Those are the defaults. Both are inputs, so if you want 30% for “crash” to isolate only the severe declines, change one number.

Does this indicator predict crashes?
No. It measures them. The dot appears on the bar where the decline crossed the threshold, which by definition is after the top. For what the market looks like before a top - the setup I look for on the Better Indicators before I will believe a crash is possible - watch the video: The Stock Market Will Not Crash Until You See This.

Why measure from a rolling high instead of the all-time high?
So the indicator keeps working inside long bear markets. Off an all-time high, the Dow would have shown one crash dot in 1929 and nothing until the 1950s. Off a rolling one-year high, it marks each fresh leg down, which is what you want when the question is “how many times did this market fall 20%”.

Why do some bear markets show two crash dots?
Because a bear market rally can make a new one-year high once the old peak has rolled out of the LookBack window. That re-arms the indicator, and the next 20% leg down fires again. It is not a bug. It is telling you the decline had two distinct legs.

Which chart should I use?
Weekly for the current market, monthly for history, daily if you trade the corrections. Set LookBack to 52, 12 or 250 respectively and leave everything else alone.

Can I use it on a stock or a futures contract?
Yes. It is just maths on High and Low. It was written for indices because that is where the 10% and 20% conventions come from, but nothing in the code cares what the symbol is.

Troubleshooting

The indicator appears in its own panel below the chart. Open Format Indicator, go to the Scaling tab, and set it to “Same Axis as Underlying Data”. The levels are prices and belong on the price chart.

No dots appear, only the lines. The dots are plots 3 and 4 and only draw on the breach bar. Check the Style tab: set “Correction” and “Crash” to Point style with a weight of 3 or more. If they are set to a weight of 1, they will be invisible.

The labels overlap the dots or the price bars. The label is anchored to the right of the dot and above the level line. On a very compressed chart, the text can still collide with the bars. Zoom in, or shorten the text in the Draw_Label calls in the source code.

The first year of the chart shows nothing. The rolling high needs LookBack bars of history to be meaningful. Load more data than you intend to look at - at least one LookBack period before the first date you care about.

I changed CrashPct and the old labels are still there. The labels are persistent drawing objects. Remove the indicator from the chart and re-insert it to clear them.

More Free TradeStation Indicators

Professional-Grade Trading Indicators

Better Crash tells you WHEN a crash or correction has happened. The ‘Better’ Indicator suite tells you WHAT the Professionals are doing before the top arrives:

  • Better Momentum - Identifies momentum shifts before they show up on price
  • Better Sine Wave - Pinpoints cycle turning points
  • Better Pro Am - Separates professional activity from amateur activity

Follow the Professionals, Fade the Amateurs. That’s the whole game, and these tools are built for it.

About the Author

Full-time futures trader Barry Taylor is the founder of Emini-Watch.com and developer of the ‘Better’ Trading Indicators - a unique set of 3 non-correlated indicators that will give you an edge, whether you’re a day trader, swing trader or investor. With over 17 years of full-time trading and traveling, Barry splits his time between Byron Bay, Biarritz and Kauai.

session indicator for tradestation

Session Indicator for TradeStation [Free Code]

Better Sessions is a free session indicator for TradeStation. It plots session breaks at the times that matter: market open, close, 11 am reversal window and the weekly close. Part of Emini-Watch’s free indicators for TradeStation. Most session indicators plot every line on every chart, leaving you to clean up ...

image of global macro rotation indicator

Better Rotation Indicator: Free Code for Asset Rotation

The Better Rotation Indicator is part of the free indicator collection - a set of tools built to help you track institutional money flow and get an edge over the market herd. The Better Rotation Indicator uses 8 major ETFs to track Global Macro trends. This indicator helps visualize the ...

stock market seasonality indicator

Stock Market Seasonality Indicator: Free Download

This stock market seasonality indicator is part of my free indicators for TradeStation, NinjaTrader and MultiCharts. Quick Answer: What Is a Stock Market Seasonality Indicator? A stock market seasonality indicator plots recurring annual patterns in price - the times of year when the market has a statistically consistent tendency to ...