The core idea of this strategy is to identify trends using the Bollinger Band Oscillator and enter positions when trends change. It goes long when price breaks above the upper band and goes short when price breaks below the lower band, with a trend following approach to profit.
The strategy mainly uses the Bollinger Band Oscillator to determine trend direction. The formula for BBO is:
BBO = (Close - N-day Moving Average) / (2 * N-day Standard Deviation) * 100
Where Close is the closing price, N-day Moving Average is the N-day simple moving average of close, and N-day Standard Deviation is the N-day standard deviation of close.
The strategy first calculates the 65-day BBO, then the 30-day moving average of BBO. When BBO crosses above its MA, it signals an uptrend, go long. When BBO crosses below its MA, it signals a downtrend, go short.
After entering positions, the strategy uses moving stop loss, fixed take profit and trailing stop loss to control risks and lock in profits. The parameters can be optimized based on backtest results.
BBO is sensitive to trend changes.
Moving stop loss controls individual loss when trend reverses.
Fixed take profit locks in profits when trend is correct.
Trailing stop loss maximizes profit for a single trade.
The strategy is simple and intuitive.
BBO can give false signals.
Improper stop loss/take profit may exit too early.
Fixed take profit may exit too early, missing further profits.
Parameters need optimization to avoid overfitting.
Potentially large drawdown, sufficient capital required.
Optimize BBO and MA parameters.
Test different stop loss methods like ATR, percentage.
Optimize fixed take profit and trailing stop loss.
Add filters to avoid false signals.
Optimize position sizing for different markets.
Test strategy effectiveness across instruments and timeframes.
The strategy identifies trend changes using BBO and enters positions accordingly. It controls risks and locks in profits with various types of exits. The strategy is simple and intuitive but requires parameter optimization. It can perform well in trending markets if optimized properly, but false signals and improper exits need to be watched out for.
/*backtest start: 2022-10-03 00:00:00 end: 2023-10-09 00:00:00 period: 1d basePeriod: 1h exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}] */ //@version=2 strategy(title="Strategy CCT Bollinger Band Oscillator", shorttitle="Hornkild", calc_on_order_fills=true, default_qty_type=strategy.percent_of_equity, default_qty_value=50, overlay=false) length=input(65) lengthMA=input(30) src=close cctbbo=100 * ( src + 2*stdev( src, length) - sma( src, length ) ) / ( 4 * stdev( src, length ) ) //ul=hline(100, color=gray, editable=true) //ll=hline(0, color=gray) //hline(50, color=gray) //fill(ul,ll, color=blue) //plot(cctbbo, color=blue, linewidth=2) //plot(ema(cctbbo, lengthMA), color=red) TP = input(0) * 10 SL = input(0) * 10 TS = input(1) * 10 TO = input(10) * 10 CQ = 100 TPP = (TP > 0) ? TP : na SLP = (SL > 0) ? SL : na TSP = (TS > 0) ? TS : na TOP = (TO > 0) ? TO : na longCondition = crossover(cctbbo, ema(cctbbo, lengthMA)) if (longCondition) strategy.entry("Long", strategy.long) shortCondition = crossunder(cctbbo, ema(cctbbo, lengthMA)) if (shortCondition) strategy.entry("Short", strategy.short) strategy.exit("Close Short", "Short", qty_percent=CQ, profit=TPP, loss=SLP, trail_points=TSP, trail_offset=TOP) strategy.exit("Close Long", "Long", qty_percent=CQ, profit=TPP, loss=SLP, trail_points=TSP, trail_offset=TOP)template: strategy.tpl:40:21: executing "strategy.tpl" at <.api.GetStrategyListByName>: wrong number of args for GetStrategyListByName: want 7 got 6