Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

optimization for max avg profit

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

    optimization for max avg profit

    Hi, it seems there is an error when try to optimize for avg profit (avg trade?) and ninja returns 0 everytime.
    Have you some suggestions?
    Thanks

    #2
    Hello kantkant2,

    Thank you for your note.

    If you run a optimization on the SampleSMACross strategy preloaded with NinjaTrader, for avg profit, do you see the same results?

    I look forward to your reply.
    Alan P.NinjaTrader Customer Service

    Comment


      #3
      Yes, on every strategies on every machines...
      Could be very useful to rank parameters for avg trade...

      Comment


        #4
        Hello kantkant2,

        It looks like the issue is that the output of MaxAvgProfit is in percent rather than currency, and if you make .5% on a trade, this would appear as 0.

        I created a new optimization fitness, called alanMaxAvgProfit.

        I swap,

        Code:
        Value=strategy.SystemPerformance.AllTrades.TradesPerformance.[B]Percent[/B].AverageProfit;
        For,

        Code:
        Value=strategy.SystemPerformance.AllTrades.TradesPerformance.[B]Currency[/B].AverageProfit;
        And you’ll see an output.

        You can import the attached optimization fitness, and optimize.

        I will report this to Development although it may be expected behavior.
        Attached Files
        Alan P.NinjaTrader Customer Service

        Comment


          #5
          Thanks Alan,
          sorry but attachment file is impossible to import...
          An error message say me " file is likely corrupt and can't be imported"

          Comment


            #6
            Hello kantkant2,

            My apologies, the sample I provided was for NT8.

            There would be no way to change this in NT7, however the figures are there, they are just in percents, and unless your strategy is taking more than a percent out of a trade the figures will be to small to see, but the optimization is working as expected.

            I have attached the results of a SMA cross strategy on a daily series where the trade PL is >1%, and you will see the output.

            Please let us know if you need further assistance.
            Attached Files
            Alan P.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Balage0922, Today, 07:38 AM
            0 responses
            3 views
            0 likes
            Last Post Balage0922  
            Started by JoMoon2024, Today, 06:56 AM
            0 responses
            6 views
            0 likes
            Last Post JoMoon2024  
            Started by Haiasi, 04-25-2024, 06:53 PM
            2 responses
            19 views
            0 likes
            Last Post Massinisa  
            Started by Creamers, Today, 05:32 AM
            0 responses
            6 views
            0 likes
            Last Post Creamers  
            Started by Segwin, 05-07-2018, 02:15 PM
            12 responses
            1,786 views
            0 likes
            Last Post Leafcutter  
            Working...
            X