Page 1 of 3

Traders dynamic index [NG: upd, May, 05]

PostPosted: Sun Sep 05, 2010 10:34 pm
by Alexander.Gettinger
The indicator has been updated May, 05 2011. See viewtopic.php?f=17&t=2069&p=10346#p10346 for details.

The indicator has been developed for MT4 by Dean Malone in 2006

TrendDynamicIndex.png


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:
TradersDynamicIndex.lua
New version (May, 05 2011)
(2.44 KiB) Downloaded 6234 times

see viewtopic.php?f=17&t=2069&p=10346#p10346 for details about the update.
TradersDynamicIndex With Alert.lua
(18.75 KiB) Downloaded 1808 times


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

Re: Traders dynamic index - from mq4 new functions

PostPosted: Mon Oct 04, 2010 11:17 am
by forexjim
Hello,

Is it possible to get this version of the Traders Dynamic Index converted to Marketcope?

Re: Traders dynamic index

PostPosted: Mon Oct 04, 2010 1:09 pm
by forexjim
This may be easier.... there is an expanded version of the Traders Dynamic Index on the mql4 code base site that adds trade direction arrows and text prompts.

Can it be converted to LUA based programming for use with Marketscope?

Thanks,

Jim S.

Re: Traders dynamic index

PostPosted: Thu May 05, 2011 3:16 pm
by Nikolay.Gekht
May, 05 2011 update:

1) Calculation has been optimized
2) Lines are properly named and line width/style parameters has been added
3) All options, including the smoothing methods parameters has been added.
4) The original description of the indicator has been added.


Please see the top post (viewtopic.php?f=17&t=2069#p4235) for details.

Re: Traders dynamic index [NG: upd, May, 05]

PostPosted: Thu May 05, 2011 7:42 pm
by Blackcat2
Cool, backtesting looks good. If we can get arrow on the chart for buy, sell, and exit signal it'll be even better :)

Thanks...
BC

Re: Traders dynamic index [NG: upd, May, 05]

PostPosted: Fri May 06, 2011 10:19 am
by Nikolay.Gekht
I'm going to publish the interpreting indicator (as requested above) and a strategy soon.

Re: Traders dynamic index [NG: upd, May, 05]

PostPosted: Fri May 06, 2011 2:12 pm
by Nikolay.Gekht

Re: Traders dynamic index [NG: upd, May, 05]

PostPosted: Tue May 10, 2011 12:43 am
by Blackcat2
System that uses this indicator
http://www.forexfactory.com/showthread.php?t=291622

I'm currently testing this system..

Cheers..
BC

Re: Traders dynamic index [NG: upd, May, 05]

PostPosted: Sun Apr 05, 2015 2:40 pm
by BabyDragonFX
Very good indicator! One of the best I have seen yet! Thank you for this!

Re: Traders dynamic index [NG: upd, May, 05]

PostPosted: Sun Nov 15, 2015 7:29 pm
by hhbraz
Hello,
The current TDI indicator in non-functional with the last TS (ver 1.14)
Importing indicator will not load and results in the following error messages.
Error: parameter with the specified id already exists
Error: attempt to index global 'indicator' (a nil value)
Please advise if the code can be updated.
Thanks