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 lightsun47, Today, 03:51 PM
            0 responses
            4 views
            0 likes
            Last Post lightsun47  
            Started by 00nevest, Today, 02:27 PM
            1 response
            8 views
            0 likes
            Last Post 00nevest  
            Started by futtrader, 04-21-2024, 01:50 AM
            4 responses
            44 views
            0 likes
            Last Post futtrader  
            Started by Option Whisperer, Today, 09:55 AM
            1 response
            13 views
            0 likes
            Last Post bltdavid  
            Started by port119, Today, 02:43 PM
            0 responses
            9 views
            0 likes
            Last Post port119
            by port119
             
            Working...
            X