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 NullPointStrategies, Yesterday, 05:17 AM
            0 responses
            54 views
            0 likes
            Last Post NullPointStrategies  
            Started by argusthome, 03-08-2026, 10:06 AM
            0 responses
            131 views
            0 likes
            Last Post argusthome  
            Started by NabilKhattabi, 03-06-2026, 11:18 AM
            0 responses
            73 views
            0 likes
            Last Post NabilKhattabi  
            Started by Deep42, 03-06-2026, 12:28 AM
            0 responses
            44 views
            0 likes
            Last Post Deep42
            by Deep42
             
            Started by TheRealMorford, 03-05-2026, 06:15 PM
            0 responses
            49 views
            0 likes
            Last Post TheRealMorford  
            Working...
            X