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 Irukandji, Yesterday, 02:53 AM
              2 responses
              17 views
              0 likes
              Last Post Irukandji  
              Started by adeelshahzad, Today, 03:54 AM
              0 responses
              3 views
              0 likes
              Last Post adeelshahzad  
              Started by CortexZenUSA, Today, 12:53 AM
              0 responses
              3 views
              0 likes
              Last Post CortexZenUSA  
              Started by CortexZenUSA, Today, 12:46 AM
              0 responses
              1 view
              0 likes
              Last Post CortexZenUSA  
              Started by usazencortex, Today, 12:43 AM
              0 responses
              5 views
              0 likes
              Last Post usazencortex  
              Working...
              X