Skip to content
All library documents

SMA Slope and ADX Trend-Following Strategy with Session Controls

Article TradingView scripts

Summary

This strategy template uses the direction of a short-period simple moving average (SMA) as its entry signal and ADX as a filter for trend strength. A longer SMA’s slope can restrict long entries to rising trends and short entries to falling trends. Users can choose trade direction and set a trading session; the script closes open positions when that session ends.

Entries are signaled at a bar’s close and are intended to execute at the next bar’s open. Position exits use a configurable stop loss, an optional profit target, and closure when the signal SMA reverses. The source describes the system as intended for the VN30F1M futures contract, but provides no performance results, testing details, or evidence that its default settings are profitable. Its session logic also depends on chart time settings, and the script’s fixed-point exits may need adjustment for the instrument and timeframe.

Key ideas

  • The signal SMA’s rising or falling slope determines the raw long or short direction.
  • ADX must exceed a threshold before the strategy accepts a signal.
  • A longer SMA slope can filter trades to match the broader trend.
  • Session limits, SMA reversals, stop losses, and optional profit targets govern trade exits.
  • The document provides a strategy implementation but no backtest evidence or performance claims.

Tags

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