Tags:

This strategy is designed based on the Keltner Channel indicator to generate trading signals when price breaks through the upper and lower bands of the channel. The strategy only goes long, if a sell signal appears, it will flatten the position to neutral.

The strategy uses SMA and ATR to build the Keltner Channel. The upper and lower bands are calculated as:

Upper Band = SMA + ATR * Multiplier Lower Band = SMA - ATR * Multiplier

When price breaks above the upper band, a buy signal is generated. When price breaks below the lower band, a sell signal is generated.

Since it only goes long, if a sell signal appears, it will cancel previous orders and flatten the position.

The logic is:

- Build Keltner Channel with SMA and ATR
- When price breaks above upper band, set entry price and go long
- When price breaks below lower band, flatten previous long position

The advantages of this strategy:

- Simple and clear logic, easy to understand and implement
- Keltner Channel is intuitive for trend identification
- Only go long avoids chasing stop loss risk
- Conditional orders for precision entries

There are also some risks:

- Frequent open/close trades during market fluctuation
- Unable to take advantage of short opportunities
- Lack of exit mechanism, need manual intervention

Solutions:

- Optimize channel parameters to reduce false signals
- Add short module for two-way trading
- Add exit mechanisms like moving stop loss, trailing stop

The strategy can be optimized in the following aspects:

- Optimize parameters like channel period, ATR multiplier etc
- Add short module based on lower band breakout
- Incorporate stop loss mechanisms like ATR trailing stop
- Consider more filters to avoid false signals
- Test effectiveness across different products

This strategy effectively catches market trends with simple Keltner Channel rules. The logic is clear and easy to understand. Although the lack of exits and short module, it has great potential for improvements like parameter tuning, adding stops, going short etc. Overall a valuable quant strategy worth in-depth research and application.

/*backtest start: 2023-11-24 00:00:00 end: 2023-12-24 00:00:00 period: 1h basePeriod: 15m exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}] */ //@version=3 strategy("Keltner Channel Strategy", overlay=true) source = close useTrueRange = input(true) length = input(20, minval=1) mult = input(1.0) ma = sma(source, length) range = useTrueRange ? tr : high - low rangema = sma(range, length) upper = ma + rangema * mult lower = ma - rangema * mult crossUpper = crossover(source, upper) crossLower = crossunder(source, lower) bprice = 0.0 bprice := crossUpper ? high+syminfo.mintick : nz(bprice[1]) sprice = 0.0 sprice := crossLower ? low -syminfo.mintick : nz(sprice[1]) crossBcond = false crossBcond := crossUpper ? true : na(crossBcond[1]) ? false : crossBcond[1] crossScond = false crossScond := crossLower ? true : na(crossScond[1]) ? false : crossScond[1] cancelBcond = crossBcond and (source < ma or high >= bprice ) cancelScond = crossScond and (source > ma or low <= sprice ) if (cancelBcond) strategy.cancel("KltChLE") if (crossUpper) strategy.entry("KltChLE", strategy.long, stop=bprice, comment="KltChLE") if (cancelScond) strategy.cancel("KltChSE") if (crossLower) strategy.entry("KltChSE", strategy.short, stop=sprice, comment="KltChSE") //plot(strategy.equity, title="equity", color=red, linewidth=2, style=areabr)

- Trend Following Strategy Based on Multi Timeframe TEMA Crossover
- Dynamic Balancing Strategy with 50% Funds and 50% Positions
- Single-Side Entry Strategy Based on Moving Average
- Adaptive Multi Timeframe Fibonacci Retracement Trading Strategy
- Oscillating Long-Short RSI Crypto Switching Strategy
- Trend Trading Strategy Based on Triple Hull Moving Averages and Ichimoku Kinko Hyo
- Dynamic Moving Averages and Keltner Channel Trading Strategy
- Trend Following Strategy Based on RSI and Weighted Moving Average
- Dual Moving Average Reversal Strategy
- Double Bollinger Bands Breakout Strategy
- Price Volume Trend Strategy
- KST策略
- Three SMA Crossover Momentum Strategy
- Dual Reversal Momentum Index Trading Strategy
- Dual Bollinger Band Volatility Tracking Strategy
- MACD Histogram Strategy of RSI
- Quantitative Trading Strategy Based on RSI Indicator and Moving Average
- BBMA Breakthrough Strategy
- An Enhanced Flag Pattern Recognition Strategy Integrating with SuperTrend
- Dynamic Filter Quant Trading Strategy