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
First Passage Time - Distribution Analysis models the time required for price to reach configured percentage threshold targets above or below current market levels. The script runs simulations on the final bar, displaying risk zones, statistics, and customizable labels on the main price chart. Settings allow customization of simulation counts, lookback periods, drift modes, and visual styling.
Monte Carlo simulations for price path modeling
First passage time analysis for upside and downside thresholds
Customizable drift options including historical, zero, and reduced drift
Chart overlay showing risk zones and statistical labels
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
Threshold %
float
5.0
threshold_pct
Volatility Lookback Period
int
60
volatility_period
Monte Carlo Simulations
int
1000
num_simulations
Show Risk Zones
bool
true
show_zones
Show Chart Labels
bool
true
show_labels
Distribution Type
string
Percentile
distribution_type
Maximum Periods to Simulate
int
1000
max_periods
Projection Bars
int
25
projection_bars
Show Diagnostics
bool
false
show_diagnostics
Drift Mode
string
Historical
drift_mode
Label Size
string
Normal
label_size_option
Upside Label Color
color
color.new(color.green, 10)
label_upside_color
Show all 15 settings
Setting
Type
Default
Variable
Downside Label Color
color
color.new(color.red, 10)
label_downside_color
Label Text Color
color
color.white
label_text_color
Table Font Size
string
Normal
table_font_size
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 uses a Hidden Markov Model (HMM) framework combined with an adaptive dual moving average engine and Directional Movement Index (DMI) features to identify market regimes (bullish, bearish, or ranging/chop). It calculates regime probabilities on e
This overlay indicator plots a SuperTrend-style band on the price chart using ATR length, a selectable source, and a base factor. Optional settings enable an adaptive factor driven by rate of change, a volatility filter, K-means clustering, and an LSTM layer w
Chandelier Flip Radar plots an ATR trailing stop on the price chart and tracks a directional trend state. It holds a ratchet stop until an accepted flip, using close or wick extremums and a body filter so weak breaks do not change direction. Distance to the fl
This overlay indicator builds many SuperTrend trailing stops across a user-set ATR length, factor range, and step. Each factor is scored with an exponential performance memory. K-means clustering groups those results, and the user chooses the best, average, or
This overlay indicator draws Nadaraya-Watson smoothed Bollinger Bands on the price chart using short, medium, and long periods and deviations. A smoothing factor controls the kernel bandwidth, and an optional setting can allow the estimate to repaint. Users ca
Farid Makram Custom Levels is a multi-signal indicator for TradingView that combines RSI momentum analysis with MOBO oscillator signals based on the DPO. It generates buy and sell signals when RSI crosses its moving average or when DPO crosses zero, with confi