Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Cumulative volume at price in the DOM

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

    #16
    Bid Ask Cumulative total

    First let me start by saying I am a newbie to C#; so, I apologize in advance for the simplicity of my question.

    What I am trying to accomplish is a cumulative total of the Current Ask Volume - Current Bib Volume for this bar.

    Code:
    		protected override void OnBarUpdate()
           
             {
    			double x1 = 0.0;
    			double x2 = x1 + (GetCurrentAskVolume()-GetCurrentBidVolume());
    			set
    			{
    				x1=x2;
    			}
    			
    			TBTF.Set(x1);
    		}
    Am I way off base here?

    Thanks in Advance! Cheers,

    Sody

    Comment


      #17
      Hello SodyTexas,

      Thanks for your post.

      By cumulative, are you asking for the accumulated difference of ask volume minus bid volume for all previous bars?

      Please try:

      Code:
      double x2 = 0;
      protected override void OnBarUpdate()
      {
      x2 += (GetCurrentAskVolume()-GetCurrentBidVolume());
      TBTF.Set(x1);
      }
      Also, please notice I am declaring x2 outside of OnBarUpdate().

      Let me know if this is not what you were after.
      Chelsea B.NinjaTrader Customer Service

      Comment


        #18
        Hello SodyTexas,

        I made a tiny mistake with that last post and am not able to edit my previous post.

        Code:
        double x2 = 0;
        protected override void OnBarUpdate()
        {
        x2 += (GetCurrentAskVolume()-GetCurrentBidVolume());
        TBTF.Set([B]x2[/B]);
        }
        The TBTF.Set should be set to x2 and not x1.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #19
          Originally posted by NinjaTrader_ChelseaB View Post
          Hello SodyTexas,

          I made a tiny mistake with that last post and am not able to edit my previous post.

          Code:
          double x2 = 0;
          protected override void OnBarUpdate()
          {
          x2 += (GetCurrentAskVolume()-GetCurrentBidVolume());
          TBTF.Set([B]x2[/B]);
          }
          The TBTF.Set should be set to x2 and not x1.
          Awesomeness, you where very quick and accurate. What a great experience for a first time poster!

          Thanks a million.

          Sody

          Comment


            #20
            Hi there.
            I´m looking for something similar. Is it possible to see the volume delta (difference between traded buyers volume - traded sellers volume) on the price axis? Like volume profile / zones?

            Comment


              #21
              Hello bdfranca,

              Something like what you are trying to build may be possible.

              The Market Data volume can be captured in OnMarketData.


              The e.MarketDataType will let you know if this is bid or ask data.

              You could store the volume, and then subtract one from the other, and plot this in a plot.

              Below is a link to a script that is similar to the Time & Sales window you may find helpful.
              Chelsea B.NinjaTrader Customer Service

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by CarlTrading, 05-11-2026, 05:56 AM
              0 responses
              27 views
              0 likes
              Last Post CarlTrading  
              Started by CarlTrading, 05-10-2026, 08:12 PM
              0 responses
              20 views
              0 likes
              Last Post CarlTrading  
              Started by Hwop38, 05-04-2026, 07:02 PM
              0 responses
              183 views
              0 likes
              Last Post Hwop38
              by Hwop38
               
              Started by CaptainJack, 04-24-2026, 11:07 PM
              0 responses
              335 views
              0 likes
              Last Post CaptainJack  
              Started by Mindset, 04-21-2026, 06:46 AM
              0 responses
              260 views
              0 likes
              Last Post Mindset
              by Mindset
               
              Working...
              X