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

Loading data question

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

    Loading data question

    Hi

    1) is there a way to directly change the ndf data files in the dB folder? Has anyone tried it? Adverse affects?

    2) if I have a strategy that is trading live. Say the EOD close time is 7pm. And I manually import EOD data using the documented inport methods from a text file for a data series that I have within my strategy. What happens? Does the strategy see it on bar close? How much time do I have to update the newer data? Say the close is for 7-7-2018... at 7pm... and I update the data at 9 pm... what values is NT going to use between 7pm and 9pm? Will it be the data for 7-6-2018? If so, how many days can you go without updating the data for one of the data series within a strategy (NOTE: the data series is NOT primary)?

    3) say my primary data series is 1 min... following the example in 2: if I update the EOD values from 7-7-2018 at 9pm using the documented import method from a text file... will NT start seeing the value at 9:01 pm on bar close and trade accordingly?

    4) is there any AUTOMATED method of importing data in the db ? I’m not talking about streamwriter/reader.

    5) is there a way to write to the database using ninjascript? I’m able to pull in data using ninjascript using excel method and chart it... but how can I permanently write to the underlying symbol? Is there a function for updating symbol data in ninjasceipt?
    Thank you
    Last edited by staycool3_a; 09-25-2018, 11:16 PM.

    #2
    Hello staycool3_a,

    Thank you for the post.

    Regarding the first item, the files used in the DB folder are all internal ninjatrader formats so I would have no suggestions surrounding modifying or reading these files. The same would go for the database file, there is no suggestion on reading or editing this file. I will say this should be avoided as this could lock the files preventing NinjaTrader from reading or writing to them. This will also be a good question for community members to post on in case they have any other suggestions here.

    When you import historical data that simply imports the data but does not immediately apply the data to existing charts or active scripts. For your live strategy to see the change, you would need to disable it and reload the historical data then re-enable it. If it is applied to a chart you can reload the historical data and the re-enable it, otherwise, from a control center applied strategy it would re-request data when it is enabled.

    A historical data request is part of the state change process where you transition from historical to live data. Once you transition that's it, you are in real-time. You can look into using a BarsRequest in the script if this is something simple like gathering a price, but I would not suggest this for more complex scenarios. This would include areas such as passing that data to indicators or any use that requires a Series really.

    There is currently not an automated tool to import data, this would only consist of the GUI tools in the historical data manager. You can, however, review the following post which shows a way to use ImportType and an Addon to import data https://ninjatrader.com/support/foru...11&postcount=5

    The last question is not clear, are you referring to updating an instrument and one of its properties or the historical data for an instrument?


    Please let me know if I may be of additional assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Questions are bolded below your response.

      Originally posted by NinjaTrader_Jesse View Post
      Hello staycool3_a,

      When you import historical data that simply imports the data but does not immediately apply the data to existing charts or active scripts. For your live strategy to see the change, you would need to disable it and reload the historical data then re-enable it. If it is applied to a chart you can reload the historical data and the re-enable it, otherwise, from a control center applied strategy it would re-request data when it is enabled.

      If I import data from a text file using default methods of importing data and I have my strategy enabled in chart -> and I reload the data after I import the data -> wouldn't reloading the historical data automatically disable the strategy/script? If not, can you pls confirm that the strategy will ackowledge/see the new imported data as a secondary data series?

      I'm still confused as to why a simple "update" using import GUI method won't update the data series for the strategy that is active... isn't that the same as fresh EOD prices coming in from a data provider at the close of the day? That's why I was asking about the timing window


      A historical data request is part of the state change process where you transition from historical to live data. Once you transition that's it, you are in real-time. You can look into using a BarsRequest in the script if this is something simple like gathering a price, but I would not suggest this for more complex scenarios. This would include areas such as passing that data to indicators or any use that requires a Series really.

      I have not had the time to do so, but it's a fairly simply process. All i am doing is using outside daily data that I cannot get from ANY data providers (beleive me on this) so I have to manually import this data into NT. The strategy is just making a decision from the close of the value... if the value is above/below a certain number.

      There is currently not an automated tool to import data, this would only consist of the GUI tools in the historical data manager. You can, however, review the following post which shows a way to use ImportType and an Addon to import data https://ninjatrader.com/support/foru...11&postcount=5

      The last question is not clear, are you referring to updating an instrument and one of its properties or the historical data for an instrument?

      Yes, I am referring to updating the instrument's historical data in NT database. Would be nice to be able to automatically update data from within the strategy... if it's able to see the data from an excel file... isn't there a function that can update the historical data?

      I'm pretty worried about this process to be honest. Because I am not wanting to disable the strategy every single day just to enter OHLC ( it's actually just the closing price) price for a data series.... my entire strategy depends on keeping track of live/previous trade performance statistics.. disabling the strategy already deletes that content (which is something SUPER poor about NT.. in my opinion.. you guys really need to figure out to store that data.. what's the point of automated trading if all the trade performance statistics cant even be stored for real time trading, clearly strategies are going to have to be disabled for a million reasons.. and boom.. all the trade statistics are gone... it shouldn;t be only for historical data/testing as that makes NT a backtesting tool rather than real time. writing them to a external file is a whole different array of complexity and issues.

      Please let me know how I can get this data in NT without having to disable my strategy. Else... i'll have to input the data series as an indicator from excel and then I'll have to keep excel open 24/7 along with NT


      Please let me know if I may be of additional assistance.

      Comment


        #4
        Hello staycool3_a,

        Thank you for your response.

        Reloading Data on the chart will reload the strategy as well. Importing Historical Data will not update the existing data on the chart nor the strategy. There is no option to automatically update the Historical Data in the database. Unfortunately, the disable and enable of the strategy is required to see the newly imported historical data.

        Please let me know if you have any questions.

        Comment


          #5
          Originally posted by NinjaTrader_PatrickH View Post
          Hello staycool3_a,

          Thank you for your response.

          Reloading Data on the chart will reload the strategy as well. Importing Historical Data will not update the existing data on the chart nor the strategy. There is no option to automatically update the Historical Data in the database. Unfortunately, the disable and enable of the strategy is required to see the newly imported historical data.

          Please let me know if you have any questions.
          The addon method that Jesse suggested:



          Will that also require the enable/disable of the strategy for it to see the newer data? I'm a bit confused why the strategy must be disabled for it to see newer data... then how does it see incoming data from data provider?

          Comment


            #6
            Hello staycool3_a,

            Thank you for your response.

            An Import Type is a NinjaScript Object that you create for importing data in NinjaTrader. It is not automated nor will it update the data a strategy is running on.

            Importing data is historical data, historical data is not constantly updated on the chart. Charts and your strategies receive realtime data which is cached from the point the chart was opened or the strategy was started but all data prior is historical and is not updated.

            Importing data WILL NOT update the charts or strategies. You must reload the historical data on the charts or disable and enable a strategy on the strategies tab of the Control Center in order to see the new data.

            There is no means around this fact.

            Please let me know if I may be of further assistance.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by mgco4you, Today, 09:46 PM
            1 response
            2 views
            0 likes
            Last Post NinjaTrader_Manfred  
            Started by wzgy0920, Today, 09:53 PM
            0 responses
            3 views
            0 likes
            Last Post wzgy0920  
            Started by Rapine Heihei, Today, 08:19 PM
            1 response
            8 views
            0 likes
            Last Post NinjaTrader_Manfred  
            Started by Rapine Heihei, Today, 08:25 PM
            0 responses
            6 views
            0 likes
            Last Post Rapine Heihei  
            Started by f.saeidi, Today, 08:01 PM
            1 response
            9 views
            0 likes
            Last Post NinjaTrader_Manfred  
            Working...
            X