ADX indicator

Discussion in 'App Development' started by Xraptor, Jun 18, 2015.

  1. Xraptor

    Xraptor

    Hi, all!

    Someone know how at WLD 4 calculated an indicator ADX?

    I used a formula as described in the manual WLD4:

    I realised the formula on C#, but result is different than make a code on WLD4, but again I see the different

    Example on WLD4:

    Code:
    function MyDXPluse(Period: integer): integer;
    begin
    
    var BarSys,pDM,mDM,pDMA,mDMA,ATRA,R: integer;
    
    var dHigh,dLow: float;
    
    pDM := CreateSeries();
    mDM := CreateSeries();
    
    mDMA := CreateSeries();
    pDMA := CreateSeries();
    
    Result:= CreateSeries();
    R:= CreateSeries();
    
    for BarSys := Period to BarCount - 1 do
    begin
    
       dHigh := @#High[BarSys] - @#High[BarSys-1];
       dLow := @#Low[BarSys-1] - @#Low[BarSys];
    
    
      if ((dHigh < 0) and (dLow < 0)) or (dHigh=dLow) then begin
          SetSeriesValue( BarSys,pDM,0);
          SetSeriesValue( BarSys,mDM,0);
       end;
       if (dHigh > dLow) then begin
          SetSeriesValue( BarSys, pDM,dHigh);
          SetSeriesValue( BarSys, mDM, 0);
       end;
    
       if (dHigh < dLow) then begin
          SetSeriesValue( BarSys, pDM,0);
          SetSeriesValue( BarSys, mDM,dLow);
       end;
      
    end; //for
    
    {
    pDMA:= WilderMASeries(pDM,Period);
    mDMA:= WilderMASeries(mDM,Period);
    
    ATRA := ATRSeries(Period);
    }
    
    ATRA := TrueRangeSeries();
    
    for BarSys := Period to BarCount() - 1 do begin
    SetSeriesValue( BarSys, R,  Round( 100 * (@pDM[BarSys] / @ATRA[BarSys])));
    end; //for
    
    Result :=  WilderMASeries(R,Period);
    
    end;  //function
    //--------------------------------------------------------------------------------
    
    var x : integer = MyDXPluse(7);
    
    
    var xPane: integer =  CreatePane( 75, true, true );
    PlotSeriesLabel( x, xPane, 009, #Thick, 'MyDXPluse Plot' );
    Please write to me how is correct do calculate the formula ADX using at WLD4, I long sought information about it, but I found nothing!
     
  2. Xraptor

    Xraptor

    A screenshot different the ADX indicator at WLD4 and The ADX made by the formula

    [​IMG]