Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

accessing the cumulative volume in t&s window?

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

    accessing the cumulative volume in t&s window?

    is there a method or property to access the cumulative volume that is present in the t&s window? maybe some function or something in OnMarketData()?
    Click image for larger version

Name:	Capture.JPG
Views:	1
Size:	12.2 KB
ID:	891863

    #2
    In OnMarketData() monitor for e.DailyVolume.
    RayNinjaTrader Customer Service

    Comment


      #3
      is this statistic available through/with ZenFire? I get an error trying to access it...
      Jim-Boulder
      NinjaTrader Ecosystem Vendor - Elephant Tracks

      Comment


        #4
        Yes Jim, I believe it's accessible - what exact error would you get when trying to do so?
        BertrandNinjaTrader Customer Service

        Comment


          #5
          Found Error

          Thanks for the rapid response,

          After your response-I revisited this and discovered the error was in the syntax I was using (imagine that-a user error!!)...for those looking for the same thing I was, the working code is something similar to the following:

          if (e.MarketDataType == MarketDataType.Last )

          {
          dvolume = e.MarketData.DailyVolume.Volume;
          }


          Can you verify this is the best way to get this statistic? Specifically, is it best to use the "last" event to get this?

          J.
          Jim-Boulder
          NinjaTrader Ecosystem Vendor - Elephant Tracks

          Comment


            #6
            You're welcome, you could access the DailyVolume event directly as well as part of L1 data -

            Code:
             
            protectedoverridevoid OnMarketData(MarketDataEventArgs e)
            {
            if (e.MarketDataType == MarketDataType.DailyVolume) 
            Print("DailyVol = " + " " + e.Volume);
            }
            BertrandNinjaTrader Customer Service

            Comment


              #7
              Keep volume value persistent

              Hi,
              I display the running volume on the chart. However, after cash close, the volume value resets to ETH volume. I need to keep the RTH value persistent after close and not show the ETH volume at all. How do I do that?

              Here is my code (but fails to achieve the above)

              Code:
              protected override void OnMarketData(MarketDataEventArgs e)
              		{
              
              			if (e.MarketDataType == MarketDataType.DailyVolume)
              			{
              				if (Instrument.MasterInstrument.Name == "ES")
              				{
              					if (ToTime(Time[0]) < 083000)
              						ETHsession = e.Volume;
              					else if (ToTime(Time[0]) >= 083000 && ToTime(Time[0]) < 151459)
              					{
              						RTHsession = e.Volume - ETHsession;
              						tempVol = RTHsession;
              					}
              					else if (ToTime(Time[0]) > 151500)
              						RTHsession = tempVol;
              				}
              }
              Last edited by kashter; 08-30-2011, 07:59 PM.

              Comment


                #8
                kashter, the general idea is correct : you would need to store the figure needed at your desired time point so you can keep it as a reference then, please add prints in your code to debug why this is not working out as you expect currently.

                BertrandNinjaTrader Customer Service

                Comment


                  #9
                  Hi Bertrand,
                  Tried the debug but I fail to discover the issue. Will try it out more on the weekend - not much of a coder!
                  Thx anyway.

                  K

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by Jon17, Today, 04:33 PM
                  0 responses
                  1 view
                  0 likes
                  Last Post Jon17
                  by Jon17
                   
                  Started by Javierw.ok, Today, 04:12 PM
                  0 responses
                  5 views
                  0 likes
                  Last Post Javierw.ok  
                  Started by timmbbo, Today, 08:59 AM
                  2 responses
                  10 views
                  0 likes
                  Last Post bltdavid  
                  Started by alifarahani, Today, 09:40 AM
                  6 responses
                  41 views
                  0 likes
                  Last Post alifarahani  
                  Started by Waxavi, Today, 02:10 AM
                  1 response
                  20 views
                  0 likes
                  Last Post NinjaTrader_LuisH  
                  Working...
                  X