Skip to content
All library documents

MA and CCI Mean-Reversion Entries with a Trailing Take Profit

Article Strategy library · Author: 3Commas

Summary

This Pine Script strategy represents a long-only Bitcoin perpetual-futures bot configuration. Its entry concept combines a fast moving average crossing below a slower moving average with a low Commodity Channel Index reading. The documented source settings use 24- and 31-period averages and an 11-period CCI on an hourly timeframe; the signal combination can be set to require both inputs or accept either, with a short keep-alive window for aligning them.

The position uses a trailing take profit that activates after a specified gain and follows price at a small deviation, alongside a hard stop measured from entry. The configuration disables safety orders, uses one-times cross leverage, and specifies a cash-sized base order. The excerpt gives implementation settings, commission and slippage assumptions, and date inputs, but no completed backtest results or performance analysis. The description is therefore useful for understanding the signal and exit design, while its effectiveness cannot be judged from the supplied material.

Key ideas

  • The long entry combines a downward fast-versus-slow moving-average crossover with a low CCI reading.
  • Both signals can be required together or combined with an either-signal rule.
  • The documented bot configuration uses hourly signals on a Bitcoin perpetual pair.
  • A trailing profit exit activates after a gain, while a hard stop limits adverse movement.
  • The excerpt provides configuration details but no strategy performance results.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.