• 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

AddOn able to access tick replay data?

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

    AddOn able to access tick replay data?

    Hi there,

    I have an AddOn which gets OnMarketData() and OnMarketDepth() correctly from the point it launches. Unclear if/how can run the tick replay through this???

    My AddOn creates an Indicator which it sends the Market/Depth info to for processing. This works fine but would like to send all tick data to it on startup.

    The "TickReplayIndicator" I have seen mentioned and have tried to put that in the OnStateChange() handlers under State.DataLoaded to get something happening.

    Unfortunately I am unable to resolve where TickReplayIndicator is declared to include it so can't even compile. Any help?

    -Jim

    #2
    Hello JimB17,

    Thanks for writing in to our Support Forums!

    I believe you are referring to this section of the help guide on Developing for Tick Replay.

    Code:
    TickReplayIndicator myTickReplayIndicator = null;
     
    protected override void OnStateChange()
    {
      if (State == State.SetDefaults)
      {
          Name   = "TestHost";
      }
      else if (State == State.DataLoaded)
      {
          // Store a reference to the Tick Replay indicator before State.Historical
          // Doing so ensures the hosted indicator will run through Tick Replay
          myTickReplayIndicator = TickReplayIndicator();
     
          // For a strategy, you can just call AddChartIndicator(TickReplayIndicator());
          // However this also adds a copy of the indicator to the chart, which may or may not be desired
          // For calculation purposes only, storing the reference should all that needs to be required.
      }
    }
     
    protected override void OnBarUpdate()
    {
      // Access the stored reference which calculates through
      // historical Tick Replay data and print the value as expected
      Print(myTickReplayIndicator[0]);
    }
    https://ninjatrader.com/support/help...ick_replay.htm

    The TickReplayIndicator type is a place holder for an indicator that you develop that uses Tick Replay.

    Can I verify, have you created your indicator that uses Tick Replay and have you added that to your add-on when (State == State.DataLoaded) in OnStateChange()?

    Have you enabled Tick Replay in the primary data series as directed in the help guide linked above?

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

    Comment


      #3
      Thanks for the quick response.

      Yes am referring to that code segment. Now I understand the TickReplayIndicator is my indicator so that fills in that fuzzy part. Why could not find it!

      I am not adding the indicator during OnStateChanged() in the class derived from the AddOnBase() class. My AddOn is using a Tab Control and multiple Tabs. The Indicator which would like to get the replay data lives on each tab page which is added. I add it when the tab page is added and go from there... Is there an OnStateChanged() called at the NTTabPage() level which is where my indicator lives? If that is the case perhaps can insert the call at that level...

      Update: The OnStateChanged() doesn't seem to be around for the Tab pages. If there is a way to Reload the Tick Data via some object or call once my Indicator is setup? it should be easy to iterate through elements in the Tick Data file. Any way to manually suck in the historical tick data info like occurs on a reload on a Chart?
      Last edited by JimB17; 03-14-2017, 12:19 PM.

      Comment


        #4
        Hello JimB17,

        Thanks for writing back.

        I have asked the development team on this matter.

        There is currently no supported way for an Add-On (not a strategy or an indicator) to access Tick Replay.

        If you wish, I may submit a feature request for this on your behalf.

        In the meantime, you may wish to have your indicator write to a global space to access it with your Add-On. This is an approach that is not documented in our help guide and there is not any official support we can provide. If you wish to proceed, you may look into the publicly available MSDN C# documentation which will guide you toward putting together a global scope file in NinjaTrader 8.

        https://msdn.microsoft.com/en-us/library/c3ay4x3d.aspx

        Keep in mind, you will want to add some logic surrounding your global objects.

        Please let me know if you would like me to submit a feature request for you.
        JimNinjaTrader Customer Service

        Comment


          #5
          Hey thanks Ninja Jim!

          Appreciate the update, and going all the way to Dev staff to find out. And info about global namespace.

          If you ask Dev staff to add anything believe would need an object that lets me access Tick Replay itself not just adding methods to an AddOn. This because actually have four tabs each with three indicators so there are twelve total instances of my Indicator which would need replay run through. (this could multiply as well!)

          I could have each tab load and run through its set of indicators, but that would still be four independent streams of replay needed. Would kinda have to be from an object that wraps the entire replay and lets me feed it out to my subordinate object Indicators at startup.

          The use of a global namespace will be quite useful though. I already have instances of an Indicator which use visibly and in a Strategy which Master/Slaves and uses a disk file for info. Can potentially convert this to a global namespace data set rather than disk which is non-optimal. Also what I am doing in AddOn can lead to global info accessed from the Strategy which will be useful.

          Once again thanks for the feedback and if you want to add anything to Dev feature request it would be an Object that lets me Tick Replay not just adding to AddOn.

          However I'd rather see them tune up NT8 before getting to new functionality as time is always limited as a developer. (I am one myself.)

          -Jim

          Comment


            #6
            Hello JimB17,

            I have submitted the feature request to the development team.

            It is being tracked with the ticket ID SFT-2025. This feature's implementation can be found in the Release Notes of the version of NinjaTrader 8 that includes the feature. You can find the Release Notes here: https://ninjatrader.com/support/help...ease_notes.htm

            You may also write into platformsupport[at]ninjatrader[dot]com and reference the ticket ID to request a status update from one of our technical support technicians.

            Please let us know if we may be of further assistance.
            JimNinjaTrader Customer Service

            Comment


              #7
              I have accessed tick replay (indirectly) using Memory Mapped files.
              https://msdn.microsoft.com/en-us/lib...v=vs.110).aspx

              You can stream data from memory or via a file. It behaves a little like a DataSeries but kept in memory. It's super quick. I find it works better than a static method since you can name your MMFs individually by a string and access anywhere within NT8 or any other .Net application ;-)

              I collect all the data from an open chart and store them in a Time/OHLC struct in memory and then access the MMF within another window. I have done this by 'sending' data from the Analyzer to any chart of my choosing. eg. painting backgrounds.
              The only caveat is sometimes it will be out of sync by a tick because some windows update before others.

              I can't provide an example because I don't have any 'loose' code I can give you.

              Hope that's a start for you.

              Comment


                #8
                That's a great idea, can store and handoff from an Indicator which sees the Historic data.

                Thanks for the idea, should be simple.

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by danitralla, Yesterday, 03:33 AM
                1 response
                20 views
                0 likes
                Last Post NinjaTrader_ShawnB  
                Started by ninjo, Yesterday, 11:54 AM
                0 responses
                6 views
                0 likes
                Last Post ninjo
                by ninjo
                 
                Started by deblanka, Yesterday, 08:56 AM
                0 responses
                13 views
                0 likes
                Last Post deblanka  
                Started by Boonfly8, 03-22-2019, 12:30 PM
                7 responses
                24 views
                0 likes
                Last Post sledge
                by sledge
                 
                Started by Sohal, Yesterday, 05:02 AM
                2 responses
                23 views
                0 likes
                Last Post techmint  
                Working...
                X