Skip to content
All library documents

MACD Crossovers with an SMA Trend Filter and Session Controls

Article TradingView scripts

Summary

This strategy uses MACD line crossings of its signal line to generate long and short entries, with an optional moving-average trend filter. The filter defines trend from whether the simple moving average is rising or falling, and the strategy can restrict trading to either direction or allow both. A configurable intraday time window limits entries and closes open positions when the session ends.

Risk controls use fixed point distances for stops and optional profit targets, and positions may also be closed when the moving-average direction flips. The script is labeled for VN30F1M and includes default MACD and SMA parameters, but the document supplies no backtest statistics or evidence of profitability. Its description inconsistently calls the method both mean reversion and trend following, while its crossover and trend-filter rules are more clearly described by the code. Outcomes depend on instrument, timeframe, session conventions, and execution assumptions.

Key ideas

  • Long and short entries are triggered by MACD crossing its signal line.
  • An optional SMA slope filter allows longs in rising conditions and shorts in falling conditions.
  • A configurable session window restricts entries and can force positions closed at its end.
  • Fixed point stops and optional profit targets are calculated from the average position price.
  • The document identifies VN30F1M as the focus but gives no empirical performance evidence.

Tags

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