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

Volume, Ticks - what is what?

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

    Volume, Ticks - what is what?

    First: I'm looking the whole day (and night) for more informations - but i didn't find.

    For my understanding:
    volume = all shares per bar
    tick = is a trade, no matter how much shares

    Now i have a little Problem:
    I create an indicator (using OnMarketData() ) wich cumulates the upvolume and the downwolume per bar depending of bid and ask. Then i calculate the difference. The difference shold be smaller than the whole Volume of the bar. But.....
    Mu indicator shows values far greater than 10k (5 Minutes) and the standard NT-indicator oly shows values belov 10k.... Now is the question: what ist what?

    volume[0] = tick count of actual bar? or real volume (all shares traded on this bar)?
    e.volume = volume of last Tick, cumulated volume since begining of the bar, open interest, bid size ask size?????

    who brings light in my darkness?

    thank you.

    #2
    xenayoo, which instruments are you looking at while testing this? Since I'm not familier with your custom indicator code I could not comment on it and what exactly you arrived at in your calcs, but it might be helpful to print out the Volume[0] value with CalculateOnBarClose set to false (which updates this on each tick), then you can compare to the OnMarketData's volume output...
    BertrandNinjaTrader Customer Service

    Comment


      #3
      I work on ES with ZenFire.
      Here the core-code of my indicator:
      Code:
      protected override void OnBarUpdate()
      {
              // Use this method for calculating your indicator values. Assign a value to each
              // plot below by replacing 'Close[0]' with your own formula.
              if(FirstTickOfBar)
      	{
      		UpVolume = 0;
      		DownVolume = 0;
      	}
      	DeltaVolume = UpVolume + DownVolume;
              VolUp.Set(DeltaVolume > 0 ? DeltaVolume : 0);
              VolDown.Set(DeltaVolume < 0 ? DeltaVolume : 0);
      }
      protected override void OnMarketData(MarketDataEventArgs e)
      {
      	if(e.MarketDataType == MarketDataType.Ask)
      	{
      		UpVolume += (e.Volume);
      	}
      	if(e.MarketDataType == MarketDataType.Bid)
      	{
      		DownVolume -= (e.Volume); 	
      	}
      	LastVolume = e.Volume;
      }
      I want to cumulate real volume to UpVolume or Downvolume depending on if the last price = best did or best ask. I suppose, that i have to use something like
      Code:
      if(e.MarketDataType == MarketDataType.Last)
      but how do I differ the up-/down volume then? Yesterday i found a little codesnipped (with google) with 4 or 5 lines, but i didn't find it again.....
      Last edited by xenayoo; 02-23-2010, 09:03 AM.

      Comment


        #4
        xenayoo, thanks have you already looked at the BuySellVolume study we supply per default?



        You can review those sources in your NinjaScript editor...
        BertrandNinjaTrader Customer Service

        Comment


          #5
          Originally posted by NinjaTrader_Bertrand View Post
          xenayoo, thanks have you already looked at the BuySellVolume study we supply per default?



          You can review those sources in your NinjaScript editor...
          Thank you for that. Little Problem is: I can't print that study (Error, i have to close Ninja....). Anyway, I will look at this. Just a few little Questions:

          MarketDataType can be one of the listed values and these are the events wich can happen in datafeed.
          -Ask and Bid represents every change in the Ask and bid column in SuperDOM.
          -DailyHigh, -Low, -Volume represents what? (could it be that these events are not usable with Zenfire?)
          -Last represents represents the event of the last transaction tick
          -LastClose represents the close of the session (may be unusable with Zenfire?)

          Price represents the price of the last Tick
          Volume rpresents the Volume of the last Tick
          Time represents the Time of the last Tick.

          Is that right?

          Comment


            #6
            Hi there, you are mostly correct in your assumptions.

            The ask and bid represent the best bid and best ask, not the full price ladder.

            The DailyHigh property is simply the day's high price (I believe the time period for this is from midnight-midnight, not the exchange's close time). Same for DailyLow. DailyVolume is the cumulative volume for the day.

            Last is the price of the most recent transaction (tick). Lastly, the LastClose property is the prior session's close price.
            AustinNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by jaybedreamin, Today, 05:56 PM
            0 responses
            7 views
            0 likes
            Last Post jaybedreamin  
            Started by DJ888, 04-16-2024, 06:09 PM
            6 responses
            18 views
            0 likes
            Last Post DJ888
            by DJ888
             
            Started by Jon17, Today, 04:33 PM
            0 responses
            4 views
            0 likes
            Last Post Jon17
            by Jon17
             
            Started by Javierw.ok, Today, 04:12 PM
            0 responses
            12 views
            0 likes
            Last Post Javierw.ok  
            Started by timmbbo, Today, 08:59 AM
            2 responses
            13 views
            0 likes
            Last Post bltdavid  
            Working...
            X