Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Issue with Plots in Indicator

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

    Issue with Plots in Indicator

    Hi I am developing a indicator in NT8. I have issues with the Plots. The weird part is it starts working after certain number of bars say 15 or 20 but for the first 20 bars the plots dont work. I don't see what is the issue in my code. Here is the code and screen shots of the issue.

    In the attachment you can clearly see plot of arrow missing for the first 10 bars and then it start working.


    protected override void OnStateChange()
    {
    if (State == State.SetDefaults)
    {
    Description = @"Enter the description for your new custom Indicator here.";
    Name = "TestArrow";
    Calculate = Calculate.OnEachTick;
    IsOverlay = true;
    //DisplayInDataBox = true;
    DrawOnPricePanel = true;
    DrawHorizontalGridLines = true;
    DrawVerticalGridLines = true;
    PaintPriceMarkers = true;
    ScaleJustification = NinjaTrader.Gui.Chart.ScaleJustification.Right;
    //Disable this property if your indicator requires custom values that cumulate with each new market data event.
    //See Help Guide for additional information.
    IsSuspendedWhileInactive = true;
    ShowSeries1 = true;
    AddPlot(Brushes.Orange, "PlotSeries1");
    }
    else if (State == State.Configure)
    {
    }
    else if (State == State.DataLoaded)
    {
    Series1 = new Series<double>(this);
    }
    }
    }

    protected override void OnBarUpdate()
    {
    //Add your custom indicator logic here.
    if ( CurrentBar < 2) return;
    if ( High[0] > High[1] ) {
    Draw.Text(this,@"t1"+CurrentBar,"H",0,High[0]+8*TickSize,Plots[0].Brush);
    PlotSeries1[0]=High[0]+3*TickSize;
    }
    }
    Attached Files

    #2
    Hello supercool,

    This is likely the BarsRequiredToPlot, it defaults at 20 bars.



    I don't see that you have specifically set this in the code you provided, can you try setting this to 0 in your script and then remove it from the chart and re-add it?




    I look forward to being of further assistance.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    596 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    343 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    103 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    556 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    554 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X