TradingCharts
StrategyOpen sourcev1

AlphaTrend Strategy

What it does

A trend-following strategy built on AlphaTrend, a line that follows an ATR-based band and switches between support and resistance depending on money flow (MFI). It goes long when AlphaTrend crosses above its own line from two bars back and short when it crosses below, and each flip closes the opposite trade.

How to use: add it to a chart and open Backtest. Inputs are the ATR multiplier (1.0), the common period (14) used for both ATR and MFI, a switch to allow or block shorts, and an optional intraday square-off time for intraday testing. A higher multiplier gives a wider, slower line with fewer trades. It suits trending stocks and indexes and can whipsaw in sideways markets.

How to use it

  • Open the charts and go to Indicators › My scripts › Shared with me (or search the Community library) and press Add to chart.
  • Open it in the ChartScript Editor to read the code; Create a copy makes your own editable version.

Version history

  • v1 — 24 Nov, 08:20 am · compiler 0.3.69

#alphatrend#atr#mfi#trend-following#long-short