Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Why I don't get any plot with my indicartor

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

    Why I don't get any plot with my indicartor

    Hi,

    I am trying to develop my own indcator (my first one), but I don't get any plot. It is so easy, I just want to calculate the value between Close[0] minus Close[10] like this:

    protected override void Initialize()
    {
    Add(new Plot(Color.FromKnownColor(KnownColor.Orange), PlotStyle.Line, "Plot0"));
    Overlay = false;
    }


    protected override void OnBarUpdate()
    {
    Plot0.Set(Close[0]-Close[10]);

    Thank you very much,
    Carlos

    #2
    Hello CarlosTTW,

    Thank you for writing in.

    You'll want to check that you have enough bars before attempting to access Close[10]. You'll run into a run-time error if you try to access a non-existent Close value.

    More information about how to do this can be found on our support forum at this link: http://ninjatrader.com/support/forum...ead.php?t=3170

    Please, let us know if we may be of further assistance.
    Zachary G.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by CarlTrading, 03-31-2026, 09:41 PM
    1 response
    131 views
    1 like
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    74 views
    1 like
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    117 views
    2 likes
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    111 views
    1 like
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    89 views
    0 likes
    Last Post CarlTrading  
    Working...
    X