1Copy the scriptPress Copy script above, or the copy button on the code below.
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
296 lines of Pine Script v5 from Leptokurtic Directional Bias.txt, published under MPL-2.0 (file header). Keep the author's credit and licence lines when you reuse it.
The source can be a moving average, ATR, volume, close, or a Bollinger-band trend stop. Bias mode switches among RSI mean reversion, trend-EMA momentum, and volatility only. Session inputs define an initial-balance window and a later break-tracking window. Colored backgrounds, shapes, a kurtosis line, a threshold, and a table show the state. The calculation body is not included here, so exact signal rules are not shown.
Selectable kurtosis source
Mean-reversion, momentum, and volatility-only modes
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
Kurtosis Length
int
14
kurtosis_length
Source Type
string
atr
source_type
MA Type
string
EMA
ma_type
MA Length
int
14
ma_length
ATR Length
int
14
atr_length
Volume SMA Length
int
14
volume_length
Close SMA Length
int
14
close_length
Resolution
timeframe
bb_tf
Period
int
20
bb_length
Standard Deviation
int
2
bb_deviation
Money Risk
float
1.0
bb_money_risk
Bias Mode
string
mean_reversion
bias_mode
Show all 33 settings
Setting
Type
Default
Variable
RSI Length (for Mean Reversion)
int
14
rsi_length
Trend EMA Length (for Momentum)
int
20
trend_ema_length
Initial Balance Period
session
0830-0930
ib_session
Break Tracking Session
session
0930-1600
break_tracking_session
Bullish Reversion Background
color
color.new(color.green, 85)
bullish_reversion_bg_color
Bearish Reversion Background
color
color.new(color.red, 85)
bearish_reversion_bg_color
Bullish Momentum Background
color
color.new(color.lime, 80)
bullish_momentum_bg_color
Bearish Momentum Background
color
color.new(color.orange, 80)
bearish_momentum_bg_color
High Volatility Background
color
color.new(color.yellow, 75)
high_volatility_bg_color
Bullish Reversion Shape
color
color.green
bullish_reversion_shape_color
Bearish Reversion Shape
color
color.red
bearish_reversion_shape_color
Bullish Momentum Shape
color
color.lime
bullish_momentum_shape_color
Bearish Momentum Shape
color
color.orange
bearish_momentum_shape_color
Kurtosis Plot
color
color.blue
kurtosis_plot_color
Leptokurtic Threshold Line
color
color.red
leptokurtic_threshold_color
Table Position
string
top_right
table_position
Table Text Size
string
small
table_text_size
Header Background Color
color
color.new(color.black, 20)
table_header_bg_color
Header Text Color
color
color.white
table_header_text_color
Cell Background Color
color
color.white
table_cell_bg_color
Cell Text Color
color
color.new(color.black, 20)
table_cell_text_color
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 identifies mean-reversion setups by combining Bollinger Bands with Fair Value Gaps (FVGs). It tracks FVGs that print outside the upper or lower Bollinger Bands and counts them toward an alert threshold. Signals trigger upon gap mitigation (by to
This indicator classifies the market into gamma regime types (negative gamma trend, positive gamma mean-reversion, or transition) by calculating a composite score based on daily ATR ratios, session VWAP crossover frequencies, and opening range displacement. It
This indicator marks forex trading sessions and opening ranges on the price chart. It can draw Sydney, Tokyo, Frankfurt, London, and New York session boxes or five- and fifteen-minute opening ranges, plus an optional opening channel and a day-open range. Day r
This indicator plots average bar range (ABR) measured move targets, opening range boxes, and historical key reference levels directly on the price chart. It projects bullish and bearish targets (0.5x, 1.0x, 1.5x, 2.0x ABR) from the previous session's close, al
Peak Trading Activity Graphs displays historical market activity across cyclical timeframes directly on the main chart using an on-screen dashboard table. It evaluates volume or volatility across selected periods, including hours of the day, days of the week,
Dynamic Extreme Channels & Reversals tracks evolving price highs and lows to plot adaptive channel bands and a midline directly on the price chart. When no new extremes occur within the specified lookback window, the channel boundaries interpolate toward price