Skip to content
All library documents

Configurable Moving Average Strategy with Heikin-Ashi Support

Article Strategy library · Author: shawnteoh

Summary

This Pine Script strategy provides configurable moving average calculations and directional backtesting controls. It allows the user to select long, short, or both directions, restrict the test to a date range, choose among several moving average types, and set multiple lengths and display toggles. The defaults enable the second and third averages, with lengths of 13 and 21.

The script also retrieves Heikin-Ashi OHLC series and includes logic to select Heikin-Ashi or standard price inputs, although its `ha` setting is fixed to false in the supplied excerpt. The code shown ends partway through a Gaussian filter function, before any completed entry or exit rules appear. It therefore describes indicator configuration and smoothing options, not a fully documented trading method. No performance results or evaluation evidence are provided, and the excerpt is insufficient to assess trade behavior or profitability.

Key ideas

  • The strategy can be configured for long trades, short trades, or both.
  • A date window limits the bars included in backtests.
  • The script offers many moving average and smoothing variants with adjustable lengths.
  • Heikin-Ashi price data is available, but the shown configuration selects standard prices.
  • The supplied code ends before any trading signals or performance evidence are shown.

Tags

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