OPEN-SOURCE SCRIPT

Market Traffic Light

Updated
This indicator visualizes warning and panic signs, which are shown separately.

1. Section (Fear & Greed)
Approximation of the CNN Money Fear & Greed index based on code of user MagicEins. The index shows values between 0 (extreme fear, red) and 100 (extreme greed, green).

2. Section (warning signs)
  • VIX: Values above 20 are red and below green. The legend shows the value of the current bar including the change from the bar before. The average VIX is about 16. Values over 20 are a sign of stressed market.
  • Distribution days: A distribution day (loss to the day before > 0,2 % and higher volume) is marked with a yellow dot. In case there are more than four distributions days within 25 markets days the dot is orange. When big players redistribute their investments distribution days can occur. If this is done often (more than four times within 25 market days) it is possible that the markets changes or that a sector rotation occurs. For calculation distribution days futures of S&P 500 (ES1!) and NASDAQ (NQ1!) are used because the volume for this calculation is needed. TradingView does not support volumes for S&P 500 or NASDAQ directly.
  • Markets: A green/red dot signals that the market is above/below its 25-Daily-EMA. A green/red square signals that the market is above/below its 25-Weekly-EMA. Markets can give as a feeling about where investors store their money. E.g. when markets are falling but DUX (Down Jones Utility Average) is rising this means that investors put their money into save haven. This can be a sign that the markets will fall more.


3. Section (panic signs, = signs of reaching a low within a correction of a crash)
  • VIX-Reversion: A VIX reversion day (VIX > 20 & VIX high > VIX high of the day before & VIX high – VIX close > 3) is marked as a yellow dot
  • VVIX: A value equal or above 140 is marked with a yellow dot and shows absolute panic.
  • PCR Intra max: A value equal or above 1.4 is marked with a yellow dot.
  • New high/lows: New highs/lows are shown for AMEX, NYSE and NASDAQ. A yellow dot is shown if the ratio is less or equal than 0.01.
  • Down-Day: Down days are shown for AMEX, NYSE and NASDA. A yellow dot is shown if at least 90 % of the whole volume (up and down) is a down volume.


In Addition to the warning signs in the second section a check of the Advance Decline Line (NYSE and NASDAQ) for bullish and bearish divergences is useful. The whole set-up can be seen in the screenshot.

Only one signal normally does not give us a good prediction. Therefore we need to see these indication as a bundle. TradingView gives us the opportunity to check some striking market situations in the past. So feel free to test this indication for building up your own opinion.

Please feel free to comment in case of failures, improvements or experiences (good or bad).


Release Notes
V2 18.3.2021
- Changed text of market legend from "above/below" to "above" or "below" depending on the position of the market to its 21-EMA.
- Changed setting names from German to English
- Changed "Down-Volume" to "Up-/Down-Day". A red dot marks a down day (>= 90 % down volume) and a green dot marks a up day (>= 90 % up volume)
- Added VIX-TS (VIX term structure). When VX1 is above VX2 (Backwardation) or VIX is above VX1 a red dot is shown - in other cases green dot.
Release Notes
V3 6.4.2021
A small box around the last 25 possible distribution days was added. So it is easier to see which days are the base for the commulated distribution days.

Know Issues:
Depending on the chosen symbol it is possible that the weakly market data of different markets is corrupted. Unfortunately, I do not know how this happens. As a work around I chose NQ1! as the base symbol. By doing so, all market data looks correct.
Release Notes
New design and bug fixing by olivero0 - many thanks for this contribution!
Release Notes
  • Line and dot size configurable
  • Conversion to pine script V5
  • Removed unnecessary historical code
Release Notes
Added Changable colors for standard dots, trigger dots and distribution days cluster
Release Notes
When a timeframe different from 1D is active an error message appears.
Release Notes
Substituted DUX with DJU and DTX with DJT.
Release Notes
Updated symbol for US30 (Down Jones 30)
Breadth Indicatorspanicsignswarning

Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in publication is governed by House rules. You can favorite it to use it on a chart.

Want to use this script on a chart?

Disclaimer