Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to access tick-by-tick data in a historical data?

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

    How to access tick-by-tick data in a historical data?

    Everyday I woke up and start an strategy I have in my NT7, it works fine and I got the data I need in a tick-by-tick basis for I am running on real time feed, problem is I need to access the tick-by-tick data of yesterday and once I stop my script I no longer have that info. I saw NinjaTrader have the data for I can see it in the Historical Data Manager Window, how can i do it in a Strategy script?

    #2
    Hello rstriquer,

    Thank you for writing in.

    If you wish for your script to access historical tick data, you will need to add a secondary tick series to your script.

    More information about working with scripts with multiple series can be found here: https://ninjatrader.com/support/help...nstruments.htm

    Please, let us know if we may be of further assistance.
    Zachary G.NinjaTrader Customer Service

    Comment


      #3
      It does not work, lets say I do this ...

      Code:
      protected override void Initialize() {
          CalculateOnBarClose = false;
      }
      protected override void OnBarUpdate() {
          if (!Historical) {
              Print(Close[0]);
          }    
      }
      If I am working on a real time data the Close[0] delivers me data every tick, but whenever I am working on Historical data it gets me only the last tick data of the bar. How can I get the "intra data" of the bar on a historical bar?

      Comment


        #4
        Hello,

        Thank you for the reply.

        As Zachary posted, you would need to add a 1 tick secondary series to see intrabar data historically.

        There is a sample here: http://ninjatrader.com/support/forum...ead.php?t=6652

        Additionally there is a sample strategy called SampleMultiTimeFrame that comes with the platform, this sample demonstrates adding a secondary series and limiting the logic to the BarsInProgress index.

        Close[0] specifically will always return the last Closed bars value of the Primary series being processed. This would entail that if you were on a 5 minute series, this would either report the last 5 minute closed bar, or each Tick in realtime with COBC = false. Historically this would not make a difference, instead you could Add a secondary series and use the BarsInProgress index to delegate logic. using the secondary series you could see OnBarUpdate called for each tick of the 1 tick series to do logic.

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

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by rocketman7, Today, 01:00 AM
        0 responses
        1 view
        0 likes
        Last Post rocketman7  
        Started by wzgy0920, 04-20-2024, 06:09 PM
        2 responses
        27 views
        0 likes
        Last Post wzgy0920  
        Started by wzgy0920, 02-22-2024, 01:11 AM
        5 responses
        32 views
        0 likes
        Last Post wzgy0920  
        Started by wzgy0920, 04-23-2024, 09:53 PM
        2 responses
        74 views
        0 likes
        Last Post wzgy0920  
        Started by Kensonprib, 04-28-2021, 10:11 AM
        5 responses
        193 views
        0 likes
        Last Post Hasadafa  
        Working...
        X