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 Incoming Tick Data

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

    Accessing Incoming Tick Data

    From a user:

    ----------------------------------------------------------------

    I would like to be able to inspect the tick data (not the bar data with open, high, low and close) of each trade in real time in order to build a custom indicator. I looked online at your samples and it looked likeyour samplesdealt with bar data only. I need to receive the raw tick data for each trade in order to accumulate my own data for a custom indicator that I would like to display on the chart, or even as a separate data window that I can dynamically add entries to.

    Can you show me some examples of accessing the raw tick data in Ninjascript? How about opening a separate data window for updates?

    Any help you can provide would be greatly appreciated.

    -----------------------------------------------------------------

    Answer:

    Custom Indicators:
    This depends what you mean by tick data? The OnBarUpdate() method fires each incoming tick (last trade) and you can access the MarketData object which holds properties for ask/bid/last price and volume. If you want to access this object on any change in any market data property, this can be done as well but you would need to create an event handler to fire on this type of market data change event. If this is what you want to do, let me know and I can provide an example. Keep in mind that indicators plot only on incoming last trade tick which is handled by the OnBarUpdate() method.

    Separate Data Window:
    We will be releasing shortly the Ninja QuoteBoard which supports custom columns that can be defined via NinjaScript. You have the option of calculating the column value using:

    - Change in any market data property
    -Each incoming tick
    - Order status event
    - Execution/Fill event
    - Position size change event
    - Account information change event

    There might be others but I can't remember off the top of my head.

    I hope this helps.

    Ray
    RayNinjaTrader Customer Service

    #2
    imported post

    Thanks Ray for the fast response.

    The NT quoteboard sounds interesting.

    What I'm trying to do is this:

    On a 5 minute bar, you have OHLC and volume. I need to break up that volume in to various price levels. e.g., volume of 200 traded at 20.45, 100 at 20.44 and 600 at 20.46. I need to accumulate that volume on each incoming trade tick data and then when we go to next 5 minute window, I will start another count of all price levels that occurred for that 5 minute window. These counts will be accumulating throughout the day. So my data window will show all price levels for 10:00 and then 10:05, 10:10, etc...

    Can this be done on the Quoteboard? If so, what is the time frame for release? And if not, what samples can you provide to allow this? Thanks again in advance.




    Comment


      #3
      imported post

      Yes this can be done with the quote board and it can be done with chart indicators to. Since the OnBarUpdate() method by default fires everytick you can also accumulate this data in some sort of collection object.

      How do you want to display this data?



      Not sure when we will release the QuoteBoard. If you are a subscriber, I would be likely willing to give you access shortly as beta.

      Ray
      RayNinjaTrader Customer Service

      Comment


        #4
        imported post

        Again thanks for the fast reply Ray.

        Yes, I am a paid subscriber. My account is with Eliot at Mirus Futures. I would be very interested in the beta for Quoteboard.

        I just need to display these volumes in a data window. How can I create a data window that I can display my collections through? Do you have sample code that lets me see how to inspect teh Marketdata object with bid/ask/time etc.?

        Thanks.






        Comment


          #5
          imported post

          Actually, we are not going to be able to release the QB for sometime, its complete but there is some underlying changes we need to make so that the QB and Chart indicators use the same pool of market data which is currently not the case.

          That being said, there is no current sample code for this if you still want to do something in the charts.

          You can access:

          MarketData.Ask.Price
          MarketData.Ask.Volume
          MarketData.Ask.Time

          MarketData.Bid.Price
          MarketData.Bid.Volume
          MarketData.Bid.Time

          MarketData.Last.Price
          MarketData.Last.Volume
          MarketData.Last.Time

          You have to check for null references first -

          if (MarketData != null && marketData.Ask != null)
          Print(MarketData.Ask.Price.ToString())

          for example.

          RayNinjaTrader Customer Service

          Comment


            #6
            imported post

            Thank you again.

            I will be trying this out. Will get back to you if I run into problems. Thanks again for all your help. Please keep me abreast of the Quoteboard release.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by briansaul, Today, 05:31 AM
            0 responses
            2 views
            0 likes
            Last Post briansaul  
            Started by fwendolynlpxz, Today, 05:19 AM
            0 responses
            4 views
            0 likes
            Last Post fwendolynlpxz  
            Started by traderqz, Yesterday, 12:06 AM
            11 responses
            28 views
            0 likes
            Last Post NinjaTrader_Gaby  
            Started by PaulMohn, Today, 03:49 AM
            0 responses
            8 views
            0 likes
            Last Post PaulMohn  
            Started by inanazsocial, Today, 01:15 AM
            1 response
            10 views
            0 likes
            Last Post NinjaTrader_Jason  
            Working...
            X