The indicator has been developed for MT4 by Dean Malone in 2006
Here is the original description of the indicator:
Dean Malone wrote:Traders Dynamic Index
This hybrid indicator is developed to assist traders in their ability to decipher and monitor market conditions related to trend direction, market strength, and market volatility.
Even though comprehensive, the T.D.I. is easy to read and use.
Green line = RSI Price line
Red line = Trade Signal line
Blue lines = Volatility Band
Yellow line = Market Base Line
Trend Direction - Immediate and Overall
Immediate = Green over Red...price action is moving up. Red over Green...price action is moving down.
Overall = Yellow line trends up and down generally between the lines 32 & 68. Watch for Yellow line to bounces off these lines for market reversal. Trade long when price is above the Yellow line, and trade short when price is below.
Market Strength & Volatility - Immediate and Overall
Immediate:
Green Line is Strong = Steep slope up or down.
Green Line is Weak = Moderate to Flat slope.
Overall:
Blue Lines - When expanding, market is strong and trending. When constricting, market is weak and in a range. When the Blue lines are extremely tight in a narrow range, expect an economic announcement or other market condition to spike the market.
Entry conditions
Scalping:
Long = Green over Red, Short = Red over Green
Active:
Long = Green over Red & Yellow lines
Short = Red over Green & Yellow lines
Moderate:
Long = Green over Red, Yellow, & 50 lines
Short = Red over Green, Green below Yellow & 50 line
Exit conditions*
Long = Green crosses below Red
Short = Green crosses above Red
* If Green crosses either Blue lines, consider exiting when the Green line crosses back over the Blue line.
IMPORTANT: The default settings are well tested and proven. But, you can change the settings to fit your trading style.
Note: Please read the post about the strategy based on that index. The default settings has been tested there, so you can decide whether they are good enough for you:
See viewtopic.php?f=31&t=4134
Download:
see viewtopic.php?f=17&t=2069&p=10346#p10346 for details about the update.
Compatibility issue Fix. _Alert helper is not longer needed.
See also: Traders dynamic index interpreter indicator, Traders dynamic index demo strategy
- Code: Select all
-- original indicator:
-- Traders Dynamic Index.mq4
-- Copyright © 2006, Dean Malone
-- www.compassfx.com
function Init()
indicator:name("Traders Dynamic Index Indicator");
indicator:description("This hybrid indicator is developed to assist traders in their ability to decipher and monitor market conditions related to trend direction, market strength, and market volatility.");
indicator:requiredSource(core.Tick);
indicator:type(core.Oscillator);
indicator.parameters:addGroup("Calculation");
indicator.parameters:addInteger("RSI_N", "RSI Periods", "Recommended values are in 8-25 range", 13, 2, 1000);
indicator.parameters:addInteger("VB_N", "Volatility Band", "Number of periods to find volatility band. Recommended value is 20-40", 34, 2, 1000);
indicator.parameters:addDouble("VB_W", "Volatility Band Width", "", 1.6185, 0, 100);
indicator.parameters:addInteger("RSI_P_N", "RSI Price Line Periods", "", 2, 1, 1000);
indicator.parameters:addString("RSI_P_M", "RSI Price Line Smoothing Method", "", "MVA");
indicator.parameters:addStringAlternative("RSI_P_M", "MVA(SMA)", "", "MVA");
indicator.parameters:addStringAlternative("RSI_P_M", "EMA", "", "EMA");
indicator.parameters:addStringAlternative("RSI_P_M", "LWMA", "", "LWMA");
indicator.parameters:addStringAlternative("RSI_P_M", "LSMA(Regression)", "", "REGRESSION");
indicator.parameters:addStringAlternative("RSI_P_M", "SMMA", "", "SMMA");
indicator.parameters:addStringAlternative("RSI_P_M", "WMA(Wilders)", "", "WMA");
indicator.parameters:addStringAlternative("RSI_P_M", "KAMA(Kaufman)", "", "KAMA");
indicator.parameters:addInteger("TS_N", "Trade Signal Line Periods", "", 7, 1, 1000);
indicator.parameters:addString("TS_M", "Trade Signal Line Smoothing Method", "", "MVA");
indicator.parameters:addStringAlternative("TS_M", "MVA(SMA)", "", "MVA");
indicator.parameters:addStringAlternative("TS_M", "EMA", "", "EMA");
indicator.parameters:addStringAlternative("TS_M", "LWMA", "", "LWMA");
indicator.parameters:addStringAlternative("TS_M", "LSMA(Regression)", "", "REGRESSION");
indicator.parameters:addStringAlternative("TS_M", "SMMA", "", "SMMA");
indicator.parameters:addStringAlternative("TS_M", "WMA(Wilders)", "", "WMA");
indicator.parameters:addStringAlternative("TS_M", "KAMA(Kaufman)", "", "KAMA");
local colors = core.colors();
indicator.parameters:addGroup("Line Style");
indicator.parameters:addColor("RSI_P_C", "RSI Price Line Color", "", colors.Green);
indicator.parameters:addInteger("RSI_P_W", "RSI Price Line Width", "", 2, 1, 5);
indicator.parameters:addInteger("RSI_P_S", "RSI Price Line Style", "", core.LINE_SOLID);
indicator.parameters:setFlag("RSI_P_S", core.FLAG_LEVEL_STYLE);
indicator.parameters:addColor("TS_C", "Trade Signal Line Color", "", colors.Red);
indicator.parameters:addInteger("TS_W", "Trade Signal Line Width", "", 2, 1, 5);
indicator.parameters:addInteger("TS_S", "Trade Signal Line Style", "", core.LINE_SOLID);
indicator.parameters:setFlag("TS_S", core.FLAG_LEVEL_STYLE);
indicator.parameters:addColor("VB_C", "Volatility Band Line Color", "", colors.Blue);
indicator.parameters:addInteger("VB_W", "Volatility Band Line Width", "", 1, 1, 5);
indicator.parameters:addInteger("VB_S", "Volatility Band Line Style", "", core.LINE_SOLID);
indicator.parameters:setFlag("VB_S", core.FLAG_LEVEL_STYLE);
indicator.parameters:addColor("MB_C", "Market Base Line Color", "", colors.SandyBrown);
indicator.parameters:addInteger("MB_W", "Market Base Line Width", "", 2, 1, 5);
indicator.parameters:addInteger("MB_S", "Market Base Line Style", "", core.LINE_SOLID);
indicator.parameters:setFlag("MB_S", core.FLAG_LEVEL_STYLE);
indicator.parameters:addGroup("Levels");
indicator.parameters:addInteger("L1", "Low Level", "", 32, 0, 100);
indicator.parameters:addInteger("L2", "Middle Level", "", 50, 0, 100);
indicator.parameters:addInteger("L3", "High Level", "", 68, 0, 100);
indicator.parameters:addColor("L_C", "Level Line Color", "", core.COLOR_CUSTOMLEVEL);
indicator.parameters:addInteger("L_W", "Market Base Line Width", "", 1, 1, 5);
indicator.parameters:addInteger("L_S", "Market Base Line Style", "", core.LINE_DOT);
indicator.parameters:setFlag("L_S", core.FLAG_LEVEL_STYLE);
end
local iRSI, iPMA, iTSMA;
local P, VBU, VBD, TS, MB;
local VB_N, VB_W, L1, L2, L3;
local fP, fVB, fTS;
function Prepare(onlyName)
local name = profile:id() .. "(" .. instance.source:name() .. "," ..
instance.parameters.RSI_N .. "," ..
instance.parameters.VB_N .. "," .. instance.parameters.VB_W .. "," ..
instance.parameters.RSI_P_N .. "," .. instance.parameters.RSI_P_M .. "," ..
instance.parameters.TS_N .. "," .. instance.parameters.TS_M .. ")";
instance:name(name);
if onlyName then
return ;
end
VB_N = instance.parameters.VB_N;
VB_W = instance.parameters.VB_W;
L1 = instance.parameters.L1;
L2 = instance.parameters.L2;
L3 = instance.parameters.L3;
iRSI = core.indicators:create("RSI", instance.source, instance.parameters.RSI_N);
iPMA = core.indicators:create(instance.parameters.RSI_P_M, iRSI.DATA, instance.parameters.RSI_P_N);
fP = iPMA.DATA:first();
iTSMA = core.indicators:create(instance.parameters.TS_M, iRSI.DATA, instance.parameters.TS_N);
fTS = iTSMA.DATA:first();
fVB = iRSI.DATA:first() + instance.parameters.VB_N - 1;
P = instance:addStream("RSI_P", core.Line, name .. ".RSI_P", "PriceLine", instance.parameters.RSI_P_C, fP);
P:setWidth(instance.parameters.RSI_P_W);
P:setStyle(instance.parameters.RSI_P_S);
P:addLevel(L1, instance.parameters.L_S, instance.parameters.L_W, instance.parameters.L_C);
P:addLevel(L2, instance.parameters.L_S, instance.parameters.L_W, instance.parameters.L_C);
P:addLevel(L3, instance.parameters.L_S, instance.parameters.L_W, instance.parameters.L_C);
VBU = instance:addStream("VBU", core.Line, name .. ".VBU", "VolBandUp", instance.parameters.VB_C, fVB);
VBU:setWidth(instance.parameters.VB_W);
VBU:setStyle(instance.parameters.VB_S);
VBD = instance:addStream("VBD", core.Line, name .. ".VBD", "VolBandDn", instance.parameters.VB_C, fVB);
VBD:setWidth(instance.parameters.VB_W);
VBD:setStyle(instance.parameters.VB_S);
MB = instance:addStream("MB", core.Line, name .. ".MB", "MktBase", instance.parameters.MB_C, fVB);
MB:setWidth(instance.parameters.MB_W);
MB:setStyle(instance.parameters.MB_S);
TS = instance:addStream("TS", core.Line, name .. ".TS", "TrdSig", instance.parameters.TS_C, fTS);
TS:setWidth(instance.parameters.TS_W);
TS:setStyle(instance.parameters.TS_S);
end
function Update(period, mode)
iRSI:update(mode);
iPMA:update(mode);
iTSMA:update(mode);
if period >= fP then
P[period] = iPMA.DATA[period];
end
if period >= fTS then
TS[period] = iTSMA.DATA[period];
end
if period >= fVB then
local stdev, ma;
stdev = core.stdev(iRSI.DATA, period - VB_N + 1, period);
ma = core.avg(iRSI.DATA, period - VB_N + 1, period);
VBU[period] = ma + VB_W * stdev;
VBD[period] = ma - VB_W * stdev;
MB[period] = ma;
end
end