Strategy · Pine Script v5 · On the chart

DegenerateChain Channel Breakout

by Web3Degenerate

This strategy enters long when price closes above the prior channel high and a longer EMA filter, the bar is bullish, volume rises versus the previous bar, and average volume and turnover clear set thresholds.

View on GitHub

GitHub stars2on the repository
Pine versionv5runs as is
Lines of code43
Settings6inputs
LicenceNone statedfile: MPL-2.0
Last update2 years ago13 Sep 2024

Add It to Your TradingView Chart

  1. 1Copy the scriptPress Copy script above, or the copy button on the code below.
  2. 2Open the Pine EditorOpen a TradingView chart and choose Pine Editor at the bottom of the screen.
  3. 3Paste over the templateCreate a new strategy, select all of the template text and paste. Press Save and give it a name.
  4. 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

43 lines of Pine Script v5 from advanced-pine-script/9.Strategy-Scripts/11.Channel-Breakout-Strategy.pine, published under MPL-2.0 (file header). Keep the author's credit and licence lines when you reuse it.

11.Channel-Breakout-Strategy.pine
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/

// @version=5
strategy("www.DegenerateChain.com", overlay=true, 
     initial_capital=100000, 
     default_qty_type=strategy.percent_of_equity, 
     default_qty_value=100)

// Get user inputs
i_ChannelHigh       = input.int(15, "Channel Lookback")
i_EMA1              = input.int(90, "Filter EMA Length")
i_EMA2              = input.int(10, "Exit EMA Length")
i_VolumeIncrease    = input.float(1.25, "Volume Increase %")
i_Liquidity         = input.int(1000000, "Liquidity Avg 100-Day")
i_Turnover          = input.int(500000, "Turnover Filter")

// Get indicator values
EMA_Volume      = ta.ema(volume, 100)
EMA_Filter      = ta.ema(close, i_EMA1)
EMA_Exit        = ta.ema(close, i_EMA2)
ChannelHigh     = ta.highest(high, i_ChannelHigh)
AvgTurnover     = ta.ema(volume * close, 100)

// Check entry conditions
LC_1 = close > ChannelHigh[1]
LC_2 = close > EMA_Filter
LC_3 = close > open
LC_4 = volume > volume[1] * (1 + (i_VolumeIncrease / 100))
LC_5 = EMA_Volume > i_Liquidity and AvgTurnover > i_Turnover
LongEntry = LC_1 and LC_2 and LC_3 and LC_4 and LC_5

// Enter long trade
if (LongEntry)
    strategy.entry("Long", strategy.long)

// Exit long trade
if (close < EMA_Exit)
    strategy.close("Long")

// Draw info
plot(ChannelHigh[1], "Channel High", color.red, 2)
plot(EMA_Filter, "EMA Filter", color.blue, 2)
plot(strategy.position_size != 0 ? EMA_Exit : na, "Stop Loss", color.red, 1, plot.style_linebr)

Overview

DegenerateChain Channel Breakout exits the long when price closes below a shorter EMA. Lookback, both EMA lengths, the volume increase, and liquidity and turnover floors are user inputs. It draws the channel high, filter EMA, and in-position exit EMA on the price chart. It has no separate stop-loss order.

Details

Published by

Web3Degenerate on GitHub

Type

Strategy, Pine Script v5

Draws

On the price chart

Category

Breakout, Moving averages, Volume, Trend

Markets

Any symbol

Timeframes

Any timeframe

Risk Notes

  • The strategy enters trades without a stop loss

Settings

The inputs you can change from the gear icon on the chart. Defaults are the author's.

SettingTypeDefaultVariable
Channel Lookbackint15i_ChannelHigh
Filter EMA Lengthint90i_EMA1
Exit EMA Lengthint10i_EMA2
Volume Increase %float1.25i_VolumeIncrease
Liquidity Avg 100-Dayint1000000i_Liquidity
Turnover Filterint500000i_Turnover
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.

Similar Pine Scripts

1 stars

This strategy identifies breakout opportunities in Bursa Malaysia stocks using a slow EMA trend filter where price exceeds the 150-period EMA and the slow EMA is above its 150 EMA. It plots fast and slow EMAs on the price chart. Entry occurs on a new 20-day hi

Strategy v5 BreakoutMoving averages
Updated 4 months ago · None stated GitHub repository of KLSE VCP Breakout Backtest
257 stars

This strategy plots running pivot highs as red R circles and pivot lows as blue S circles directly on the price chart. It computes an EMA 3 and a Cto trend line from close prices, then generates long signals on upward EMA-Cto crossovers combined with price pos

Strategy v6 TrendMoving averages Repaints
Updated 6 weeks ago · None stated GitHub repository of Best Chart 1m Strategy Candle Bar
218 stars

This strategy enters long when a faster moving average crosses above a slower one and short when it crosses below, unless long-only mode is on. An optional volume filter requires volume above a 20-bar average times a multiplier. Exits use a percentage stop los

Strategy v6 TrendMoving averages
Updated 3 months ago · None stated GitHub repository of MA Cross Strategy Template

12/26-IT Strategy

by hasnocool
106 stars

This strategy executes trades based on crossovers between a 12-period and a 26-period exponential moving average (EMA). Long positions can be filtered by pivot resistance breakouts and RSI boundary ranges. For trade management, it provides two configurable par

Strategy v5 TrendMoving averages
Updated 2 years ago · GPL-3.0 GitHub repository of 12/26-IT Strategy

均线突破交易系统

by tangly1024
76 stars

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

Strategy v5 TrendMoving averages
Updated 4 months ago · None stated GitHub repository of 均线突破交易系统

More strategys

Trade Your Charts With a Regulated Broker

Compare brokers that connect to TradingView, with spreads, minimum deposits and leverage side by side.

Compare brokers