Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Not Plotting yet data is correct in data box

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

    Not Plotting yet data is correct in data box

    The data box is showing the correct values at the correct bars for my indicator however the AddPlot is not printing the brush.

    The brush was printing 90% of the time until I added "Open[0] < VWMA1[0]" and now here are 0 brushes.

    Here is some code
    Code:
    protected override void OnStateChange()
    {
    if (State == State.SetDefaults)
    {
    Description = @"Enter the description for your new custom Indicator here.";
    Name = "DailyBuyZone";
    Calculate = Calculate.OnBarClose;
    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;
    AddPlot(Brushes.Lime, "BZ1");
    AddPlot(Brushes.MediumSeaGreen, "BZ2");
    AddPlot(Brushes.Red, "BZ3");
    }
    else if (State == State.Configure)
    {
    AddDataSeries(BarsPeriodType.Day, 1);
    }
    
    protected override void OnBarUpdate()
    {
    if (CurrentBars[1]>0)
    {
    _BZ1 = 0;
    _BZ2 = 0;
    _BZ3 = 0;
    
    
    if (Close[0] > VWMA1[0] && Open[1] < VWMA1[1] && Open[0] < VWMA1[0] )
    
    continues with more code
    Any ideas why the brush no longer shows? Also why the brush only showed 90% of the time before I added the "Open[0] < VWMA1[0]"?

    Thanks

    #2
    Hello mlprice12,

    Are you making sure the plot is set on every bar?

    Is the plot set when Open[0] is less than VWMA1[0]?

    If there is a bar link missing, there will be no plot segments rendered between bars where there is no plot set.

    Use IsValidDataPoint() to confirm a value has been set.
    https://ninjatrader.com/support/help...ddatapoint.htm
    https://ninjatrader.com/support/foru...196#post820196
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Thanks Chelsea

      That was the problem. If the next bar has no data then the plot does not show for the previous bar.

      Is there a way to extend the plot an extra bar? Ex Bar 1 and Bar 2 have data but Bar 3 does not. Is there a way to make all 3 bars plot without changing the logic?

      Comment


        #4
        Hello mlprice12,

        Are you asking about the HigherTimeFrameIndicatorPlotExample_NT8 that demonstrates setting the current value to the previous bar's value that I have linked in post #2?

        Are you finding this example is inadequate?
        Chelsea B.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        647 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        368 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        108 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        571 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        573 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X