ADX in EasyLanguage — TradeStation & MultiCharts

The built-in ADX, DMIPlus and DMIMinus functions

ADX in EasyLanguage
ADX in EasyLanguage

EasyLanguage ships the whole directional system as reserved words, which is a relief given how many steps the ADX has (see the explainer). Here’s the study and an ADX-filtered strategy.

What you’ll need

  • TradeStation or MultiCharts
  • The EasyLanguage / PowerLanguage Editor, new Indicator

The source

{ AlgoGen ADX — TradeStation / MultiCharts }
inputs:
    Length( 14 ),
    TrendLevel( 25 );

variables:
    ADXval( 0 ), PlusDI( 0 ), MinusDI( 0 );

ADXval  = ADX( Length );
PlusDI  = DMIPlus( Length );
MinusDI = DMIMinus( Length );

Plot1( ADXval,  "ADX" );
Plot2( PlusDI,  "+DI" );
Plot3( MinusDI, "−DI" );
Plot4( TrendLevel, "Trend" );

ADX( Length ) gives the trend-strength line, and DMIPlus/DMIMinus give the directional lines — the three series in the output chart. (Some EasyLanguage versions also expose DMI and ADXR.)

An ADX-filtered strategy

The most valuable use is filtering, not raw DI crosses:

{ AlgoGen ADX Trend Filter — Strategy }
inputs: Length( 14 ), TrendLevel( 25 );
variables: ADXval( 0 ), PlusDI( 0 ), MinusDI( 0 );

ADXval  = ADX( Length );
PlusDI  = DMIPlus( Length );
MinusDI = DMIMinus( Length );

{ Only act on a DI cross when a trend actually exists }
if ADXval > TrendLevel then begin
    if PlusDI crosses over MinusDI then Buy next bar at market;
    if MinusDI crosses over PlusDI then SellShort next bar at market;
end;

The Strategy Performance Report will show whether gating DI crosses on ADX > TrendLevel beats trading every cross.

ADXR and RadarScreen

For ranking a watchlist by trend strength, ADXR( Length ) — Wilder’s smoothed rating — makes a steadier column than raw ADX in RadarScreen or the scanner:

Plot5( ADXR( Length ), "ADXR" );

Sort a RadarScreen by ADXR to surface the markets with the most established trends, then apply your directional logic only to those — a direct nod to how Wilder intended the Directional Movement System to be used for market selection, not just timing.

Gotchas

  • Reserved-word availability. ADX, DMIPlus, and DMIMinus are standard, but older or third-party EasyLanguage dialects vary — check your platform’s function list if one won’t verify.
  • Lag. ADX is double-smoothed and late; use it to confirm the environment, not to time entries precisely.
  • Direction vs strength. ADX is strength only; you must read DMIPlus versus DMIMinus to know which way.

Same indicator elsewhere: Python, MQL5, Pine Script, NinjaScript. Then backtest an ADX filter in AlgoGen.


This post is educational, not financial advice. Indicators describe the past; they don’t predict the future. Backtest anything before you risk real money on it.

Sources and further reading

  1. What is EasyLanguage? (TradeStation)

Historical research from the Algogen archive. Not investment advice.

Blog

Have a strategy idea?

Describe it in plain English, preview where your rules fire, then decide whether the evidence is worth a backtest.

Keep me postedHow it works