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 Mongo, Today, 11:05 AM
            4 responses
            14 views
            0 likes
            Last Post Mongo
            by Mongo
             
            Started by traderqz, Today, 12:06 AM
            7 responses
            14 views
            0 likes
            Last Post NinjaTrader_Gaby  
            Started by Skifree, Today, 03:41 AM
            5 responses
            13 views
            0 likes
            Last Post Skifree
            by Skifree
             
            Started by traderqz, Yesterday, 09:06 AM
            5 responses
            35 views
            0 likes
            Last Post NinjaTrader_Jesse  
            Started by guillembm, Today, 11:25 AM
            1 response
            6 views
            0 likes
            Last Post NinjaTrader_Jesse  
            Working...
            X