Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

[bug] [NT8040] Strategy Optimization

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

    [bug] [NT8040] Strategy Optimization

    Hello guys,

    Could anybody say what is the best place to have instance of class(another code helper) in strategy? For example this helper class will dial with SystemPerformance.AllTrades and should work properly with genetic optimization mode.

    Sounds like is State.Configure is right place, but I would like to know what the place from your idea/design?

    Thanks
    Last edited by login_dejavu; 02-12-2017, 08:12 AM.

    #2
    Hello login_dejavu,

    Thank you for your post.

    The SystemPerformance.AllTrades would not hold trades across each optimization iterations. You can use Optimization Fitnesses to calculate values over several optimization iterations:http://ninjatrader.com/support/helpG...on_fitness.htm
    If this is not what you intended please provide further detail.

    Comment


      #3
      Hi Patrick, thanks for your response.

      But would it hold trades during "current" iteration? For example if I want to have a RiskManager which will control daily/weekly/monthly losses via SystemPerformance.AllTrades + current live trade. I'm asking because as soon as I'm adding this class and calculating the values on each bar update, results doesn't much the grid That's why I start thinking maybe initialization of the class is wrong.

      Comment


        #4
        Hello login_dejavu,

        Thank you for your response.

        For each iteration the TradesCount should be accurate. Do you have an example that is not producing the correct values?

        I look forward to your response.

        Comment


          #5
          Hi Patrick,

          yes, I'm attaching simple example which will help to reproduce this issue.

          Steps to reproduce:

          - Copy 2 attached files to /Bin/Custom/Strategies folder
          - Set parameters: X(3,30,3) Y(3,30,3) Z(3,30,3) Timeframe: 5 minutes
          - Run "max net profit" GENETIC optimization

          I used EURUSD(kinetick) 01.01.2010 - 01.01.2015 (just saying as reference example, but actually you can reproduce it with others as well). If you want to use other instrument you would need to change MaxDayLoss,MaxWeekLoss,MaxMonthLoss at the beginning of the MACDStrategy.cs


          *** Btw, in my attached example I used initialization of MyRiskManager as a member of strategy instance, but I also tried to do it on State.Configure and State.DataLoaded. Also played with IsInstantiatedOnEachOptimizationIteration. Results never matching the grid.


          Please, let me know if any other information will be helpful.
          Attached Files
          Last edited by login_dejavu; 02-15-2017, 08:30 AM.

          Comment


            #6
            Hlelo login_dejavu,

            Thank you for providing the files to test.

            What grid are you comparing? Where are the values that you are comparing?

            In my testing, there is no output in the Output window and I don't see anything in the files to output information.

            I look forward to your response.

            Comment


              #7
              Hi Patrick,

              Thanks for your reply. I attached screenshot where I highlighted mismatch. And you can also see that non of 10 results actually has the value: $3,681.10 which is shown in the grid.

              Let me know if I can help somehow else.
              Attached Files

              Comment


                #8
                Hello login_dejavu,

                Thank you for your response.

                It would appear the Strategy Analyzer is not updating properly. Please send me your log and trace files so that I may look into what occurred. You can do this by going to the Control Center-> Help-> Email Support.

                Please reference this thread in the body of your email.

                I look forward to your response.

                Comment


                  #9
                  Hi Patrick,

                  I checked the logs and they don't have anything useful, but maybe it is just for me. So I sent them anyway the way you asked. Hope this will be helpful.

                  Let me know if I can help somehow to resolve this issue.

                  Comment


                    #10
                    Hello login_dejavu,

                    Thank you for your patience.

                    I am not finding any issue with the code of the risk manager nor the means in which it is implemented into the strategy.
                    I am reporting this to our QA team to look into further.

                    I will update you here when I have any information on this matter.

                    Comment


                      #11
                      Hello login_dejavu,

                      Thank you for your response.

                      I was able to have the code inside the strategy it self without issue. We would recommend having the code in the strategy then take a piece of the custom risk manager code and place it into it's own file. Taking it step by step to debug the code to see what about the code is causing this misreporting.

                      Attached is the strategy with the Risk Manager in the code. This did not cause any issues in the reporting when testing.
                      Attached Files

                      Comment

                      Latest Posts

                      Collapse

                      Topics Statistics Last Post
                      Started by Waxavi, Today, 02:00 AM
                      1 response
                      7 views
                      0 likes
                      Last Post NinjaTrader_LuisH  
                      Started by alifarahani, Today, 09:40 AM
                      5 responses
                      23 views
                      0 likes
                      Last Post NinjaTrader_Jesse  
                      Started by Kaledus, Today, 01:29 PM
                      4 responses
                      12 views
                      0 likes
                      Last Post Kaledus
                      by Kaledus
                       
                      Started by gentlebenthebear, Today, 01:30 AM
                      3 responses
                      16 views
                      0 likes
                      Last Post NinjaTrader_Jesse  
                      Started by PhillT, Today, 02:16 PM
                      2 responses
                      7 views
                      0 likes
                      Last Post PhillT
                      by PhillT
                       
                      Working...
                      X