Multi indicator Combination Trading Strategy
This strategy combines CCI, ADX and AO indicators to generate trading signals for long and short positions. CCI identifies overbought and oversold levels, ADX determines trend strength and direction, and AO assists…

Overview
This strategy combines CCI, ADX and AO indicators to generate trading signals for long and short positions. CCI identifies overbought and oversold levels, ADX determines trend strength and direction, and AO assists in oscillating markets. The multi-indicator combination improves the stability and efficiency of the trading system.
Strategy Logic
CCI indicates overbought above 100 and oversold below -100. This strategy goes long when CCI is below 0.
ADX measures trend strength. DI+ shows uptrend strength, DI- shows downtrend strength. ADX is the average trend strength. This strategy goes long when DI+ is below 25.
AO is fast SMA minus slow SMA. Rising AO represents strengthening bullish momentum, and falling AO represents strengthening bearish momentum. This strategy goes long when AO is below 0.
The trading rules are: Go long when CCI < 0 and DI+ < 25 and AO < 0; Close long when DI+ > 25.
Dynamically calculate order size as equity divided by close price and rounded down, to adjust orders as account equity changes.
Use strategy.entry for long signals, and strategy.close for exit signals.
Advantages
CCI filters noise from ranging markets, reducing false signals.
ADX identifies stronger trends early.
AO avoids trading choppy markets.
Multiple indicators verify signals, increasing reliability.
Dynamic position sizing manages risk effectively.
Simple and clear logic, easy to follow.
Risks
CCI struggles identifying vkosd ranges.
ADX has lag in catching trend turns.
AO struggles with choppy consolidation.
Poor indicator settings lead to over-filtering and missed trades.
Dynamic sizing dependent on volatility and markets.
Potential for large drawdowns, requiring strict risk management.
Enhancements
Optimize CCI parameters for different markets.
Optimize ADX parameters to catch trend changes.
Adjust AO parameters for volatility environments.
Test combinations to find optimal indicator weighting.
Add stop loss for drawdown control.
Incorporate volume for false breakout avoidance.
Customize fixed position sizing by instrument.
Conclusion
This strategy combines CCI, ADX and AO to generate fairly reliable long signals. Dynamic sizing and position management control risk. The logic is simple and clear for beginners to follow. But it struggles in ranging markets, with significant optimization potential required for different markets. Further testing and tuning is needed for robustness across instruments and environments.
Parameters
| Name | Default | What it controls |
|---|---|---|
| v_input_1 | 25 | buywhenadxabove |
| v_input_2 | 10 | buywhendiplusbelow |
| v_input_3 | false | buywhenccibelow |
| v_input_4 | false | buywhenawesomeoscillatorbelow |
| v_input_5 | 25 | sellwhendiplusabove |
| v_input_6 | 20 | numberofbarsforcci |
| v_input_7 | 14 | ADX Smoothing |
| v_input_8 | 14 | DI Length |
| v_input_9 | 34 | Length Slow |
| v_input_10 | 5 | Length Fast |
Source Pine Script
/*backtest
start: 2022-10-19 00:00:00
end: 2023-10-25 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=3
strategy("Strategy Niel", shorttitle="Strategy Niel", max_bars_back=2000, initial_capital=1000)
//Input variables
buywhenadxabove = input(25)
buywhendiplusbelow = input(10)
buywhenccibelow = input(0)
buywhenawesomeoscillatorbelow = input(0)
sellwhendiplusabove = input(25)
//CCI script
numberofbarsforcci = input(20)
CCI = cci(close,numberofbarsforcci)
//+DI and ADX
adxlen = input(14, title="ADX Smoothing")
dilen = input(14, title="DI Length")
dirmov(len) =>
up = change(high)
down = -change(low)
truerange = rma(tr, len)
plus = fixnan(100 * rma(up > down and up > 0 ? up : 0, len) / truerange)
minus = fixnan(100 * rma(down > up and down > 0 ? down : 0, len) / truerange)
[plus, minus]
adx(dilen, adxlen) =>
[plus, minus] = dirmov(dilen)
sum = plus + minus
adx = 100 * rma(abs(plus - minus) / (sum == 0 ? 1 : sum), adxlen)
[adx, plus, minus]
[sig, up, down] = adx(dilen, adxlen)
//plot(sig, color=red, title="ADX")
//plot(up, color=blue, title="+DI")
//plot(down, color=orange, title="-DI")
//Awesome Oscillator
nLengthSlow = input(34, minval=1, title="Length Slow")
nLengthFast = input(5, minval=1, title="Length Fast")
xSMA1_hl2 = sma(hl2, nLengthFast)
xSMA2_hl2 = sma(hl2, nLengthSlow)
xSMA1_SMA2 = xSMA1_hl2 - xSMA2_hl2
cClr = xSMA1_SMA2 > xSMA1_SMA2[1] ? blue : red
//plot(xSMA1_SMA2, style=histogram, linewidth=1, color=cClr)
buy = sig > buywhenadxabove and up < buywhendiplusbelow and CCI < buywhenccibelow and xSMA1_SMA2 < buywhenawesomeoscillatorbelow
ordersize=floor(strategy.equity/close) // Floor returns largest integer, strategy.equity gives total equity remaining - allows to dynamically calculate the order size as the account equity increases or decreases.
strategy.entry("long",strategy.long,ordersize,when= buy) //strategy.entry let's you enter the market variables id ("long"), strategy.long (long position entry), size of the order and when the order should happen
bought = strategy.position_size[0] > strategy.position_size[1]
entry_price = valuewhen(bought, open, 0)
sell = up > sellwhendiplusabove
strategy.close("long", when=sell ) //strategy.close let's you close your position with variables id ('long') and when this should happen
Published by ChaoZhang on the FMZ strategy square · last modified 2023-10-26. Collected in the Quant Trading Vault. Unvalidated research: re-test with your own data and costs before trusting it.
Build this with AgenKit
A spec is not a trading system. Paste this into your coding agent and AgenKit runs a specialist team — architecture, test-first build, risk gates, review — with paper trading on by default.
/agenkit build a production-grade trading bot with a backtest engine, risk controls and paper trading by default from strategies/Multi-indicator-Combination-Trading-Strategy.md- npx agenkit install engineering-kit in your project
- Paste the command into your agent and approve each phase
- Get tests, backtest, risk controls and a paper-trading switch
Understand it first
Before you run this, read the lesson behind the idea and how to backtest it honestly. Specs like this one are the survivors of an unknown number of trials; deflate their results accordingly.
Related specs
- GetString Momentum Breakthrough StrategyPine Script · Breakout · 3m
- MACD Bollinger Turtle Trading StrategyPine Script · Breakout · 1d
- Adaptive Trading Strategy Based on ADX IndicatorPine Script · Breakout · 1d
- Dual Breakout Volatility Channel StrategyPine Script · Breakout · 1h
- Momentum Breakout Trading Strategy 440964Pine Script · Breakout · 5m
- Moving Average Crossover and Upper Rail Breakthrough Impulse StrategyPine Script · Breakout · 1m