Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Bid/Ask historycal volume

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

    Bid/Ask historycal volume

    Is it posible in NT7 calculate Bid /ask historical volume? What script construction I need to use for it?
    sorry for my english

    #2
    If your broker or market data provide supports historical bid/ask, you can construct a data series for either ask, bid or last.

    As an example, you can add the following in your Initialize() method:

    Add("ES 03-10", PeriodType.Minute, 1, MarketDataType.Ask);

    Which will give you a 1 minute series of ask prices. You need to also be familiar with multi-series programming in NinjaTrader. The NT7 Help Guide is far from complete in this area but you can use NT 6.5 Help Guide for now.
    RayNinjaTrader Customer Service

    Comment


      #3
      I coded a test indicator to see if I could access the amount of VOLUME traded at Ask prices for historical data.

      It's a simple indicator that displays a message in the Output window saying what the volume is for each bar.

      Tthe volumes displayed for the ask price were way, way too high....

      v7_ask_vol_test: bar=1368 BarsInProgress=0 Time=1/22/2010 4:15:00 PM Volume=16109 AskTime=1/22/2010 4:15:00 PM AskVolume=583933
      v7_ask_vol_test: bar=1037 BarsInProgress=1 Time=1/22/2010 4:15:00 PM Volume=16109 AskTime=1/22/2010 4:15:00 PM AskVolume=583933
      v7_ask_vol_test: bar=1368 BarsInProgress=0 Time=1/22/2010 4:15:00 PM Volume=16109 AskTime=1/22/2010 4:15:00 PM AskVolume=583933
      v7_ask_vol_test: bar=1037 BarsInProgress=1 Time=1/22/2010 4:15:00 PM Volume=16109 AskTime=1/22/2010 4:15:00 PM AskVolume=583933

      If the bar has a volume of 16,109 then how can the Ask volume be 36 times as much?

      I had the indicator loaded on a 1-Min ES 03-10 chart.

      here's the indicator code (also attached):

      Code:
      namespace NinjaTrader.Indicator
      {
          [Description("Ask volume test")]
          public class v7_ask_vol_test : Indicator
          {
              protected override void Initialize()
              {
                  Add( Instrument.FullName, BarsPeriod.Id, BarsPeriod.Value, MarketDataType.Ask );    // Volumes[1][0]
      
                  CalculateOnBarClose        = false;
              }
      
              protected override void OnBarUpdate()
              {
                  Print( String.Format( "v7_ask_vol_test: bar={0}  BarsInProgress={1} Time={2} Volume={3}  AskTime={4} AskVolume={5}", 
                                      CurrentBar, BarsInProgress, 
                                      Times[0][0], Volumes[0][0], 
                                      Times[1][0], Volumes[1][0] ));
              }
          }
      }
      Attached Files

      Comment


        #4
        KBJ,

        I ran your indicator on my end here on eSignal and did not get numbers like yours. Please add a series to your chart for your Ask prices and use the Data Box and mouse over to see that the data printed is simply whatever data was coming in from your data provider.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          Josh: I was doing some more looking and saw that the data the same as is saved on the disk.

          According to the Historical Data Manager, the volumes of the Ask minute data match what's being displayed by my test indicator, and seem way out of whack with the Last minute data for the same day and instrument. (See attached.)

          I'm using the Zenfire datafeed.

          Do you still want me to do the Data Box test?
          Attached Files

          Comment


            #6
            KBJ,

            Then it would appear this is simply the information being passed across by the data source.
            Josh P.NinjaTrader Customer Service

            Comment


              #7
              Originally posted by NinjaTrader_Ray View Post
              If your broker or market data provide supports historical bid/ask, you can construct a data series for either ask, bid or last.

              As an example, you can add the following in your Initialize() method:

              Add("ES 03-10", PeriodType.Minute, 1, MarketDataType.Ask);

              Which will give you a 1 minute series of ask prices. You need to also be familiar with multi-series programming in NinjaTrader. The NT7 Help Guide is far from complete in this area but you can use NT 6.5 Help Guide for now.
              Josh, thanks a lot
              I will test this

              Comment


                #8
                Originally posted by NinjaTrader_Josh View Post
                KBJ,

                Then it would appear this is simply the information being passed across by the data source.
                A call was made to AMP and they're going to find out from Zenfire what's up.

                I'll let you know if I hear anything.

                Comment


                  #9
                  Originally posted by NinjaTrader_Josh View Post
                  Then it would appear this is simply the information being passed across by the data source.
                  Josh: We have not as yet heard back from AMP on this (probably they haven't heard from Zenfire ... I'll keep checking.)

                  But meanwhile, I was reviewing another forum posting, and I ran across this:

                  Originally posted by NinjaTrader_Jason View Post
                  Hello anothertoy,

                  ... we recommend to disable this option with Zen-Fire, since you have access to historical data with Zen-Fire.

                  Note that as a courtesy we allow Zen-Fire users to make use of our historical data server, which can differ from the real-time data received by Zen-Fire.
                  So, does this mean that the "data source" mentioned in your email address is NinjaTrader's "historical data server"?

                  And if so, are the problems I'm experiencing from data that's messed up on that server?

                  Comment


                    #10
                    KBJ,

                    If you downloaded the data as opposed to store it real-time then that could be the differing factor as they are different data sources.
                    Josh P.NinjaTrader Customer Service

                    Comment


                      #11
                      I have zenfire and watched data updating on a tick chart with CalculateOnBarClose=false. When the Ask volume is updated each tick (OnBarUpdate), it increments by the volume at the Ask Level1 price. It is not the volume traded, but the volume available at that price. Also, a tick in this case appears to be a change in the volume at the Level1 price, not a trade.

                      Comment


                        #12
                        Originally posted by NinjaTrader_Josh View Post
                        If you downloaded the data as opposed to store it real-time then that could be the differing factor as they are different data sources.
                        Josh: I've completely reloaded this historical data several times for that day, selecting all timeframes and types of data (Tick, Minute, Day, Ask, Bid, Last).

                        So I'd think there wouldn't be any possibility of there being anything left of what might have been stored real-time at this much later point in time.

                        Am I missing something here?

                        Comment


                          #13
                          Originally posted by MJT View Post
                          I have zenfire and watched data updating on a tick chart with CalculateOnBarClose=false. When the Ask volume is updated each tick (OnBarUpdate), it increments by the volume at the Ask Level1 price. It is not the volume traded, but the volume available at that price. Also, a tick in this case appears to be a change in the volume at the Level1 price, not a trade.
                          MJT: And that's a mouthful.

                          I had to re-read what you wrote about 12 times before I got it. (I had a few misconceptions that I had to divest myself of first.)

                          Thanks.

                          Of course since these "ask volumes" aren't related to the number of trades at the ask price, they aren't useful for what I was trying to do.

                          (Sigh.)
                          Last edited by KBJ; 02-01-2010, 11:23 PM.

                          Comment


                            #14
                            KBJ,

                            I think we may have been barking up the wrong tree. I believe it may have been a simple misinterpretation as MJT has kindly pointed out.
                            Josh P.NinjaTrader Customer Service

                            Comment


                              #15
                              Part misinterpretation, part bad reload data

                              Originally posted by NinjaTrader_Josh View Post
                              I think we may have been barking up the wrong tree. I believe it may have been a simple misinterpretation as MJT has kindly pointed out.
                              Josh: It was partly that I didn't understand why the "minute ask volumes" were so high, and partly that the download historical data was giving me incomplete and/or very misleading data.

                              And just doing a reload of the day's data did not fix the inconsistencies in the historical data.

                              However, the reload worked correctly after I first deleted the day's data using the edit screen.

                              I had done a reload before that and noticed that several additional values were added to the "ask tick data" which looked to me (based on their volumes) like they were duplicates of other entries from slightly different times. But as I said, deleting the day's data and reloading cleaned it up (and the weird, duplicate values at other times went away).

                              One of the problems that I noticed before I deleted the data and reloaded (and this is another reason that I say that it was messed up), is that when I exported the "ask tick data" to an Excel spreadsheet and added up the volumes for a minute's worth of data, I got a total that was wildly different (less than half) from the total volume found for that minute's worth of data found in the "ask minute data" as displayed by the historical data manager's edit screen.

                              But after deleting and reloading the day's data, I found that the same Excel operation to add up all the "ask tick volumes" for the same minute's data totaled exactly with the "ask minute volume" entry for that minute (which hadn't changed from before the delete -- i.e., it was the tick data that was messed up and totaling to different values.)

                              Should we always have to delete a day's data before reloading it?

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                              0 responses
                              601 views
                              0 likes
                              Last Post Geovanny Suaza  
                              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                              0 responses
                              347 views
                              1 like
                              Last Post Geovanny Suaza  
                              Started by Mindset, 02-09-2026, 11:44 AM
                              0 responses
                              103 views
                              0 likes
                              Last Post Mindset
                              by Mindset
                               
                              Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                              0 responses
                              559 views
                              1 like
                              Last Post Geovanny Suaza  
                              Started by RFrosty, 01-28-2026, 06:49 PM
                              0 responses
                              558 views
                              1 like
                              Last Post RFrosty
                              by RFrosty
                               
                              Working...
                              X