Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Order Flow + Inconsistent data

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

    Order Flow + Inconsistent data

    I'm having trouble with the order flow data. Last night while testing USD/JPY, the values were in the 100's of thousands or millions with the code below. I redownloaded the EURUSD and USDJPY from historical charts using all the checkboxes on my laptop and ran the same code, and my volume is only double digits. Am I missing something obvious?

    Total Volume: 154

    Total Buying Volume: 101

    Total Selling Volume: 53

    Total HighestBid Volume: 19

    Total HighestAsk Volume: 42


    Code:
    double price;
    
    
    
    NinjaTrader.NinjaScript.BarsTypes.VolumetricBarsType barsType = BarsArray[1].BarsType as NinjaTrader.NinjaScript.BarsTypes.VolumetricBarsType;
    
    
    
    
    
    
    
    if (barsType != null && CurrentBars[1] != null)
    
    {
    
    
    
    volTrades = barsType.Volumes[CurrentBars[1]].Trades;
    
    volTotalVolume = barsType.Volumes[CurrentBars[1]].TotalVolume;
    
    volTotalBuyingVolume = barsType.Volumes[CurrentBars[1]].TotalBuyingVolume;
    
    volTotalSellingVolume = barsType.Volumes[CurrentBars[1]].TotalSellingVolume;
    
    volHighestAsk = barsType.Volumes[CurrentBars[1]].GetMaximumVolume(true,out price);
    
    volHighestBid=  barsType.Volumes[CurrentBars[1]].GetMaximumVolume(false,out price);
    
    // updateVolumetrics();
    
    }
    ​

    #2
    In the below code, I'm checking volumes and I'm getting only sellvolume, and not buy volume - how is that possible? Technically I could subtract the values, but is the data wrong/missing?
    Output:
    pctBuyingVolume 0 volTotalSellingVolume 81 volTotalVolume 172
    pctBuyingVolume 0 volTotalSellingVolume 23 volTotalVolume 63
    pctBuyingVolume 0 volTotalSellingVolume 63 volTotalVolume 209


    Code:
    double price;
    
    NinjaTrader.NinjaScript.BarsTypes.VolumetricBarsType barsType = BarsArray[1].BarsType as NinjaTrader.NinjaScript.BarsTypes.VolumetricBarsType;
    
    
    
    if(CurrentBar < barsType.Volumes.Length)
    
    {
    
    
    
    if (barsType != null && barsType.Volumes[CurrentBar] != null)
    
    {
    
    
    
    volTrades = barsType.Volumes[CurrentBar].Trades;
    
    volTotalVolume = barsType.Volumes[CurrentBar].TotalVolume;
    
    volTotalBuyingVolume = barsType.Volumes[CurrentBar].TotalBuyingVolume;
    
    volTotalSellingVolume = barsType.Volumes[CurrentBar].TotalSellingVolume;
    
    volHighestAsk = barsType.Volumes[CurrentBar].GetMaximumVolume(true,out price);
    
    volHighestBid =  barsType.Volumes[CurrentBar].GetMaximumVolume(false,out price);
    
    
    
    double pctBuyingVolume = volTotalBuyingVolume / volTotalVolume;
    
    //Print(barsType.Volumes.Length);
    
    if(pctBuyingVolume > 0)
    
    {
    
    if(pctBuyingVolume == 0 || pctBuyingVolume == 1)
    
    {
    
    BackBrush = Brushes.Firebrick;//b
    
    }
    
    
    
    else if(pctBuyingVolume > 0 && pctBuyingVolume <= 0.6)
    
    {
    
    
    
    BackBrush = Brushes.LightGoldenrodYellow;//b
    
    
    
    }
    
    else if(pctBuyingVolume > .6 && pctBuyingVolume <= .7)
    
    {
    
    BackBrush = Brushes.LightGreen;//b
    
    
    
    }
    
    else if(pctBuyingVolume > .7 && pctBuyingVolume <= .8)
    
    {
    
    BackBrush = Brushes.ForestGreen;//b
    
    
    
    }
    
    else if(pctBuyingVolume > .8 && pctBuyingVolume <= .9)
    
    {
    
    BackBrush = Brushes.Green;//b
    
    
    
    }
    
    else if(pctBuyingVolume > .9 && pctBuyingVolume < 1)
    
    {
    
    BackBrush = Brushes.Lime;//b
    
    
    
    }
    
    }
    
    else
    
    Print("pctBuyingVolume "+pctBuyingVolume+" volTotalSellingVolume "+volTotalSellingVolume+" volTotalVolume "+volTotalVolume);
    
    
    
    }
    
    
    
    }
    ​
    Attached Files

    Comment


      #3
      Hello Skifree,

      In regard to the high numbers you had seen, from what I can see using kinetic data the average range of volume for the usdjpy is in the millions. If you open a normal 1 minute chart and view the bar volumes you should be able to see values in that range.

      For the bid and ask volume that would be the case when using volumetric on forex type instruments. The following comments from the help guide would be relevant here:

      Critical: To perform the delta buy / sell aggressor classification (DeltaType BidAsk), historical bid / ask tick data access by your provider is needed. If your provider could only support 'last' historical tick data, then the classification could still be made using DeltaType UpDownTick mode.

      Forex spot data charting is traditionally driven from the bid side only, since no 'true' last exists. Provided values would not represent a centralized auction based market as with stocks or futures - as such Order Flow Volumetric Bars would not be supported on Forex spot data.
      This comment doesn't take specific data providers into account so you may see that either the bid or ask volume is present while the opposite is not, only 1 side of the volume would be present when printing the values while using volumetric series on forex. ​

      Comment


        #4
        I'm using forex.com. I'm hoping to just have consistent data. Why is it that the data doesn't seem consistent across any symbols, and is there a way to verify the volumes?

        I'm hoping to use it to identify buy and sell pressure

        Comment


          #5
          Hello Skifree,

          Consistent data would not be the problem in relation to what you are printing, its how forex data is provided and processed. As the help guide mentions
          Forex spot data charting is traditionally driven from the bid side only, since no 'true' last exists. Provided values would not represent a centralized auction based market as with stocks or futures - as such Order Flow Volumetric Bars would not be supported on Forex spot data.
          Volumetric bars were not designed to be used in that type of use case so values derived from ask/bid on forex would not be complete. The volumetric can be used fully on futures or stock type instruments. If you do try to use volumetric bars on forex instruments the result you had seen with printing just the sell volume would be expected.


          Comment


            #6
            Thank you Jesse,

            However, I do notice that there is sell, and total, which are often different. Would total - sell still = the equivalent of buy, or something else?

            Comment


              #7
              I just tried running the numbers for MCL Jan24 , and I get no data at all. Is there something I'm missing?

              Comment


                #8
                Hello Skifree,

                I would not be sure if doing that subtraction would be the equivalent of the buy volume, the orderflow tools are closed source so we cannot see how that value is derived when using forex instruments.

                In regard to the MCL please check the control center log tab to check if you are getting any errors or warnings. Additionally please use the account portal to make sure you are subscribed to data for that instruments. If you are unsure if you are enabled for that instrument you can use the platforms Help -> email support option, select Brokerage account support from the dropdown list and a member of the brokerage team can assist with your account.


                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by argusthome, 03-08-2026, 10:06 AM
                0 responses
                110 views
                0 likes
                Last Post argusthome  
                Started by NabilKhattabi, 03-06-2026, 11:18 AM
                0 responses
                59 views
                0 likes
                Last Post NabilKhattabi  
                Started by Deep42, 03-06-2026, 12:28 AM
                0 responses
                37 views
                0 likes
                Last Post Deep42
                by Deep42
                 
                Started by TheRealMorford, 03-05-2026, 06:15 PM
                0 responses
                41 views
                0 likes
                Last Post TheRealMorford  
                Started by Mindset, 02-28-2026, 06:16 AM
                0 responses
                78 views
                0 likes
                Last Post Mindset
                by Mindset
                 
                Working...
                X