Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Getting Buyers/Seller Volume

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

    Getting Buyers/Seller Volume

    Hi
    I'm new to ninja script programing , I have a question about coding
    I want to get volume of buyers on a specific candle , like candle number 3 on 1min chart , with the function VOL() i can get volumes of buyers and sellers together but i want to have buyers and sellers volume individually.
    I want these numbers to calculate delta for specific candle , Can you help me with the code please thanks

    #2
    Hello FarzadHA,

    Thanks for your post.

    The VOL() indicator method would only return the total volume for the bar.

    See this help guide page for more information about VOL(): https://ninjatrader.com/support/help...nt8/volume.htm

    You could try using the BuySellVolume() indicator method to get the buy volume or sell volume of a bar. The BuySellVolume().Buys[] gets the total volume for the bar while the BuySellVolume().Sells[0] gets the number of sells for the bar. The number of trades executed at the ask would be the difference between the two.

    For example, BuySellVolume().Buys[0] - BuySellVolume().Sells[0]; would get the buy volume of the current bar. BuySellVolume().Sells[0] would get the sell volume of the current bar.

    See this help guide page for more information about BuySellVolume(): https://ninjatrader.com/support/help...sellvolume.htm
    Last edited by NinjaTrader_BrandonH; 08-09-2023, 09:40 AM.
    <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

    Comment


      #3
      Hi Brandon
      Thanks for helping , i tried to use the code you said but i get 0 on script output
      Here is what i did:

      private BuySellVolume BuySellVolume1; (i wrote this line under public class)
      else if (State == State.DataLoaded)
      {
      BuySellVolume1 = BuySellVolume(Close);
      }
      double BuyVol = BuySellVolume().Buys[1];
      Print("Buy Volume Is: " + BuyVol);

      i think these simple codes should works but they didnt , it keeps throwing 0 on output , what am i missing? ​​

      Comment


        #4
        Hello FarzadHA,

        Thanks for your notes.

        ​The BuySellVolume indicator requires ticks for calculations so you will need to enable Tick Replay and set the strategy to Caclulate.OnEachTick.

        I have attached an example script you could view that demonstrates how to get the Buy Volume and Sell Volume from the BuySellVolume indicator in a NinjaScript.

        Note that you will need to enable Tick Replay on your chart for the script to properly calculate values.

        See the help guide documentation below for more information.

        TickReplay: https://ninjatrader.com/support/help...ick_replay.htm
        BuySellVolume: https://ninjatrader.com/support/help...sellvolume.htm
        Calculate: https://ninjatrader.com/support/help.../calculate.htm
        Attached Files
        <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

        Comment


          #5
          Hello, is there a way to show the % of buyers vs sellers in order flow volume profile in the buy/sell mode? if not, is there a 3rd party integration. It gets really difficult to get this by just looking at the with of bars of on top of the other when there is a high volume of contracts or in a cluster.

          Comment


            #6
            Hello sgf2051,

            There is currently not a way to set that to a percent with the built in volume profile.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Mindset, 04-21-2026, 06:46 AM
            0 responses
            87 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by M4ndoo, 04-20-2026, 05:21 PM
            0 responses
            128 views
            0 likes
            Last Post M4ndoo
            by M4ndoo
             
            Started by M4ndoo, 04-19-2026, 05:54 PM
            0 responses
            65 views
            0 likes
            Last Post M4ndoo
            by M4ndoo
             
            Started by cmoran13, 04-16-2026, 01:02 PM
            0 responses
            117 views
            0 likes
            Last Post cmoran13  
            Started by PaulMohn, 04-10-2026, 11:11 AM
            0 responses
            67 views
            0 likes
            Last Post PaulMohn  
            Working...
            X