Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Is it possible to export monthly data in Ninjatrader?

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

    Is it possible to export monthly data in Ninjatrader?

    Hi all,

    I was recently able to successfully export daily data from the S&P 500 index to a *.txt file and finally Excel. Excellent.

    I would LOVE to do the same for weekly or monthly data.

    Possible?

    Thanks in advance for all help.

    Johnny

    #2
    Hello Johnny,

    Thanks for your post.

    NinjaTrader stores 3 bar types, Day bars, Minute bars and 1 tick bars. All other bar types are made from these. There are no means within the historical data manager to export other than day, minute or tick bars.

    You would need to create an indicator to write the chart bar data and any other information (such as volume) to a text type file that you could then do further processing. We do have a sample indicator of exporting the chart data however the example only exports the OHLC. Here is a link to the reference sample, which you can use as is or modify as you wish: https://ninjatrader.com/support/foru...ead.php?t=3475 Note: The sample will output a file called MyTestFile.txt in your NinjaTrader folder.
    Paul H.NinjaTrader Customer Service

    Comment


      #3
      Great! Thanks!

      I didn't quite understand how the indicator *.txt file is updated though.

      Is it continually updated as long as the indicator is running at the bottom of your screen? Or is there a way to make it update?

      Just tested it very quickly and it looks good.

      Comment


        #4
        Hello Johnny,

        Thanks for your reply.

        What I suggest is to create a chart of whatever bar size is needed and set the number of days of data needed to gather all of your historical data. Once you see the data, then add the indicator to the chart, the indicator will immediately create the text file and populate with all of the historical data up to the latest complete bar, after a minute you could remove the indicator and can then access the file.

        If you leave it on the chart, then yes it would update on each new bar close.
        Paul H.NinjaTrader Customer Service

        Comment


          #5
          Thanks a lot, Paul!

          I've used it this morning to download S&P 500 index data for weekly, monthly and yearly timeframe.

          The data does seem to be correct except for a few rows of missing data. I haven't been able to go over all the data, but calculating percentage change, I had some huge values which made me notice and correct this.

          Is it also correct that using this script/indicator, I'd need to delete the *.txt file and reload the indicator everytime I want to download/update a new series?

          At least that's what I did this time...

          Regards,

          Johnny

          Comment


            #6
            Hello Johnny,

            Thanks for your reply.

            In the notes inside the indicator code it states, "If file at 'path' doesn't exist it will create the file. If it does exist it will append the file."

            So if the file is left there then each run of the indicator would append to the file. The recommendation then would be to remove the file after each run of the indicator as you have done.
            Paul H.NinjaTrader Customer Service

            Comment


              #7
              Appreciate the support, Paul. Thanks!

              Any comments on the dates with missing values? I've also noticed that I have some dates that are double, i.e., the same row is displayed twice...

              This is on weekly, monthly and yearly data.

              Comment


                #8
                Hello,

                Thanks for your reply.

                I would advise checking to ensure that those missing data dates are not weekend or holidays.

                For the double lines, it may be somewhat related to the holidays.

                For either event, it may be worth reloading your historical data and running the sample indicator again.
                Paul H.NinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by bortz, 11-06-2023, 08:04 AM
                47 responses
                1,606 views
                0 likes
                Last Post aligator  
                Started by jaybedreamin, Today, 05:56 PM
                0 responses
                9 views
                0 likes
                Last Post jaybedreamin  
                Started by DJ888, 04-16-2024, 06:09 PM
                6 responses
                19 views
                0 likes
                Last Post DJ888
                by DJ888
                 
                Started by Jon17, Today, 04:33 PM
                0 responses
                6 views
                0 likes
                Last Post Jon17
                by Jon17
                 
                Started by Javierw.ok, Today, 04:12 PM
                0 responses
                15 views
                0 likes
                Last Post Javierw.ok  
                Working...
                X