Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Bid/Ask Volume of Previous Bar

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

    Bid/Ask Volume of Previous Bar

    Hi

    I've developed a strategy that uses Bid/Ask volume data to trigger signals.
    What I'd like to do now is to compare the Bid/Ask volume of the current candle to the Bid/Ask volume of the previous candle.

    Here are my variables:

    private int activeBar = -1;
    private double askPrice = 0;
    private double bidPrice = 0;
    private double buys = 0;

    private double sells = 0;
    private double buy = 0;
    private double sell = 0;

    Here are my conditions:

    if ( buy> sell && my conditions here)

    This compares buy & sell volumes of the current candle (works well). In order to compare buy & sell volumes of the PREVIOUS candle I thought I just have to modify the code to buy [1] > sell [1] but I get the following error message: "Cannot apply indexing with [] to an expression of type type 'double'.

    What do I have to do to get this fixed? Thanks a lot.

    #2
    laocoon, those are only double variables, which would not give you access to any historical data like DataSeries objects - for NT7 you could look into creating a MultiSeries script that would have access to historical bid / ask data series.

    Comment


      #3
      Bertrand, I was afraid you were going to say this. This makes the whole thing much more complicated (and beyond my programming skills).

      When will Bid/Ask data be available on a historical basis, just like OHLC data?
      (I know this has been asked many times before in other threads but I'd be really interested in getting an update).

      Thanks

      Comment


        #4
        laocoon, this is available already depending on your data provider, you could also determine to drive your NT7 charts from either the bid, ask or last ('Price based on') - http://www.ninjatrader.com/support/h...rical_data.htm

        If you would like to work with the data programmatically though you would need to create a MultiSeries script, as otherwise you could not access the data (if you need help implementing a consultant might be the route to take - http://www.ninjatrader.com/partners#...pt-Consultants)

        Comment


          #5
          Thanks for your reply Bertrand. I had a look at the first link you provided and the table says that ZenFire (I'm on ZenFire) supports historical Bid/Ask tick data for futures.

          How come that my historical Bid/Ask tick data is gone every time I reload a strategy on a chart?

          Thanks

          Comment


            #6
            Hello,

            The actual data or a power volume indicator? Aka an indicator output that is no longer there or the bid ask price data in the chart is no longer there.

            I look forward to assisting you further.
            BrettNinjaTrader Product Management

            Comment


              #7
              Hi Brett

              Thanks for your reply.
              I'm using an indicator that I downloaded here on the forum.


              Whenever I reload the indicator, all historical Bid/Ask data is gone.

              Thanks

              Comment


                #8
                laocoon, is the indicator coded as MultiSeries indicator as I previously outlined?

                Comment


                  #9
                  I think not. That would obviously explain it.

                  Comment


                    #10
                    Is there an example available of an indicator coded as a MultiSeries indicator?

                    This would be really helpful.

                    Thanks

                    Comment


                      #11
                      laocoon, unfortunately there is not such an example.
                      AustinNinjaTrader Customer Service

                      Comment


                        #12
                        Austin, this is pretty frustrating.

                        I wasn't even aware (although I check the forum regularly) that Ninja V7 was capable of handling historical bid/ask data and now there's not a single indicator available to take advantage of this great new feature

                        I understand that the team has a lot on its plate right now but it would be great to have at least one indicator that uses this feature (also as a showcase in terms of how it is coded).

                        There are many threads and thus many users who have been eagerly waiting for this feature so I guess it would make sense to provide at least one MultiSeries indicator.

                        Thanks

                        Comment


                          #13
                          laocoon, there is not a specific example like you're looking for, but there are definitely examples floating around for how to do a multi-series indicator, like this pairs suite.
                          AustinNinjaTrader Customer Service

                          Comment


                            #14
                            Austin, thanks for your reply. I just realised that my post is incomplete.
                            I didn't mean to say that it would be great to have at least one example of a MultiSeries indicator, but that it would be great to have at least one example of a MultiSeries indicator that saves a bit of data that would otherwise be lost (like historical bid/ask data for example).

                            All I need is 1-2 days of historical bid/ask data on my charts.

                            Sorry for the confusion.

                            Comment


                              #15
                              laocoon, you can take a look at this very simple sample attached - use it on the ES 1 min, it loads 2 additional series (1 min bid, 1 min ask) and uses them in it's calcs.
                              Attached Files

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                              0 responses
                              627 views
                              0 likes
                              Last Post Geovanny Suaza  
                              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                              0 responses
                              359 views
                              1 like
                              Last Post Geovanny Suaza  
                              Started by Mindset, 02-09-2026, 11:44 AM
                              0 responses
                              105 views
                              0 likes
                              Last Post Mindset
                              by Mindset
                               
                              Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                              0 responses
                              562 views
                              1 like
                              Last Post Geovanny Suaza  
                              Started by RFrosty, 01-28-2026, 06:49 PM
                              0 responses
                              568 views
                              1 like
                              Last Post RFrosty
                              by RFrosty
                               
                              Working...
                              X