Noon Barbari
Registrarse

Volver a la biblioteca de estrategias

Seguimiento de tendenciaLargos y cortos15m1h4h1d

Trend Magic strategy

CCI-gated ATR ratchet — long on a bullish wick break of the trail, short on the mirror.

Tesis

CCI-gated ATR ratchet — long on a bullish wick break of the trail, short on the mirror.

Encaja con los setups de Seguimiento de tendencia — funciona mejor cuando el comportamiento del mercado coincide con la tesis, y falla cuando no. Combínala con el modo walk-forward del backtester antes de comprometer capital real.

Selective entries — the wick-cross condition is strict, so trades fire only when momentum really pushes through. Strong in trending regimes, quiet during balanced ranges.

Conjunto de reglas YAML

Pégalo en la pestaña «Text» del Strategy Designer, o usa el botón del panel de arriba para cargarlo como plantilla.

_template:
  title: Trend Magic — CCI-gated ATR ratchet
  category: trend_following
  skill: intermediate
name: trend_magic
weight: 1.0
long_only: false
indicators:
  tm:
    kind: trend_magic
    period: 20
    atr_period: 5
    coeff: 1.0
  low_:
    kind: sma
    period: 1
    source: low
  high_:
    kind: sma
    period: 1
    source: high
entry:
  combine: OR
  rules:
    - combine: AND
      direction: long
      rules:
        - {lhs: {indicator: low_}, op: crosses_up, rhs: {indicator: tm, field: trail}}
    - combine: AND
      direction: short
      rules:
        - {lhs: {indicator: high_}, op: crosses_down, rhs: {indicator: tm, field: trail}}
exit:
  combine: OR
  rules:
    - {lhs: {indicator: tm, field: state}, op: crosses_down, rhs: {value: 0}}
    - {lhs: {indicator: tm, field: state}, op: crosses_up, rhs: {value: 0}}
risk:
  trailing_stop_pct: 0.04
  cooldown_bars: 2

Indicadores

  • tmTrend Magic (period 20, ATR 5, coeff 1.0)

    Port of KivancOzbilgic's Pine v4 Trend Magic: an SMA-of-TR ATR band ratcheted by the CCI(20) regime — up while CCI ≥ 0, down while CCI < 0.

  • low_ / high_SMA(1) wick wrappers (low / high)

    One-bar SMAs over low and high so the wick-based crossing predicates have tracked previous values. The native bar.low / bar.high collapse prev = now and never fire crossings.

Condiciones de entrada

El bot abre una posición en la vela siguiente al cumplimiento de todas las condiciones de abajo.

  • Long when the bar's low wick crosses up through the Trend Magic trail line.
  • Short when the high wick crosses down through the trail line.

Condiciones de salida

Cualquiera de las condiciones siguientes cierra la posición.

  • CCI regime flip through zero closes the active position.
  • 4% trailing stop, 2-bar cooldown.

Comportamiento esperado

Selective entries — the wick-cross condition is strict, so trades fire only when momentum really pushes through. Strong in trending regimes, quiet during balanced ranges.

Es el carácter de la curva de equity, no una previsión de retorno. Los backtests no son promesas sobre el desempeño en vivo.

Pruébala con tus datos

Abre la plantilla en el panel para hacer backtest sobre BTC, ETH o cualquier símbolo CCXT — o copia el YAML en el Strategy Designer para editarlo primero.

El comportamiento pasado en backtests no garantiza el desempeño futuro. Los mercados cambian; los conjuntos de reglas necesitan revalidarse. Operas bajo tu propio riesgo.