1Copy the scriptPress Copy script above. It reads the file straight from GitHub.
2Open the Pine EditorOpen a TradingView chart and choose Pine Editor at the bottom of the screen.
3Paste over the templateCreate a new indicator, select all of the template text and paste. Press Save and give it a name.
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.
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
Risk Method
string
Standard Deviation
risk_method
Drawdown Calculation
string
Period High
dd_method
Drawdown Lookback Bars
int
21
dd_lookback
Lookback Period (0 = All Data)
int
0
lookback
Use Start/End Dates Instead
bool
false
use_date_range
Start Date
time
timestamp("2023-01-01")
start_date
End Date
time
timestamp("2024-12-31")
end_date
Number of Bins
int
30
num_bins
Auto Bin Width
bool
true
auto_bin_width
Manual Bin Width
float
0.001
manual_bin_width
Bar Resolution [1 to 50]
int
50
Bar Resolution [1 to 50]
Height (% of Panel) [33 to 100]
float
60
row_height
Show all 27 settings
Setting
Type
Default
Variable
Use Risk Quartile Colors
bool
true
use_quartile_colors
Q1 - Low Risk (0-25%)
color
color.new(color.green, 20)
q1_color
Q2 - Med-Low Risk (25-50%)
color
color.new(color.yellow, 20)
q2_color
Q3 - Med-High Risk (50-75%)
color
color.new(color.orange, 20)
q3_color
Q4 - High Risk (75-100%)
color
color.new(color.red, 20)
q4_color
Single Color (if quartiles off)
color
color.new(color.blue, 20)
hist_color
Show Current Risk Emoji
bool
true
show_current_emoji
Current Risk Emoji
string
🎯
current_emoji
Table Font Size
string
Tiny
table_font_size
Table Text Color
color
color.white
table_text_color
Table Background Color
color
color.new(color.black, 70)
table_bg_color
Table Header Color
color
color.new(color.blue, 30)
table_header_color
Positive Values Color
color
color.rgb(155, 255, 135)
clr_lbl_pos_num
Negative Values Color
color
color.rgb(255, 155, 135)
clr_lbl_neg_num
Label Precision [0 to 8]
int
4
label_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.
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
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
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
The 8-Factor Composite Screener evaluates equities across fundamental and technical criteria, including valuation ratios, earnings and revenue growth, 12-month return momentum, proximity to 52-week highs, Stage 2 moving average alignment, benchmark relative st
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
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