Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Get maximum volume of previous day (not today)

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

    Get maximum volume of previous day (not today)

    Hi,

    i need to get maximum volume of previous day. To get todays max volume i use
    Code:
    AddVolumetric("ES JUN23", BarsPeriodType.Day, 1, VolumetricDeltaType.BidAsk, 1);
    ..
    .
    .
    
    barsType.Volumes[CurrentBars[timeFrameDaily]].GetMaximumVolume(null, out dVPOCdailyPrev);
    How do i get yesterday maxVolume easily?

    #2
    I am looking for the same info.

    Comment


      #3
      Couldn't you just save it in a variable?

      e.g. a field variable at the top like:

      long (or double) TodayMaxVol = 0;
      long (or double) YesterdayMaxVol = 0;

      then in OnBarUpdate():

      if (CurrentBars[0] > 0)
      {
      if (Times[0][0].Date > Times[0][1].Date)
      {
      // it is a new date
      YesterdayMaxVol = TodayMaxVol;
      TodayMaxVol = 0;
      }
      }

      TodayMaxVol = whatever you are doing now...
      Bruce DeVault
      QuantKey Trading Vendor Services
      NinjaTrader Ecosystem Vendor - QuantKey

      Comment


        #4
        Originally posted by kujista View Post
        Hi,

        i need to get maximum volume of previous day. To get todays max volume i use
        Code:
        AddVolumetric("ES JUN23", BarsPeriodType.Day, 1, VolumetricDeltaType.BidAsk, 1);
        ..
        .
        .
        
        barsType.Volumes[CurrentBars[timeFrameDaily]].GetMaximumVolume(null, out dVPOCdailyPrev);
        How do i get yesterday maxVolume easily?
        kujista - Could you plz help me understand a bit on how you are able to get the point of control for current session / day?

        I am using following code, but dont get any results.

        This is what i am trying to do : Go long if previous bar was red and Current bar is green and current bars close price is greater than todays VPOC.

        HTML Code:
         else if (State == State.Configure)
                    {
                        //AddDataSeries(Data.BarsPeriodType.Day, 1);
                        AddDataSeries(Data.BarsPeriodType.Tick, 1);
                        AddVolumetric("MES JUN23", BarsPeriodType.Day, 1, VolumetricDeltaType.BidAsk, 1);
        
                    }
                }
        
                protected override void OnBarUpdate()
                {
                    if (BarsInProgress != 0)
                        return;
        
        
                    if (Bars == null)
                  return;
                    NinjaTrader.NinjaScript.BarsTypes.VolumetricBarsType barsType = Bars.BarsSeries.BarsType as    
                        NinjaTrader.NinjaScript.BarsTypes.VolumetricBarsType;
        
                if (barsType == null)
                  return;
        
                     // Set 1
                    if ((Close[0] > Open[0])
                         && (Close[1] < Open[1])
                         && (Closes[1][0] > barsType.Volumes[CurrentBar].GetMaximumVolume(null, out Daily_VPOC)))
                    {
                        EnterLongLimit(Convert.ToInt32(DefaultQuantity), Close[0], "");
                    }   ​

        Comment


          #5
          Hello kujista,

          Thanks for your post.

          You could consider saving the Order Flow Volumetric Bars GetMaximumVolume() value to a variable as QuantKey_Bruce has shared. This would allow you to easily get the previous day's max volume when there is a new date.

          Order Flow Volumetric Bars: https://ninjatrader.com/support/help..._highlightsub= getmaximumvolume

          percy3687, the POC is not currently exposed from the Order Flow indicators so that would not be something another script can detect. You can find a description of how you may calculate the POC yourself in the following link: https://ninjatrader.com/support/foru...79#post1112679

          Please let us know if we may assist further.
          <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by NullPointStrategies, Yesterday, 05:17 AM
          0 responses
          76 views
          0 likes
          Last Post NullPointStrategies  
          Started by argusthome, 03-08-2026, 10:06 AM
          0 responses
          146 views
          0 likes
          Last Post argusthome  
          Started by NabilKhattabi, 03-06-2026, 11:18 AM
          0 responses
          79 views
          0 likes
          Last Post NabilKhattabi  
          Started by Deep42, 03-06-2026, 12:28 AM
          0 responses
          50 views
          0 likes
          Last Post Deep42
          by Deep42
           
          Started by TheRealMorford, 03-05-2026, 06:15 PM
          0 responses
          54 views
          0 likes
          Last Post TheRealMorford  
          Working...
          X