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
151 lines of Pine Script v4 from scripts/120-Stdev-Breakout-Strategy.pine, published under MPL-2.0 (file header). Keep the author's credit and licence lines when you reuse it.
A long signal triggers when standard deviation crosses above its moving average during a bullish candle, while a short signal occurs when it crosses below during a bearish candle. Signals can be filtered by ATR volatility, volume RSI, or both. Positions automatically close after a configurable holding period or when an opposite signal triggers. Buy and sell labels display directly on the price chart. Signal timing relies on live time calculations, causing historical bars to evaluate differently than live bars.
Standard deviation and moving average crossover logic
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
Dataset
string
Close
ptype
Resolution
timeframe
reso
Lag |1..n|
int
10
lag
MA Lag |1..n|
int
200
malag
Time Threshold |0.1..100.0|
float
0.01
tthres
Filter Signals by
string
None
ftype
Holding Period |1..n|
int
2
holding_p
===Information===
bool
false
show_info
Lot Size
float
0.01
lot_size
Use Base Price?
bool
false
ubase
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 overlay indicator marks Linda Raschke short-term bar setups on the price chart. It flags Turtle Soup and Turtle Soup plus one false breakouts of a prior extreme, 80-20 bars, inside bars, failed inside-bar breakouts, outside up and down bars, NR4 and NR7 c
This indicator plots Squeeze Momentum in a separate pane. It compares Bollinger Bands with a Keltner Channel to mark a squeeze when the bands sit inside the channel. Momentum is a linear regression of price relative to a Donchian midline and an SMA, shown as a
Calculates the time elapsed between consecutive bars to measure market speed and volatility, designed primarily for Renko chart blocks where bar duration varies. In Momentum mode, it contrasts the current duration against a 100-period moving average baseline,
The Momentum Setup is a multi-indicator visual tool designed for trend and momentum analysis directly on the price chart. It combines Relative Strength Index (RSI), Money Flow Index (MFI), Commodity Channel Index (CCI), Supertrend, and a 250-bar percentage cha
This indicator plots trade entry and exit signals on the price chart by combining Bollinger Bands with optional filter conditions. It calculates standard Bollinger Bands along with RSI, Aroon, and moving average filters. Reversal signals trigger when price bre
An overlay indicator that combines an ATR-based SuperTrend trailing stop with an integrated RSI-derived midline calculation on the price chart. The SuperTrend uses an ATR period and factor multiplier to plot dynamic green or red trend lines based on price dire