• 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

Reading tick stream data for non-tick bar types?

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

    Reading tick stream data for non-tick bar types?

    Is there a way to read the tick stream data from within an indicator when you're not using a tick-type bar?

    In one of the indicators I bought, it prints a message to the output window reading "[indicator name] adding Tick stream".

    So, is there a way to install a hook, such as a market data handler, in a C# indicator that allows the indicator to read the tick data for the current bar, even if it's a range or time based bar?

    #2
    Hello,

    Thank you for the question.

    The easiest way to add tick based data would be the OnMarketData override. Keep in mind this only works in realtime, in the case you also need historical data you would need to add a Secondary series.

    We have infomration on both topics, for OnMarketData please see this information:
    http://ninjatrader.com/support/helpG...marketdata.htm
    http://ninjatrader.com/support/helpG...arketdepth.htm

    For information on multi series scripts, I would suggest reviewing this page as a starting point:
    http://ninjatrader.com/support/helpG...nstruments.htm

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Thanks for your help with this. The indicator I mentioned prints the message "[indicator name] adding Tick stream" to the output window even if I don't have the indicator on any charts, so it has somehow installed a hook that makes NT invoke it somehow as a global static function, or something similar to that.

      I was hoping that if I could install a similar type of global hook, that I would be able to get around the fact that OnMarketData only works in real time.

      What I want is to use range bars but also get tick data and be able to test historical data, so what I could do is make a new bar type that is a tick-type bar but acts as a range bar and then makes its tick data available to my indicators through a public static function.

      However, that would be kind of a hack, I was thinking that there's a more direct way with the global type hook the other indicator I mentioned uses?

      Comment


        #4
        Hello,

        Thank you for the reply.

        What you are describing sounds like it could potentially be a indicator that the developer has forgot to put in a un subscription from some event handler they had subscribed to, although it is possible they are using unsupported code as well. This would not be advised in any case, in the case they did leave a handler un subscribed, it can become a memory leak or the more times the indicator is applied those prints will stack up.

        Unfortunately there would be no equivalent to this using supported methods or anything I could recommend. A indicator is instantiated when you apply it to a chart and would begin running its logic, that would be the only supported approach at applying indicator calculations.

        The standard way to add tick data to a indicator would be as described before by adding a 1 tick series in the indicator its self using Add(). This was made specifically for this reason and would work historically and in realtime, otherwise OnMarketData can be used but that is realtime only as described.

        I look forward to being of further assistance.
        JesseNinjaTrader Customer Service

        Comment


          #5
          Thanks, is there documentation on ninjatrader event handlers? I searched google for "ninjatrader subscription event handler" but didn't see something like that. Can you post a link or a search term for it?

          Comment


            #6
            Hello,

            Thank you for the reply.

            There is actually no documentation on this subject because using documented syntax you would never need to use an event handler in NinjaScript.

            There are certainly internal event handlers which can be located by using Intelleprompt or Visual studio but these are advanced programming topics which we have no documentation on.

            In general event handlers in the platform are found by self exploration in NinjaScript and experimentation. We do not suggest using unsupported code though as we have no expected result for what it should do in NinjaScript. Items like event handlers are generally used internally for a specific purpose but as said have no real use in NinjaScript to start with so there is no expectation for it to work in all situations.

            There is no event handler I know of related to what you had described, you could ask the vendor of that item if it is expected that the indicator is performing the way it is. If so, you could ask for an example of how they accomplished that. You can locate general information on events here:
            https://msdn.microsoft.com/en-us/library/awbftdfh.aspx


            I look forward to being of further assistance.
            JesseNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by liltr3d, Yesterday, 10:52 PM
            1 response
            7 views
            0 likes
            Last Post NinjaTrader_PaulH  
            Started by marekflys, Yesterday, 03:07 PM
            1 response
            16 views
            0 likes
            Last Post NinjaTrader_EricB  
            Started by w0lverine, Today, 03:57 AM
            1 response
            4 views
            0 likes
            Last Post NinjaTrader_ChrisSch  
            Started by hundert, 02-24-2019, 07:55 AM
            2 responses
            43 views
            0 likes
            Last Post jpraema
            by jpraema
             
            Started by digibob, Today, 02:47 AM
            0 responses
            3 views
            0 likes
            Last Post digibob
            by digibob
             
            Working...
            X