Technical / Trending
DMIPlus(period, offset[, series])
Full Description

These functions implement the Directional Movement System developed by J. Welles Wilder Jr.. They are used to evaluate trend strength and trend direction, and to detect bullish or bearish momentum shifts via crossovers. They are commonly used in screening rules, ranking systems, and timing models to identify trending securities and directional breakouts.

ADX(period, offset [,series])

Returns the Average Directional Movement Index (ADX) as defined by Welles Wilder. ADX is commonly used to measure trend strength (not direction). The offset parameter can be used to compare current ADX to previous values to identify strengthening or weakening trends.

DMIPlus(period, offset [,series])

Returns the DMI+ component of Wilder’s Directional Movement System. DMI+ represents positive directional movement. Use offset to retrieve historical values.

DMIMinus(period, offset [,series])

Returns the DMI- component of Wilder’s Directional Movement System. DMI- represents negative directional movement. Use offset to retrieve historical values.

DMICrossOver(period, offset [,series])

Returns TRUE (or 1) if DMI+ crossed above DMI- within the previous offset bars. This is commonly interpreted as a shift toward positive directional dominance.

DMICrossUnder(period, offset [,series])

Returns TRUE (or 1) if DMI- crossed above DMI+ within the previous offset bars. This is commonly interpreted as a shift toward negative directional dominance.

Examples

1) Screen for stocks whose ADX increased over the past 10 bars

Compare the current ADX value to the ADX value from 10 bars ago:

ADX(14,0) > ADX(14,10)

2) Find stocks whose DMI+ crossed over DMI- within the last 2 bars

Use the crossover function with an offset window of 2 bars:

DMICrossOver(14,2)=TRUE

3) Find stocks with strong positive directional movement

Compare DMI+ to DMI- on the current bar:

DMIPlus(14,0) > DMIMinus(14,0)

Notes

  • ADX measures trend strength; DMI+ and DMI- help indicate direction.
  • offset is useful for detecting changes over time (e.g., “today vs. 10 bars ago”) and for “within the last N bars” crossover logic.
  • Functions that return TRUE/1 can be used directly in screens and conditional logic.

Series Parameter

By default, technical functions access the time series of the instrument in context. You can specify a different time-series in several ways like: using GetSeries(), specifying a StockID directly, or using a time series id. See the examples below.

Examples

Get the latest close price using Close(0, series) using different methods for different time series.

Using the ID directly
Using the StockID for SPY:USA* Close(0, 24262)
For the Industry series of the stock being evaluated Close(0,#Industry)
Using a Time Series Id Close(0,$RUI)
For the benchmark Close(0, #Bench)
Using GetSeries
Using a fully qualified ticker Close(0, GetSeries("SPY:USA"))
When USA is your default Close(0, GetSeries("SPY"))
 
See GetSeries() for more examples like for aggregate series
* StockIDs never change

 

Predefined Series IDs

These are special series ids. Additional Series Ids can be found in the reference under: MISC→TIME SERIES IDs

Id Description Freq OHLC
Industry and Sector
#Sector Stock's Sector Daily C
#SubSector Stock's SubSector Daily C
#Industry Stock's Industry Daily C
#SubIndustry Stock's SubIndustry Daily C
Miscellaneous
#Bench Benchmark closing prices Daily C
#TNX 10Y Treasury Note Daily OHLC
FED Model series (chart)
#SPRP SP500 Risk Premium Weekly C
#SPEPSCY SP500 EPS CurrentY Weekly C
#SPEPSNY SP500 EPS NextY Weekly C
#SPEPSCNY SP500 EPS Blend Y Weekly C
#SPEPSQ SP500 EPS Blend Q Weekly C
#SPEPSTTM SP500 EPS Trailing 12 months Weekly C
#SPYield SP500 Yield Weekly C

 

Special Series Ids for Moving Averages & Highest/Lowest functions

Id Description Context
#Open Open prices Stock & ETF
#High High prices Stock & ETF
#Low Low prices Stock & ETF
#Vol Volumes Stock & ETF