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.
// 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.
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
Channel Lookback
int
15
i_ChannelHigh
Filter EMA Length
int
90
i_EMA1
Exit EMA Length
int
10
i_EMA2
Volume Increase %
float
1.25
i_VolumeIncrease
Liquidity Avg 100-Day
int
1000000
i_Liquidity
Turnover Filter
int
500000
i_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.
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
This strategy plots a comparative relative strength line against a benchmark symbol in a separate pane. It calculates price and volume simple moving averages alongside a multi-period highest high. Long trades enter using full equity when price exceeds its movi
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
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
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
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