Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Automatic export from the strategy analyzer

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

    Automatic export from the strategy analyzer

    Hi there,

    after an analysis in the strategy analyzer, how is it possible to automatically export the trades that were logged?
    Would I have to write an add-on or how should I proceed?

    #2
    Hi 1001111, thanks for your note.

    Automatic export is not a feature of NinjaTrader. One would need to export strategy results from the strategy itself to get its trade information. There is this example of using excel in NinjaTrader, but it's not officially supported:


    Please let me know if I can assist any further.
    Chris L.NinjaTrader Customer Service

    Comment


      #3
      Hi there,

      Thank you very much.

      For one thing, I don't think Exel is a good format for transferring data.
      I think CSV or JSON is better.
      I didn't want to implement my own log either. Instead, use the existing log.

      Yes, I know that this function does not yet exist in Ninja.
      Would like a tip on how I can proceed if I want to implement this.

      e.g. where are the logs stored in ninja?
      How does the software recognize that the strategy analyzer has completed the run?

      Comment


        #4
        Hi 1001111

        The logs are stored in Documents\NinjaTrader 8\strategyanalyzerlogs. One would need to have the program detect new files within this directory and perform operations on the xml file that is generated. Unfortunately, this type of project would be outside of the scope of support I can provide for NinjaTrader.

        Please let me know if you have any questions.
        Chris L.NinjaTrader Customer Service

        Comment


          #5
          Thank you very much.

          Can you also say where the individual trades of an analysis are saved?
          Or are they always only determined temporarily and not cached?

          Comment


            #6
            Hello 1001111,

            The trades in the analyzer would be held in memory, for those if you want to export them the easiest way would be to have the strategy write the data to file as it tests.




            I think CSV or JSON is better.
            Yes, I know that this function does not yet exist in Ninja.
            Would like a tip on how I can proceed if I want to implement this.
            We have a basic sample of writing to file: https://ninjatrader.com/support/help...o_write_to.htm

            The format you choose to write the data in would be up to you. While we can't assist with learning how to use different data formats like JSON or CSV there are many C# tutorials you can find which offer that type of information. You mainly need information related to C# development, for example you could search online for "how to read/write JSON in C#" if you wanted to use JSON specifically.

            As a side note I didn't see a feature request for an automatic export from the analyzer, I will put that in as well.



            I look forward to being of further assistance.


            JesseNinjaTrader Customer Service

            Comment


              #7
              Hi there,

              I probably put it wrong.

              So I don't want to create or edit a strategy. That wouldn't work at all, because you don't have the source code for every strategy. And it would be an enormous effort if you had to edit each strategy manually. That is not my solution.

              Instead, I want to automatically export the results that the Strategy Analyzer determines.
              C # or writing to a file is not a problem.




              I just need a small approach on how to access the trades being analyzed.

              1. I assume that the settings of each strategy are cached and the respective logs / trades of each strategy are created temporarily?

              2. How do I start the Strategy Analyzer including transfer of the parameters using C #?

              3. How do you then access the trades?

              4. Can you solve this with an independent add-on?



              As an example: I would like to export the data records in the image.

              Comment


                #8



                1001111,



                ninjatrader's strategy analyzer generates accurate, reliable backtests and optimizations. it is the best i have used in that regard.



                but other than that, it is pretty horrible to work with.


                - i have to save 2 screengrabs with the results and parameters of each optimization i run.


                - optimizations only run one by one, there's no way in nt to crate a queue of optimizations so that the platform will run them on its own.


                - it is also impossible to apply the optimal parameters the engine has found to out of sample data with ease or to apply them to a chart so that the strategy will trade automated.


                - plus there are some malfunctions i have encountered.


                i hope your requests and suggestions do get anywhere, my experience has been that that is never the case. if you are a very advanced c# programmer then possibly you can create some of the solutions you need by yourself, but that's not the case with ordinary users.

                Comment


                  #9
                  Hello 1001111,

                  At this time you would have to edit the strategy for that type of logging. The items you are asking for are not exposed by the analyzer to where you could access that from an outside source like an addon. I did put in a feature request for an automated way to export from the analyzer to accommodate this goal but for the time being that would need to be put in the strategies code to do that.

                  You can also review the Optimization fitness types and also the Optimizers and PerformanceMetrics to see if some combination of those types could help to export what you need. I wouldn't have a specific suggestion toward logging from those types but those are essentially what drives the strategy analyzer, if you were to add logging those types would likely be where it needs to be added. The fitness type specifically has access to the trade collection so that may be of use. The parameters would be part of the Optimizer so that disconnect may be difficult if you wanted to log both the trades and parameters.



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

                  Comment


                    #10
                    Thank you for the effort

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by LawrenHom, Today, 10:45 PM
                    0 responses
                    3 views
                    0 likes
                    Last Post LawrenHom  
                    Started by love2code2trade, Yesterday, 01:45 PM
                    4 responses
                    28 views
                    0 likes
                    Last Post love2code2trade  
                    Started by funk10101, Today, 09:43 PM
                    0 responses
                    7 views
                    0 likes
                    Last Post funk10101  
                    Started by pkefal, 04-11-2024, 07:39 AM
                    11 responses
                    37 views
                    0 likes
                    Last Post jeronymite  
                    Started by bill2023, Yesterday, 08:51 AM
                    8 responses
                    44 views
                    0 likes
                    Last Post bill2023  
                    Working...
                    X