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 sukhob, 05-18-2023, 08:26 PM
          2 responses
          127 views
          0 likes
          Last Post TraderJA  
          Started by timwey, Yesterday, 10:55 AM
          4 responses
          23 views
          0 likes
          Last Post timwey
          by timwey
           
          Started by DJ888, 06-28-2024, 10:18 PM
          3 responses
          39 views
          0 likes
          Last Post AdamDJ8
          by AdamDJ8
           
          Started by ntwong, Yesterday, 08:22 PM
          0 responses
          16 views
          0 likes
          Last Post ntwong
          by ntwong
           
          Started by Sigma Cypher, 01-08-2022, 06:56 AM
          9 responses
          1,170 views
          0 likes
          Last Post Tbryant
          by Tbryant
           
          Working...
          X