Indicator · Pine Script v5 · Own pane

Risk Distribution Histogram

by regalouisei

This indicator plots a histogram of historical risk values in a separate pane.

View on GitHub

GitHub stars2on the repository
Pine versionv5runs as is
Lines of code395
Settings27inputs
LicenceNone stated
Last update8 months ago25 Feb 2026

Add It to Your TradingView Chart

  1. 1Copy the scriptPress Copy script above. It reads the file straight from GitHub.
  2. 2Open the Pine EditorOpen a TradingView chart and choose Pine Editor at the bottom of the screen.
  3. 3Paste over the templateCreate a new indicator, select all of the template text and paste. Press Save and give it a name.
  4. 4Add it to the chartPress Add to chart, then adjust the settings with the gear icon next to its name.

Source Code

The code stays on GitHub. The author has not published this script under an open licence, so ForexR does not show its code. Copy script reads the file straight from GitHub into your clipboard, so you can still try it on your own chart. Ask the author before reusing the code anywhere else.

Overview

Risk Distribution Histogram calculates risk with standard deviation, ATR, downside deviation, drawdown, entropy-based risk, or VIX. Drawdown can use the period high or a rolling high. Users set lookback, optional start and end dates, bin count, and automatic or manual bin width. Quartile colors or a single color shade the bars, and a table shows labels. It does not generate trade entries or exits.

Details

Published by

regalouisei on GitHub

Type

Indicator, Pine Script v5

Draws

Separate pane below the chart

Category

Volatility & bands, Screeners & dashboards

Markets

Any symbol

Timeframes

Any timeframe

Risk Notes

No repainting, lookahead or stacked entries were found in its code or README. That says nothing about how well it works: test it first.

Settings

The inputs you can change from the gear icon on the chart. Defaults are the author's.

SettingTypeDefaultVariable
Risk MethodstringStandard Deviationrisk_method
Drawdown CalculationstringPeriod Highdd_method
Drawdown Lookback Barsint21dd_lookback
Lookback Period (0 = All Data)int0lookback
Use Start/End Dates Insteadboolfalseuse_date_range
Start Datetimetimestamp("2023-01-01")start_date
End Datetimetimestamp("2024-12-31")end_date
Number of Binsint30num_bins
Auto Bin Widthbooltrueauto_bin_width
Manual Bin Widthfloat0.001manual_bin_width
Bar Resolution [1 to 50]int50Bar Resolution [1 to 50]
Height (% of Panel) [33 to 100]float60row_height
Show all 27 settings
SettingTypeDefaultVariable
Use Risk Quartile Colorsbooltrueuse_quartile_colors
Q1 - Low Risk (0-25%)colorcolor.new(color.green, 20)q1_color
Q2 - Med-Low Risk (25-50%)colorcolor.new(color.yellow, 20)q2_color
Q3 - Med-High Risk (50-75%)colorcolor.new(color.orange, 20)q3_color
Q4 - High Risk (75-100%)colorcolor.new(color.red, 20)q4_color
Single Color (if quartiles off)colorcolor.new(color.blue, 20)hist_color
Show Current Risk Emojibooltrueshow_current_emoji
Current Risk Emojistring🎯current_emoji
Table Font SizestringTinytable_font_size
Table Text Colorcolorcolor.whitetable_text_color
Table Background Colorcolorcolor.new(color.black, 70)table_bg_color
Table Header Colorcolorcolor.new(color.blue, 30)table_header_color
Positive Values Colorcolorcolor.rgb(155, 255, 135)clr_lbl_pos_num
Negative Values Colorcolorcolor.rgb(255, 155, 135)clr_lbl_neg_num
Label Precision [0 to 8]int4label_precision
Third-party code. ForexR did not write, test or endorse this script, and the summary above was generated automatically from its code and README. Indicators describe the past, and a strategy's backtest can look better than live trading, especially when a script repaints. Check it in the Strategy Tester and on a demo account before you rely on it.

Similar Pine Scripts

This indicator scans a pasted list of symbols and shows matching long and short setups in a table in a separate pane. It uses a Supertrend crossover, then applies an ATR or fixed-point volatility range so quiet, sideways conditions can be skipped. Optional fil

Indicator v5 TrendVolatility & bands
Updated 1 year ago · MPL-2.0 GitHub repository of Trend Following Setup - Sideways Market Skipper Scanner

Test 009 Stat Mining

by ricardosantos79
261 stars

This statistical analysis tool mines historical relationships between RSI values and candle volatility. It calculates a 14-period RSI from the previous bar and normalizes absolute price change using a 14-period Average True Range (ATR). Based on the normalized

Indicator v4 Oscillators & momentumVolatility & bands
Updated 4 years ago · None stated GitHub repository of Test 009 Stat Mining

Market Speedometer

by TradersPost
218 stars

Market Speedometer plots a 0-100 market speed reading in a separate pane. It measures movement by bar-to-bar change, true range, or a short average of recent bars, then ranks that movement against ATR and a percentile lookback. An EMA smooths the reading, and

Indicator v6 Volatility & bandsOscillators & momentum
Updated 3 months ago · None stated GitHub repository of Market Speedometer
46 stars

This indicator summarizes higher-timeframe candle range statistics by time of day and shows them in a table in a separate pane. It groups candles into slots for 5-minute, 15-minute, 1-hour, 4-hour, 8-hour, or 12-hour periods over a chosen lookback in days, and

Indicator v5 Screeners & dashboardsSessions & time Repaints
Updated 7 weeks ago · None stated GitHub repository of HTF Candle Stats by Time of Day
41 stars

This indicator transforms standard RSI calculations into logit space, estimating rolling distributions to derive empirical z-scores mapped back to the 0–100 RSI scale. Plotted in a separate pane, it features multi-horizon central lines—fast and structural cent

Indicator v6 Oscillators & momentumVolatility & bands
Updated 2 days ago · None stated GitHub repository of Calibrated RSI Position Zones

More indicators

Trade Your Charts With a Regulated Broker

Compare brokers that connect to TradingView, with spreads, minimum deposits and leverage side by side.

Compare brokers