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 strategy, select all of the template text and paste. Press Save and give it a name.
4Add it to the chartPress Add to chart. The trades and results appear in the Strategy Tester tab; adjust the settings with the gear icon.
Source Code
91 lines of Pine Script v4 from BTC Candle Correlation Strategy.pine, published under GPL-3.0. Keep the author's credit and licence lines when you reuse it.
BTC Candle Correlation Strategy derives a composite price value using quadratic averaging and plots a volatility envelope around its simple moving average. Trade entries trigger when the composite price crosses the upper or lower channel bands. User settings control the smoothing length, channel multiplier, long-only toggle, and backtest date range. The strategy displays directly on the price chart and includes no stop-loss rules.
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
length
int
9
length
mult
float
0.9
mult
longOnly
bool
true
longOnly
From Day
int
1
fromDay
From Month
int
1
fromMonth
From Year
int
2000
fromYear
To Day
int
31
toDay
To Month
int
12
toMonth
To Year
int
2021
toYear
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.
Calculates standard Bollinger Bands and identifies band expansion breakouts where upper and lower bands move in opposite directions. It enters long positions when price breaks above the upper band with a high candle body percentage, and enters short positions
This strategy plots VWMA-based Bollinger bands on the 1-minute ES futures price chart for volatility analysis and potential breakout identification. It calculates dynamic long and short stop loss and take profit levels using percentage inputs relative to entry
This strategy detects price breakouts above rolling highest highs or below lowest lows over a customizable lookback period. It includes optional volume spike and ATR volatility threshold filters, along with bar confirmation rules. Positions are taken upon conf
This price-chart strategy plots a simple moving average and upper and lower bands built from the standard deviation of close, scaled by separate offset inputs. It enters a fixed quantity long when close crosses above the upper band and a fixed quantity short w
This strategy trades long breakouts of a fast and a slow moving average on the price chart. It opens a long position when price crosses above either average, using a percentage of equity as size. It reduces the position by a set share when the high reaches the
This strategy plots exponential-moving-average Bollinger bands on the price chart and calculates RSI. It opens a long position when close crosses above the upper band while RSI is at or above a threshold, the date filter allows trading, and no position is open