Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Exporting Trade by Trade data by batch

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

    Exporting Trade by Trade data by batch

    Hi Guys, On a single instrument back-test it is simple enough to export data, but on a batch test on an Instrument List it is rather tedious to go through one by one. Is there a facility to save all the individual trade by trade files at once? Alternatively, could someone please drop me some sample code to include in my Strategy Scripts to export trade by trade or other performance data to files. Thanks and regards,

    #2
    Aspirant,

    You could have your strategies individually write this information using the following samples :





    Please let me know if I may assist further.
    Adam P.NinjaTrader Customer Service

    Comment


      #3
      Thanks Adam,
      I understand I can do file read-writes. My problem is now, how do I close the file?
      More specifically, how can I tell that I have come to then end of a sim on a datafile so I can close the file and start a new one?

      Comment


        #4
        Hello Aspirant,
        Thanks for writing in and I am replying for Adam.

        You can use the OnTermination event to close the files. Please refer here for more http://www.ninjatrader.com/support/h...ermination.htm

        Please let me know if I can assist you any further.
        JoydeepNinjaTrader Customer Service

        Comment


          #5
          Hi Joydeep,
          "OnTermination" seems to work when the simulation is closed, but if I am running a batch of simulations across multiple instrument the process is not terminating when it switches from from symbol to another, but I need to be able to close the file pertaining to the previous market, then open and commence writing to a new file.

          What command can I do to achieve this?

          Comment


            #6
            Aspirant,

            How are you adding these symbols into your strategy?

            If you are doing it in the Initialize() method, you could close the file using some BarsInProgress filters, closing the previous file before opening a new one.
            Adam P.NinjaTrader Customer Service

            Comment


              #7
              Hi Adam,
              My preference would be to fire off the whole simulation run remotely, but for now I'm open to any solution that allows me to close a file, so let's keep it simple.

              Let's say I'm in Strategy Analyzer doing a simulation run on an "instrument list."

              You mention the "BarsInProgress" but this cycles every session! I need a way to identify that the simulation has reached the end of the file and wants to move to the next so that I can close the current file.

              Comment


                #8
                Don't worry, I tracked it down... I think the following should give me the last bar on the current chart.


                Bars.Count -2

                Comment


                  #9
                  Aspirant,

                  I am happy you have resolved your issue.

                  Please don't hesitate to contact us should you require additional assistance.
                  Adam P.NinjaTrader Customer Service

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by rtwave, 04-12-2024, 09:30 AM
                  4 responses
                  29 views
                  0 likes
                  Last Post rtwave
                  by rtwave
                   
                  Started by yertle, Yesterday, 08:38 AM
                  7 responses
                  28 views
                  0 likes
                  Last Post yertle
                  by yertle
                   
                  Started by bmartz, 03-12-2024, 06:12 AM
                  2 responses
                  21 views
                  0 likes
                  Last Post bmartz
                  by bmartz
                   
                  Started by funk10101, Today, 12:02 AM
                  0 responses
                  6 views
                  0 likes
                  Last Post funk10101  
                  Started by gravdigaz6, Yesterday, 11:40 PM
                  1 response
                  9 views
                  0 likes
                  Last Post NinjaTrader_Manfred  
                  Working...
                  X