• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to access the NetProfit sum in the Strategy Analyzer?

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

    How to access the NetProfit sum in the Strategy Analyzer?

    Hi Ninjas, since I hit with a limitation of a max number of lines in a code, I`m trying to solve in other way my problem.

    Imagine that you have a code with a certain simultaneous combination of ten or more variables, which each one of them might be -1, 0 or 1. When I run whatever input combination of this variables in the strategy analyzer as a code, I get a result of multiple fields, but the most important to me is the NetProfit, and I´d like to know if I could get this result internally in a variable that I could use, without taking it from the strategy analyzer result page.

    Thanks

    #2
    Hello pstrusi,

    Thank you for your post.

    You can use the TradesPerformance values of GrossLoss and GrossProfit to factor the NetProfit as GrossProfit - GrossLoss.

    You can find the TradesPerformance values at the following link: http://www.ninjatrader.com/support/h...erformance.htm

    Please let me know if you have any questions.
    Patrick H.NinjaTrader Customer Service

    Comment


      #3
      Thanks Patrick for indicating how to get it, now an obvious question:

      how can I submit in my code, as if it was in the strategy analyzer, certain values in the optimizer, such as: value for Bar, dates set for the study..etc in order to get the NetProfit ?

      Thanks

      Comment


        #4
        Patrick your tip is very useful if working in real time, but how to do when you want to optimize values on historical data?

        Comment


          #5
          Hello pstrusi,

          Thank you for your response.

          In this case you would need to build you own internal calculations within the strategy to do this. Are you trying to do this for when your are backtesting in the Strategy Analyzer or just in running the strategy in real-time and want the historical trade values?

          I look forward to your response.
          Patrick H.NinjaTrader Customer Service

          Comment


            #6
            When I´m backtesting, thus I must input: Value for Bar, dates...etc In order to automate the code, I need to use those results and then changing certain input values in my code. When I was working until 8 variables there wasn`t problem cause I designed a fix code with 27.000 lines, but now that I need to add more variables I hit a limit.
            Last edited by pstrusi; 07-24-2013, 01:45 PM.

            Comment


              #7
              Hello pstrusi,

              Thank you for your response.

              So I may better assist you in this area please advise why you would not just use the Strategy Analyzer results? What are you attempting to do here? What is the end result? Are you planning to hav ethe data automatically exported to another file?

              I look forward to your response.
              Patrick H.NinjaTrader Customer Service

              Comment


                #8
                Let me explain it because I'm sure that NT might allow a better way.

                I run a backtest with my code, I get a results, and those results ( with a simple work with them in excel give a Trend depending of the combination of my input variables. After I need to put into my code that for certain combination the code should be: buy, neutral or sell a position. My problem is that I don't know how to automatize using the backtest results into my code in automatic way. As you can see there's a manual work.

                Do you understand it? I hope to have it explained simple

                Comment


                  #9
                  Hello pstrusi,

                  Thank you for your response.
                  Originally posted by pstrusi View Post
                  When I was working until 8 variables there wasn`t problem cause I designed a fix code with 27.000 lines, but now that I need to add more variables I hit a limit.
                  Are you developing this in the Strategy Wizard?

                  I look forward to your response.
                  Patrick H.NinjaTrader Customer Service

                  Comment


                    #10
                    Nope. I have a certain experience programming my codes but I´m not a programmer, just economist who learned some from tutorials, books and being helped by this forum. But Whenever I need to go into more complicated internal dynamics I struggle to do a fine job. However I try to keep my work simple.

                    Patrick I appreciate your help but don't worry if this is out of your duty as support. I'm trying to solve through an excel macro..but since I have to optimize 3^10 combinations and assigning those input into my code, I tried to get support from this limitations in lines of code in NT. Above 80.000 NT begins to give memory-issues.

                    If by any chance you could give me some reference in how to get access to internal results from an historical backtest, let me know

                    Best regards

                    Comment


                      #11
                      Hello pstrusi,

                      Thank you for the additional information.

                      It would not be possible to export the results from the backtest through the script. However, it is possible to pull the TradesPerformance and store these values in an external file to read form on the next run of the strategy.

                      For information on the TradesPerformance values please visit the following link: http://www.ninjatrader.com/support/h...erformance.htm

                      For a reference sample on reading and writing to an external file please visit the following link: http://www.ninjatrader.com/support/f...ead.php?t=3477

                      Please let me know if I may be of further assistance.
                      Patrick H.NinjaTrader Customer Service

                      Comment


                        #12
                        I thank you very much Patrick for your great assistance, as always NT support team is excellent!

                        Regards,
                        ps

                        Comment

                        Latest Posts

                        Collapse

                        Topics Statistics Last Post
                        Started by seagraph, Today, 03:27 PM
                        0 responses
                        8 views
                        0 likes
                        Last Post seagraph  
                        Started by dedouglas, Today, 02:54 PM
                        1 response
                        9 views
                        0 likes
                        Last Post NinjaTrader_Jesse  
                        Started by elkhatabi, 08-01-2019, 06:36 PM
                        5 responses
                        50 views
                        0 likes
                        Last Post NinjaTrader_RyanL  
                        Started by mr_trade, Today, 01:01 PM
                        4 responses
                        16 views
                        0 likes
                        Last Post mr_trade  
                        Started by Renorail, Today, 12:31 PM
                        1 response
                        12 views
                        0 likes
                        Last Post NinjaTrader_PaulH  
                        Working...
                        X