Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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])
    BertrandNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by 1001111, Today, 09:45 AM
    2 responses
    19 views
    0 likes
    Last Post 1001111
    by 1001111
     
    Started by cre8able, Today, 04:31 PM
    0 responses
    4 views
    0 likes
    Last Post cre8able  
    Started by leojimenezp, Today, 04:04 PM
    0 responses
    4 views
    0 likes
    Last Post leojimenezp  
    Started by NM_eFe, Today, 06:14 AM
    2 responses
    12 views
    0 likes
    Last Post NM_eFe
    by NM_eFe
     
    Started by realblubb, 04-28-2024, 09:28 AM
    1 response
    19 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Working...
    X