Skip to content
All library documents

Heikin-Ashi EMA Crossover Strategy with an Optional MACD Filter

Article FMZ forum · Author: 今晚打老虎

Summary

The code describes a strategy that compares two exponential moving averages calculated from Heikin-Ashi prices on configurable timeframes. A crossover of the faster average above the slower average triggers a long entry; a cross below triggers a short entry. Inputs let the user adjust timeframes, shifts, and average periods.

An optional MACD filter can require the MACD line to be above its signal line for long entries and below it for short entries. The filter is disabled by default. The document contains strategy logic but no backtest results, transaction cost assumptions, position-sizing analysis, or evidence that the signals are profitable. It is posted as a request to adapt code for another platform, so the supplied script alone does not establish portability or reliable execution there.

Key ideas

  • The strategy enters long or short when Heikin-Ashi-based exponential moving averages cross.
  • The averages can use different configurable timeframes and shifts.
  • An optional MACD comparison filters entries in the direction of its line and signal relationship.
  • No testing evidence or risk controls are supplied, so profitability is unknown.

Tags

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