• 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

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(x2);
        }
        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(x2);
          }
          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.
              https://ninjatraderplatform.helpspot...&reqid=1618392

              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.
              http://ninjatrader.com/support/forum...250#post414250
              Chelsea B.NinjaTrader Customer Service

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by [email protected], Yesterday, 07:45 AM
              1 response
              8 views
              0 likes
              Last Post koganam
              by koganam
               
              Started by tgn55, Today, 07:22 AM
              0 responses
              2 views
              0 likes
              Last Post tgn55
              by tgn55
               
              Started by U0000999, Today, 05:17 AM
              0 responses
              4 views
              0 likes
              Last Post U0000999  
              Started by Prataturry89, Today, 03:40 AM
              0 responses
              5 views
              0 likes
              Last Post Prataturry89  
              Started by UltraFastKetoBoost28, Today, 02:43 AM
              0 responses
              6 views
              0 likes
              Last Post UltraFastKetoBoost28  
              Working...
              X