The idea
This is tradedots' open-source script titled Price and Volume Breakout Buy Strategy [TradeDots]. A new high in price alone is not enough. On the same bar, the close and the volume both have to clear the highest value from their lookback windows as of the previous bar, and the close also has to sit above a longer simple moving average. The publication describes it as a fit for assets with sharp swings and sudden bursts of activity, and it mentions bitcoin and ethereum in that context. This write-up follows the source and the author's chart; it does not repeat the publication's remarks about trade counts or holding periods.
The author's publication chart is BINANCE:BTCUSDT on the 4-hour timeframe, so this entry is filed under BTC. The script is not hard-coded to one symbol; it will load on other charts, but the write-up and the image follow that publication chart. The default order direction is Long. The short branch is in the source, but it does not fire unless you change that input.

How the indicators are calculated
- Price window: price_highest = ta.highest(Price Breakout Period). In Pine v5 that form uses high, so it is the highest high in the window. The default length is 60.
- Volume window: volume_highest = ta.highest(volume, Volume Breakout Period), using volume rather than price. The default length is also 60.
- Trend average: a simple moving average of the close, with length Trendline Length (the input variable is misspelled input_trendline_legnth, which does not change the value), default 200. The average is plotted, and candle colors follow whether the close is above or below it.
- A long needs all of these: close above price_highest[1], volume above volume_highest[1], close above that SMA, no open trades, and Order Direction not set to Short. The [1] offset uses the window extreme as of the previous bar, so the still-forming bar is not part of that benchmark.
- The strategy sets initial_capital=10000, 70% of equity per entry, and a 0.01 percent commission. It does not set pyramiding, so Pine's default of 0 applies; the source also requires strategy.opentrades == 0, so it will not add to an open trade.
Entry rules
- Long (order name Long): the price-and-volume breakout fires, the close is above the SMA, there is no open trade, and Order Direction is not Short. The script then draws a line at the broken prior high and places a Breakout Buy label near the low.
- Short (order name Short): the close falls through price_lowest[1], volume also clears the prior window high, the close is below the SMA, there is no open trade, and Order Direction is not Long. With the default Long setting, this branch is not used.
- A second signal in the same direction does not add size while a trade is open. The source does not wait for barstate.isconfirmed. On a 4-hour chart, whether the close has cleared the prior high can still change before the bar ends; whether a fill stands depends on your TradingView order settings.
Exits and position size
- Exit long: the close has been below the trend SMA for five bars in a row (close through close[4]), and the most recent open trade size is greater than 0. A comment in the source says “5 consecutive days,” but the comparison is five bars, not five calendar days. On the author's 4-hour chart, that is five consecutive 4-hour closes below the average.
- Exit short: five consecutive closes above the trend SMA, with the most recent open trade size below 0.
- There is no separate take-profit or stop-loss. The only exit is this five-bar moving-average condition.
- Each entry is 70% of equity. What that notional is worth changes with the symbol and equity, so treat the size as your own risk setting, not as a recommended allocation.
Inputs (source defaults)
| Input | Default | Role |
|---|---|---|
| Price Breakout Period | 60 | Lookback for the highest high; a long needs the close to clear the prior bar's window high. |
| Volume Breakout Period | 60 | Lookback for the highest volume. |
| Trendline Length | 200 | Length of the close SMA used as a trend filter. The variable name is spelled legnth; the value is still used as written. |
| Order Direction | Long | Long only, short only, or Long and Short. |
Things to know before using it
- It is long-only by default. The short rules apply only if you switch to Long and Short or Short.
- The “5 consecutive days” comment does not match the code. Count five bars. That lines up with five sessions only if you run it on a daily chart.
- There is no stop-loss. After a breakout, a deep pullback that stays above the average can leave the trade open until five closes finally slip under the SMA.
- 70% of equity is a large fraction, and commission is set at 0.01 percent. Live costs and slippage can differ from the tester, especially on the bar where volume spikes.
- The script recolors candles with plotcandle and may leave breakout lines and labels on the chart. That is display only and does not change the order logic.
Installing it on TradingView
- Download the .pine file from Coinpred (active membership required, see below), or check the original page for a newer version.
- Open the Pine Editor, create a blank script, paste the full source, and save.
- Click Add to chart. To match the author image, start with BINANCE:BTCUSDT on the 4-hour timeframe.
- Review the order direction, the average length, and the size in the strategy properties, then inspect fills in the Strategy Tester.
- Past tester results do not guarantee future returns.
About backtest figures
Source, license and version
- Source: https://www.tradingview.com/script/jc2hs2qK-Price-and-Volume-Breakout-Buy-Strategy-TradeDots/
- Author: tradedots (shown as TradeDots on the publication page). Source version 2.0 (Pine v5), scriptAccess=open_no_auth.
- License: Mozilla Public License 2.0. Redistribution must keep the copyright and license notices; modified files must remain under MPL 2.0. Coinpred ships the unmodified full source.
- Members can download the .pine file on this page to study the rules. Judge the risk yourself, and follow your venue's rules.



