Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Historical Ask Bid volume footprint

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

    Historical Ask Bid volume footprint

    Hello,

    I am trying to calculate historical ask/bid volume per bar. I can not find the right answer in ninjascript documentation, so I decided to post new thread.

    Primary chart 100 ticks
    my script:

    protected override void Initialize()
    {
    Add(Instrument.FullName, PeriodType.Tick, 1, MarketDataType.Ask);
    Add(Instrument.FullName, PeriodType.Tick, 1, MarketDataType.Bid);
    Add(Instrument.FullName, PeriodType.Tick, 1, MarketDataType.Last);

    ClearOutputWindow();
    CalculateOnBarClose = false;
    DisplayInDataBox = false;
    }

    protected override void OnBarUpdate()
    {

    // primary data series - chart
    if(BarsInProgress == 0)
    {
    Print("-------");
    Print("Chart volume: " + Volume[0]);
    Print("Total volume: " + this.totalVolume);
    Print("Total ask: " + this.askVolume);
    Print("Total bid: " + this.bidVolume);

    this.askVolume = 0;
    this.bidVolume = 0;
    this.totalVolume = 0;
    }

    // new data series
    if(BarsInProgress == 1) this.askVolume += (int)Volumes[1][0];
    if(BarsInProgress == 2) this.bidVolume += (int)Volumes[2][0];
    if(BarsInProgress == 3) this.totalVolume += (int)Volumes[3][0];
    }

    Output:

    -------
    Chart volume: 225
    Total volume: 231
    Total ask: 1897
    Total bid: 3479
    -------
    Chart volume: 210
    Total volume: 189
    Total ask: 1629
    Total bid: 2818
    -------
    Chart volume: 196
    Total volume: 207
    Total ask: 2104
    Total bid: 2263


    As you see in output,
    "Chart volume" is correct value which is displayed on chart
    "Total volume" is close to primary volume, but not exact the same, but bid and ask volume is totally different values.

    Could anybody help me with this, please?

    #2
    Hello tomekas,

    Thanks for your post and welcome to the forums!

    What datafeed are you using and what instrument have you developed your data on?
    Paul H.NinjaTrader Customer Service

    Comment


      #3
      Thanks for reply,

      I am using kinetick for historical tick data and continuum for real time data.
      I am trying to calculate bid/ask volume for GBP futures in this case 6b 09-16.

      I am already using footprint chart indicator so I can confirm that historical data is loaded, I can see bid/ask volumes on every price levels, but when I calculate volume by myself it does not match original volume indicator values.

      I look forward to hearing from you,
      Tomas

      Comment


        #4
        Hello

        Thanks for your reply.

        Ask/Bid series are not executions, they are updates sent out by the exchange. Please refer to this thread for further information: http://ninjatrader.com/support/forum...886#post423886

        From the helpguide: The historical bid/ask series holds all bid/ask events sent out by the exchange. This would not be equivalent to the bid/ask at a specific time a trade went off.

        HelpGuide reference: http://ninjatrader.com/support/helpG..._ask_serie.htm
        Paul H.NinjaTrader Customer Service

        Comment


          #5
          Thanks for information, Paul.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by kawalecld, Today, 12:21 PM
          0 responses
          5 views
          0 likes
          Last Post kawalecld  
          Started by exjayess, Today, 11:04 AM
          1 response
          11 views
          0 likes
          Last Post NinjaTrader_ShawnB  
          Started by robertlaub, Today, 11:11 AM
          2 responses
          6 views
          0 likes
          Last Post robertlaub  
          Started by sdauteuil, Today, 10:28 AM
          0 responses
          6 views
          0 likes
          Last Post sdauteuil  
          Started by KirkHammett, Today, 08:11 AM
          0 responses
          7 views
          0 likes
          Last Post KirkHammett  
          Working...
          X