Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Need help with multiple plots displacement in one indicator

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Need help with multiple plots displacement in one indicator

    I am programming an indicator that uses three plots, and each of them has different displacement(offset) parameters.

    My code is as follows

    Add(new Plot(Color.FromKnownColor(KnownColor.Red), PlotStyle.Line, "Plot0"));
    Displacement = var1;
    Plots[0].Pen.Width = 2;
    Add(new Plot(Color.FromKnownColor(KnownColor.Green), PlotStyle.Line, "Plot1"));
    Displacement = var2;
    Plots[1].Pen.Width = 2;
    Add(new Plot(Color.FromKnownColor(KnownColor.Blue), PlotStyle.Line, "Plot2"));
    Displacement = var3;
    Plots[2].Pen.Width = 2;

    Displacement values for the third plot is greater than the other two plots. When I plot the indicator, it is using the highest value of displacement for the other two as well.

    Also from some previous threads on this forum I have read about offsetting indicator values by price (link is below)
    http://www.ninjatrader.com/support/f...ad.php?t=40838

    I will appreciate your help
    Thanks

    #2
    sherazwaqar, welcome to our forums here. Displacement is done on a per indicator and not per plot basis.
    You could either use different indicators or offset the dataseries value being plotted as outlined in the thread, for example don't plot the current value now, but the value from 2 bars back.

    Plot0.Set(myValue[2])

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    576 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    334 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    101 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    553 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    551 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X