Jump to content

Welcome to the new Traders Laboratory! Please bear with us as we finish the migration over the next few days. If you find any issues, want to leave feedback, get in touch with us, or offer suggestions please post to the Support forum here.

lonew0lf

Members
  • Content Count

    52
  • Joined

  • Last visited

Posts posted by lonew0lf


  1. Can anyone assist, i'm trying to include the ability on this indicator to look back over a longer period of time rather than just the previous bar. Ideally, I want to be able to set the lookback period anywhere from 1- 500 bars in order to ascertain the trend of the ADX based on the resolution of the chart:

     

    {1.0 Inputs and Variables}

     

    {1.1. Declaration of Inputs}

    Inputs:

    ADXLenght (14),

    UpColor (cyan),

    DnColor (magenta),

    UnChngColor (white);

     

     

    {1.2. Declaration of Variables}

    variables:

    var0 (0),

    var1 (0),

    var2 (0),

    var3 (0),

    var4 (0),

    var5 (0);

     

    {2.0. Start Code}

     

    {2.1. Call ADX & DMI}

    Value1 = DirMovement(High, Low, Close, ADXLenght, var0, var1, var2, var3, var4, var5);

     

    {2.2. Check Slope and SetPlotColor}

     

    if var3 > var3[1] then

    SetPlotColor[1](3, UpColor)

    else

    if var3 < var3[1] then

    SetPlotColor[1](3, DnColor)

    else

    SetPlotColor[1](3, UnChngColor);

     

     

    {3.0. Plot Values}

    Plot1(var0, "DMI+");

    Plot2(var1, "DMI-");

    Plot3(var3, "ADX");

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.