• 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

alBuys vs OnMarketData

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

    alBuys vs OnMarketData

    I have an indicator I did a long time ago which used BuySellVolume at the time as a base and it used theOnMarketData method.

    I just looked at my current ninja base BuySellVolume indicator source code and see it uses a different method of GetCurrentAsk and GetCurrentBid then using "Volume".

    Is there some advantage or pros or cons using the GetCurrentAsk method over OnMarketData? What I have works fine but didn't know if this new method is better in some way. If ninja is using this method I am guessing it is better for some reason.

    Can you enlighten me?
    Last edited by ct; 11-04-2012, 02:11 AM.

    #2
    I changed my indicator to the new method using GetCurrentAsk and seems like it's faster plus it agrees exactly to the VOL indicator where as before I used to get small discrepancies on occasion.

    Comment


      #3
      Hello ct,
      Thanks for your note.

      OnBarUpdate and OnMarketData runs on separate thread and thus the data may differ. Please refer to our help guide to know more.

      4. With NinjaTrader being multi-threaded, you should not rely on any particular sequence of events like OnMarketData() always being called before OnBarUpdate() or vice versa.
      http://www.ninjatrader.com/support/h...marketdata.htm

      If you are comparing/matching the bid/ask price with the last traded price in the OnBarUpdate event then please use GetCurrentBid/GetCurrentAsk functions.
      JoydeepNinjaTrader Customer Service

      Comment


        #4
        Joy


        Thanks for the reply.

        Appreciate the separate threads and event based scenario. It there any performance considerations?

        Comment


          #5
          Hello ct,
          Yes, OnMarketData is the raw data stream and can be CPU intensive depending on your code.

          This is a real-time data stream and can be CPU intensive if your program code is compute intensive (not optimal)
          http://www.ninjatrader.com/support/h...marketdata.htm
          JoydeepNinjaTrader Customer Service

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by FREEN, Today, 10:33 AM
          0 responses
          1 view
          0 likes
          Last Post FREEN
          by FREEN
           
          Started by NoamBarel, Today, 10:11 AM
          1 response
          4 views
          0 likes
          Last Post NinjaTrader_Jim  
          Started by 7robert, Today, 09:41 AM
          2 responses
          7 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by Mykro, Today, 08:42 AM
          1 response
          11 views
          0 likes
          Last Post NinjaTrader_Kate  
          Started by franki, Yesterday, 12:52 PM
          5 responses
          31 views
          0 likes
          Last Post NinjaTrader_Jim  
          Working...
          X