Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Monthly Volumetric Data Series not starting on the 1st Trading day of the month?

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

    Monthly Volumetric Data Series not starting on the 1st Trading day of the month?

    Hey there,

    Just curious. I'm sure it something I'm doing wrong but, I have added a Volumetric data series to my script which is being ran on my ES 60 min chart.

    The script is simply:

    Code:
    
    else if (State == State.Configure)
    
    {
    
    // adding volumetric series to the script
    
    AddVolumetric(null, Data.BarsPeriodType.Month, 1, Data.VolumetricDeltaType.BidAsk, 1);
    
    }
    
    else if (State == State.DataLoaded)
    
    {
    
    }
    
    }
    
    
    protected override void OnBarUpdate()
    
    {
    
    
    int mainChartBarsIndex = 0;
    
    int monthlyChartBarsIndex = 1;
    
    
    DrawVerticalLinesAtStartOfPeriod(monthlyChartBarsI ndex);
    
    // PrintVolumetricBarData(monthlyChartBarsIndex);
    
    
    }
    
    
    private void DrawVerticalLinesAtStartOfPeriod(int currentBarIndex)
    
    {
    
    
    
    int barSeriesToUse = CurrentBars[currentBarIndex];
    
    
    
    if (barSeriesToUse == -1)
    
    {
    
    Draw.VerticalLine(this, "Zero current bar", BarsArray[currentBarIndex].GetTime(barSeriesToUse + 1), Brushes.Green);
    
    }
    
    else if (barSeriesToUse == 0)
    
    {
    
    Draw.VerticalLine(this, "One current bar", BarsArray[currentBarIndex].GetTime(barSeriesToUse + 1), Brushes.Red);
    
    }
    
    }
    I'm sorry if that format isnt great ^ .

    So as you can see I've added a volumetric series with period type month and value of 1.

    I am then simply drawing vertical lines on the new months (green for the first full month and red for the second).

    However if you see my screenshot, the months aren't starting on the 1st trading day which would be the 1st Dec 2021 and 3rd Jan 2022. They are instead a day earlier?

    Any help would be appreciated.

    Thanks very much,

    Tarik
    Attached Files

    #2
    Hello Tarik,

    Likely the values are showing after the first Month bar closed.

    Is the script running with Calculate.OnEachTick and is TickReplay enabled?

    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Hi Chelsea,

      OnBarClose and TickReplay unchecked.

      If it were the close of the Month, how come it's not the close of the daily session the lines being drawn on and, instead the open of the last daily session in that month?

      Thanks

      Tarik

      Comment


        #4
        Hello Tarik,

        If you are drawing a line when a month bar closes, it would appear on the last session of that month.

        If you were to draw a line when a day bar closes, it would appear on close of every session.

        Check the date and time of the draw object in the DrawObjects window.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Ahhh okay great thanks for that.

          Some things with added data series just need wrapping up for me so thank you.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          566 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          330 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
          547 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          548 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X