This script is based off the public DMI code and used to get a quick visual of trend and direction across 3 different timeframes. Alert conditions have been setup for trend changes to bull/bear for all 3 timeframes. This script is meant to pull together the concepts of multi-time frame indicators, custom functions, and custom alert conditions.
The primary instructions for this script was to find a version of the ADX Indicator and give it the same treatment as we did with the Heiken Ashi demo (displaying green/red/gray circles to indicate trend and direction) over a configurable time frame. Display a matrix of each timeframe and the corresponding directional color (green=bull, red=bear, gray=non-trending). Have it produce an alert when the state of indicator changes to either bull or bear.