DMI/ADX consistently works

Discussion in 'Technical Analysis' started by nyc-hotshot, Aug 22, 2003.

  1. saico

    saico


    Yes, It's not to bad! Would be great, if you'd provide your results.

    Saico
     
    #251     Oct 7, 2003
  2. ram

    ram

    Anybody know if DX is available on Tradestation?
     
    #252     Oct 8, 2003
  3. WarEagle

    WarEagle Moderator

    None of my built in indicators plotted the DMI (DX), but it is built in as a function. The DMI indicator that comes with 2000i plots the DM lines and the ADX, but not the DX. You can easily modify this by changing the code in the PowerEditor.

    Just add:

    Plot4(DMI(Length), "DX");

    to the standard DMI and it will plot the DX along with the DM lines and the ADX. If you want to get rid of the ADX altogether, just replace

    Plot3(ADX(Length), "ADX");

    with

    Plot3(DMI(Length), "DX");

    I don't use TS7, but I would imagine that you can do the same thing for it as well.
     
    #253     Oct 8, 2003
  4. ram

    ram

    Thanks, WarEagle.
     
    #254     Oct 8, 2003
  5. hayman

    hayman

    OK guys,

    Going to open up this thread again. This thread was intriguing, and I tried it implement what I think are NYC's rules in Wealth Lab. This implementation only yields about a 25% return. Anyone care to comment on this code below ? (SORRY BUT I CANNOT GET INDENTING TO WORK PROPERLY, SO READABILITY IS A LITTLE UGLY !)

    var Bar: integer;
    var DX_Val, ADX_Val, PDI_Val, MDI_Val: float;
    var DX_Val_Last, ADX_Val_Last, PDI_Val_Last, MDI_Val_Last: float;
    var tmp: string;

    for Bar := 15 to BarCount - 1 do
    begin
    PortfolioSynch(Bar, '');

    DX_Val_Last := DX(Bar-1,15);
    DX_Val := DX(Bar,15);
    ADX_Val_Last := ADX(Bar-1,15);
    ADX_Val := ADX(Bar,15);
    PDI_Val_Last := DIPlus(Bar-1,15);
    PDI_Val := DIPlus(Bar,15);
    MDI_Val_Last := DIMinus(Bar-1,15);
    MDI_Val := DIMinus(Bar,15);

    if not LastPositionActive then
    begin
    If ((ADX_Val_Last < PDI_Val_Last) and (ADX_Val > PDI_VAL)) or
    ((ADX_Val_Last < MDI_Val_Last) and (ADX_Val > MDI_Val)) then
    begin
    If ((ADX_Val > PDI_Val) and (PDI_Val > MDI_Val)) then
    begin
    tmp := 'BUY- ADX:' + floattostr(ADX_Val) + ' PDI:' + floattostr(PDI_Val) + ' MDI:' + floattostr(MDI_Val);
    BuyAtMarket(Bar+1, tmp);
    end
    else
    If ((ADX_Val > MDI_Val) and (MDI_Val > PDI_Val)) then
    begin
    tmp := 'SHORT- ADX:' + floattostr(ADX_Val) + ' PDI:' + floattostr(PDI_Val) + ' MDI:' + floattostr(MDI_Val);
    ShortAtMarket(Bar+1, tmp);
    end;
    end;
    end
    else
    begin
    if PositionLong(LastPosition) then
    begin
    If MDI_Val > PDI_Val then
    begin
    tmp := 'SELL- ADX:' + floattostr(ADX_Val) + ' PDI:' + floattostr(PDI_Val) + ' MDI:' + floattostr(MDI_Val);
    SellAtMarket(Bar+1, Lastposition, tmp);
    end;
    end
    else
    if PositionShort(LastPosition) then
    begin
    If PDI_Val > MDI_Val then
    begin
    tmp := 'COVER- ADX:' + floattostr(ADX_Val) + ' PDI:' + floattostr(PDI_Val) + ' MDI:' + floattostr(MDI_Val);
    CoverAtMarket(Bar+1, LastPosition, tmp);
    end;
    end;
    end;
    end;

    Regards,

    Doug
     
    #255     Feb 22, 2004
  6. hayman

    hayman

    Problem: DX, ADX, PID & MDI values yield differences across platforms

    As a corollary to the last post above, I am comparing 1 minute values garnered by the aformentioned WealthScript functions and the corresponding values yielded by RealTick Charting, and I am coming up with major discrepancies.

    My 1 min RealTick datasource is being stamped at "end of time interval". In both RealTick and WealthLab, I am looking at 1 minute Intraday studies, with P=15. In Realtick, I chose the table chart option to give me the minute values below.

    The discrepancies are pretty universal. Let me cite an example from Friday, 2/20/2004, for the last 5 minutes of the trading day for ticker symbol EP:


    WL -> Tm:1556 DX: 4 ADX: 43.48 DI+: 13 DI-: 12
    RT -> Tm:1556 DX: 25.49 ADX: 34.13 PDI: 18.60 MDI: 11.05

    WL -> Tm:1557 DX: 8 ADX: 41.11 DI+: 13 DI-: 11
    RT -> Tm:1557 DX: 25.49 ADX: 33.05 PDI: 17.03 MDI: 10.11

    WL -> Tm:1558 DX: 25 ADX: 40.04 DI+: 17 DI-: 10
    RT -> Tm:1558 DX: 45.01 ADX: 34.55 PDI: 24.33 MDI: 9.22

    WL -> Tm:1559 DX: 45 ADX: 40.37 DI+: 24 DI-: 9
    RT -> Tm:1559 DX: 65.61 ADX: 38.43 PDI: 34.13 MDI: 7.09

    WL -> Tm:1600 DX: 44 ADX: 40.61 DI+: 21 DI-: 8
    RT -> Tm:1600 DX: 65.61 ADX: 41.83 PDI: 31.37 MDI: 6.51

    Note that I am using WL functions DX, ADX, DIPlus, and DIMinus. The analogous Realtick studies that I'm using are: Directional Movement, Average Directional Movement, Plus DIrectional Indicator, and Minus Directional Indicator.

    My WL calls are as follows:

    DX_Val := DX(Bar,15);
    ADX_Val := ADX(Bar,15);
    PDI_Val := DIPlus(Bar,15);
    MDI_Val := DIMinus(Bar,15);


    Why are these 2 platforms yielding such drastic differences ? It appears that it is in the way the 2 platforms calculate the formulas. Can anyone check these values out for the timestamps above, on other platforms, to see which is right or closer ?

    Thanks in advance !
     
    #256     Feb 22, 2004
  7. However if the ADX moves up with 4 steps while below the MDI and the PDI (PDI must be above MDI) then your trend is established or re-established and provides an excellent entry point. But I use a 22 period and as a 30 period daily...as I hold longer...

    Michael B.


     
    #257     Feb 23, 2004
  8. chs245

    chs245

    #258     Feb 23, 2004
  9. I actually find that ADX/PDI/MDI works best for me with daily bars and overnight holds with good ranked stocks. The sentiment is better reflected in a daily bar...and wild volatile instruments and fast intraday movements do not get filtered correctly with this directional indicator.....Also if your already in...and the ADX is between the PDI and the MDI and the ADX starts to slope down...you do not need to exit and chop out....just wait and exit when the MDI goes below the PDI....

    But this is with daily...I do not know how to use this indicator intraday...Perhaps that is why intraday traders only use the extreme readings this indicator presents.

    Michael B.


     
    #259     Feb 23, 2004
  10. I have not read this entire thread yet....


    But http://www.prophet.net has this complete version of this indicator...also...(free for daily)

    Michael B.
     
    #260     Feb 23, 2004