CCI Stochastic GMMA

CCI Stochastic GMMA combines a stochastic oscillator calculated from CCI with two Guppy-style EMA groups. It buys when CCI momentum rises out of an oversold region while the short EMA group is above the long group and price is above both.
This makes it a trend-aligned momentum-recovery strategy rather than a simple oversold buyer.
warning
Protection is disabled by default. Bearish and trend-loss exits only execute at break-even or better.
CCI stochastic trigger
CSG_CCI_PERIOD creates the underlying CCI series. A stochastic oscillator is then calculated over that series using CSG_STOCH_PERIOD, CSG_STOCH_K_SMOOTH, and CSG_STOCH_D_SMOOTH.
CSG_SIGNAL_LINE selects which result controls threshold crossings:
kuses K;duses D;eitheruses the higher of K and D on each candle.
A buy needs the selected value to cross upward through CSG_OVERSOLD. A bearish setup needs it to cross downward through CSG_OVERBOUGHT.
Higher smoothing reduces short-lived crossings. Raising oversold makes bullish triggers easier and later in the recovery; lowering it demands a deeper oscillator decline first.
GMMA trend structure
CSG_SHORT_EMAS and CSG_LONG_EMAS are comma-separated EMA lengths. The defaults form the familiar short and long Guppy groups.
With CSG_REQUIRE_GROUP_CROSS disabled, the average short group only needs to be above the average long group. Enable it to require a fresh group-average crossover on the signal candle.
Enable CSG_REQUIRE_ALL_SHORT_ABOVE to require every short EMA above the long-group average. This is stricter than comparing group averages.
Price must close above both group averages. Enable CSG_REQUIRE_CANDLE_COLOR to additionally require a green entry candle.
The strategy opens one position and does not average down.
Stop and target
The stop is placed below the lowest low in CSG_SWING_LOOKBACK, with an extra CSG_STOP_BUFFER_PCT.
Enable CSG_USE_PROTECTION to make that structural stop executable. With protection enabled, the target is at least both:
CSG_TARGET_PCTabove entry;- initial risk multiplied by
CSG_RISK_REWARD.
Without protection, risk/reward does not raise the target; the fixed target applies. CSG_USE_TARGET controls whether the target executes, and CSG_MIN_NET_GAIN_PCT maintains a fee-aware floor.
Technical exits
Enable CSG_EXIT_ON_BEARISH_CROSS for a profitable exit on the complete mirrored bearish setup: CCI stochastic falls from overbought, GMMA is bearish, and price is below both groups.
Enable CSG_EXIT_ON_MOMENTUM_LOSS to exit profitably when the selected CCI-stochastic value falls below 50.
A short-group average below the long-group average is an always-active profitable trend-loss exit. Protection is required for deliberate loss-taking.
Good market conditions
The strategy generally works best during orderly uptrends where the long EMA group is stable, the short group contracts during a pullback, and CCI stochastic recovers from oversold as price reclaims both groups.
Avoid tangled EMA groups, thin markets, and sideways ranges where oscillator threshold crossings occur without sustained group separation.
Creating the strategy
Create a spot strategy and choose CCI Stochastic GMMA for both methods. Begin with the default 15-minute period.
First verify the EMA lists and group structure. Then tune oscillator responsiveness and decide whether current alignment or a fresh group cross is required. Add candle color and all-short confirmation only when they remove specific weak setups.
Strategy settings
Trading and safeguards
| Setting | Description |
|---|---|
BUY_ENABLED | Enables entries. |
SELL_ENABLED | Enables exits. |
PERIOD | Candle period; default 15 minutes. |
TRADING_LIMIT | Compatibility fallback only. It is ignored while the strategy-specific trading limit contains a positive value. Configure the strategy-specific setting for normal use. For USDT-BTC, this value is in USDT. |
CSG_TRADING_LIMIT | For USDT-BTC, the amount of USDT used for an entry. |
FUNDS_RESERVE | For USDT-BTC, the amount of USDT the bot must leave unused. |
KEEP_QUOTE | For USDT-BTC, the amount of BTC the strategy must not sell. |
MIN_VOLUME_TO_BUY | General minimum buy value. For USDT-BTC, this value is in USDT. |
MIN_VOLUME_TO_SELL | General minimum sell value. For USDT-BTC, this value is in USDT. |
CSG_MIN_ORDER_VALUE | Strategy minimum entry value. For USDT-BTC, this value is in USDT. |
CSG_MIN_SELL_VALUE | Strategy minimum exit value. For USDT-BTC, this value is in USDT. |
GAIN | General gain fallback retained in configuration. |
CSG_COOLDOWN_MS | Delay between live actions. |
CSG_MAX_SPREAD_PCT | Relative spread ceiling. |
CSG_MAX_SPREAD_ABSOLUTE | Optional absolute spread ceiling; 0 disables it. For USDT-BTC, this value is in USDT. |
CSG_NEWS_BLOCK | Manually blocks entries. |
CSG_NEWS_BLOCK_UNTIL | Blocks entries until the configured time. |
Signal
| Setting | Description |
|---|---|
CSG_CCI_PERIOD | CCI length feeding the stochastic calculation. |
CSG_STOCH_PERIOD | Stochastic lookback over CCI. |
CSG_STOCH_K_SMOOTH | K smoothing. |
CSG_STOCH_D_SMOOTH | D smoothing. |
CSG_SIGNAL_LINE | Chooses K, D, or either for threshold crossings. |
CSG_OVERSOLD | Upward-cross threshold for entries. |
CSG_OVERBOUGHT | Downward-cross threshold for bearish setups. |
CSG_SHORT_EMAS | Comma-separated short EMA lengths. |
CSG_LONG_EMAS | Comma-separated long EMA lengths. |
CSG_REQUIRE_GROUP_CROSS | Requires a fresh short/long group-average cross. |
CSG_REQUIRE_ALL_SHORT_ABOVE | Requires every short EMA above the long average for buys. |
CSG_REQUIRE_CANDLE_COLOR | Requires a green entry candle and red bearish candle. |
Risk and exits
| Setting | Description |
|---|---|
CSG_SWING_LOOKBACK | Candles searched for the structural stop. |
CSG_STOP_BUFFER_PCT | Extra distance below the recent low. |
CSG_RISK_REWARD | Initial-risk multiplier used to raise the target with protection. |
CSG_USE_TARGET | Enables the target. |
CSG_USE_PROTECTION | Enables the structural stop. |
CSG_TARGET_PCT | Fixed target distance. |
CSG_MIN_NET_GAIN_PCT | Intended gain beyond fee break-even. |
CSG_EXIT_ON_BEARISH_CROSS | Enables profitable exit on the full bearish setup. |
CSG_EXIT_ON_MOMENTUM_LOSS | Enables profitable exit below oscillator 50. |
Backtesting
| Setting | Description |
|---|---|
BF_SINCE | Backtest start. |
BF_UNTIL | Backtest end. |
DEEP_TESTING | Enables deeper backtesting. |
Practical tuning directions
Fresh group-cross mode is much stricter than trend-alignment mode and can miss pullback continuations. Compare those modes before changing all EMA lengths.
If the structural stop is too wide, reduce swing lookback or choose a market and period with cleaner pullbacks. A small stop buffer cannot compensate for an irrelevant old low.
Important limitations
- CCI stochastic is an oscillator of an oscillator and can be very sensitive.
eithersignal-line mode does not mean either line crossing independently; it uses the higher current value.- The always-active GMMA trend-loss exit waits for profit.
- Risk/reward raises the target only when protection is enabled.
- Custom EMA lists must contain sensible positive lengths.
- News blocking is manual.
CCI Stochastic GMMA is most useful when momentum recovers inside an already recognizable trend. Oversold alone is not the thesis; the EMA groups provide the context.