Skip to main content
Any Framework

MACD + DMI Strategy (Python)

Published
Aug 7, 2025
1y ago
Total Downloads
731
731

Install

dotnet add package StockSharp.Strategies.0432_Macd_Dmi.py --version 5.0.0

No framework information available.

README

MACD + DMI Strategy (Python Version)

Combines the Moving Average Convergence Divergence with the Directional Movement Index to trade only when trend strength is confirmed. The system waits for a MACD crossover and checks that the dominant directional line exceeds the opposite line while the ADX is above a key level.

The strategy is designed for both long and short positions. By pairing momentum and trend filters, it aims to avoid whipsaws in sideways markets. Protective stops based on volatility keep risk contained.

Details

  • Entry Criteria:
    • Long: MACD line crosses above signal, +DI > -DI, and ADX above the key level.
    • Short: MACD line crosses below signal, -DI > +DI, and ADX above the key level.
  • Exit Criteria:
    • Reverse signal or volatility stop hit.
  • Indicators:
    • MACD (fast 12, slow 26, signal 9)
    • Directional Movement Index (length 14, ADX smoothing 14)
  • Stops: Uses built-in stop-loss and take-profit via StartProtection.
  • Default Values:
    • Ma1Length = 10
    • Ma2Length = 20
    • DmiLength = 14
    • AdxSmoothing = 14
    • KeyLevel = 20
  • Filters:
    • Trend following
    • Works on multiple timeframes
    • Indicators: MACD, DMI
    • Stops: Yes
    • Complexity: Moderate

Adoption Assessment

A verified publisher signal is available. Assess fit from the package's supported frameworks, license and dependency graph rather than popularity alone.

No SPDX license expression is published. Review the license text and your organisation's policy before redistribution.No target framework metadata is available. Confirm compatibility in a representative project before standardising on this package.

Related Guides & Workflows

Learn how to evaluate, integrate, or audit this package in your .NET project.