• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

MarketData and Volumetric don't match on the open of the first session bar

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

    MarketData and Volumetric don't match on the open of the first session bar

    I have a strategy that collects the data from the MarketData to create orderflow bars, but comparing the data that I get, with the data from the volumetric bars, I have noticed that on every open of the firs session bar, the data don't match.


    I don't know if is an erro of my part or of the volumetric bars, but here is how I'm populating my bars.


    protected override void OnMarketData( NinjaTrader.Data.MarketDataEventArgs e ){
    if( e.MarketDataType == NinjaTrader.Data.MarketDataType.Last ){
    if( CurrentBars[ 0 ] < 0 || BarsInProgress > 0 )
    return;

    double rounded = RoundToTickSize( e.Price );

    if( e.Price <= e.Bid ){
    bars[ 0 ][ rounded, Cluster.Long.BidVolume ] += e.Volume;
    }else if( e.Price >= e.Ask ){
    bars[ 0 ][ rounded, Cluster.Long.AskVolume ] += e.Volume;
    }
    }

    The "bars" are a Series of my custom class that represents the bars, and on it's logic it places the volume on the difernt levels of prices.

    As you can see on the images the other data except for the open of the first bar of the session matches exactly as the volumetric bars.

    #2
    Hi Bikotoru, thanks for your post and welcome to the NinjaTrader forum.

    We have a default indicator called "BuySellVolume" which will be a good reference for this. That can be found in the Indicators folder. The Volumetric bar's total volume is the same as BuySellVolume on my chart.

    Kind regards,

    -ChrisL
    Chris L.NinjaTrader Customer Service

    Comment


      #3
      Hi ChrisL, thanks for your replay.

      The BuySellVolume indicator stores the total of the buys and sells of a bar, and what I'm pointing out is that there is a diference on the open price of the bar, like the pictures show, all the other bars match exactly, so why the open of the first bar of a session is diferent?

      Comment


        #4
        Hi Bikotoru, thanks for your reply.

        Please re-post your screen shots. I do not see them in your original post.
        Chris L.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by leodrz, Today, 09:45 PM
        2 responses
        13 views
        0 likes
        Last Post leodrz
        by leodrz
         
        Started by habibalex, Today, 09:30 PM
        0 responses
        7 views
        0 likes
        Last Post habibalex  
        Started by Herrwolf1, Today, 09:07 PM
        0 responses
        6 views
        0 likes
        Last Post Herrwolf1  
        Started by nomadmilo, Today, 08:52 PM
        1 response
        8 views
        0 likes
        Last Post nomadmilo  
        Started by jvanelli, Today, 08:48 PM
        0 responses
        6 views
        0 likes
        Last Post jvanelli  
        Working...
        X