Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Daily chart VOL[0] not equal to Market Analyzer Daily volume

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

    Daily chart VOL[0] not equal to Market Analyzer Daily volume

    Vol[0] on daily chart is different then Daily Volume in Market Analyzer.

    #2
    monpere,

    This has to do with "non-last qualifying" trades. These are not reported by all data providers on a tick-by-tick basis, and are only reported as historical data.
    Adam P.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_AdamP View Post
      monpere,

      This has to do with "non-last qualifying" trades. These are not reported by all data providers on a tick-by-tick basis, and are only reported as historical data.
      I don't understand your answer. The numbers are generally orders of magnitudes different. Market analyzer might be reporting 1,000 volume, and VOL[0] is reporting 25,000. Are you saying, for example, looking at a daily chart, at 1pm EST VOL[0] is not defined because today's session is not yet historical, so I can only access VOL[1] ? But, VOL[0] always return a value, what value is it reporting?

      Comment


        #4
        monpere,

        Likely I'll need to see an example to really see what is going on here, however note my prior explanation as to why there may be some difference. Do you have code or output you can display here in this thread?
        Adam P.NinjaTrader Customer Service

        Comment


          #5
          Originally posted by NinjaTrader_AdamP View Post
          monpere,

          Likely I'll need to see an example to really see what is going on here, however note my prior explanation as to why there may be some difference. Do you have code or output you can display here in this thread?
          Here is a simple indicator, output, and Market Analyzer screens, applied to a daily chart and all using the same session template.

          ------ Code -----
          protected override void Initialize() {
          CalculateOnBarClose = false;
          }

          protected override void OnBarUpdate() {
          Print("Bar " +CurrentBar +" " +Time[0].ToString("ddMMMyy") +" Volume " +VOL(BarsArray[0])[0]);
          }
          Attached Files
          Last edited by monpere; 10-01-2012, 06:03 AM.

          Comment


            #6
            Originally posted by NinjaTrader_AdamP View Post
            monpere,

            Likely I'll need to see an example to really see what is going on here, however note my prior explanation as to why there may be some difference. Do you have code or output you can display here in this thread?
            ------ Code -------
            protected override void Initialize() {
            CalculateOnBarClose = false;
            Add("CL 11-12",PeriodType.Day, 1);
            Add("CL 12-12",PeriodType.Day, 1);
            Add("CL 01-13",PeriodType.Day, 1);
            }

            protected override void OnBarUpdate() {
            Print(Instrument.FullName +" " +Time[0].ToString("ddMMMyy") +" Volume " +VOL()[0]);
            }
            Attached Files
            Last edited by monpere; 10-01-2012, 06:27 AM.

            Comment


              #7
              monpere, thanks for the scripts - which data provider are you working with here? One value you access would be native to the bars themselves (VOL) while the .DailyVolume would be taken directly from the market providers Level 1 data stream provided - you could access this value as well in OnMarketData() in your code.

              Comment


                #8
                Originally posted by NinjaTrader_Bertrand View Post
                monpere, thanks for the scripts - which data provider are you working with here? One value you access would be native to the bars themselves (VOL) while the .DailyVolume would be taken directly from the market providers Level 1 data stream provided - you could access this value as well in OnMarketData() in your code.
                I use Interactive Brokers, and Mirus. I would like to get the volume displayed in the DailyVolume field of Market Analyzer. Are you saying I can get that value from OnMarketData()? If so, can you please provide the line of code that would do that inside OnMarketData()

                Thanks

                Comment


                  #9
                  Correct, this would be available in OnMarketData() and is what the Market Analyzer would access - it will be called / updated on each change in DailyVolume:

                  protected override void OnMarketData(MarketDataEventArgs e)
                  {
                  if (e.MarketDataType == MarketDataType.DailyVolume)
                  Print("DailyVol = " + e.Volume);
                  }

                  Comment


                    #10
                    Originally posted by NinjaTrader_Bertrand View Post
                    Correct, this would be available in OnMarketData() and is what the Market Analyzer would access - it will be called / updated on each change in DailyVolume:

                    protected override void OnMarketData(MarketDataEventArgs e)
                    {
                    if (e.MarketDataType == MarketDataType.DailyVolume)
                    Print("DailyVol = " + e.Volume);
                    }
                    Thanks. Does OnMarketData() gets called once for each BarsInProgress, or does it only apply to BarsInProgress 0?

                    Comment


                      #11
                      It will be called for all unique instruments in your strategy, which you can filter via BarsInProgress.

                      Comment


                        #12
                        Originally posted by NinjaTrader_Bertrand View Post
                        Correct, this would be available in OnMarketData() and is what the Market Analyzer would access - it will be called / updated on each change in DailyVolume:

                        protected override void OnMarketData(MarketDataEventArgs e)
                        {
                        if (e.MarketDataType == MarketDataType.DailyVolume)
                        Print("DailyVol = " + e.Volume);
                        }
                        Is this DailyVolume data available anywhere before OnMarketData is called the first time? For low liquidity or inactive contracts, it may take a while before getting the first call to OnMarketData.

                        Comment


                          #13
                          Unfortunately that this only be available in OnMarketData(). An alternative could be running a custom count in your OnBarUpdate() for this figure based on the applied session template hours.

                          Comment


                            #14
                            Originally posted by NinjaTrader_Bertrand View Post
                            Unfortunately that this only be available in OnMarketData(). An alternative could be running a custom count in your OnBarUpdate() for this figure based on the applied session template hours.
                            MarketAnalyzer has a DailyVoume value before the first OnMarketData() call. Where does it get that value? How can I get access to that value?

                            Comment


                              #15
                              I'm not following you monpere, there needs to be a Level 1 data event for it to return any value, which events did you listen to in your script then?

                              Comment

                              Latest Posts

                              Collapse

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