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 chbruno, Today, 04:10 PM
            0 responses
            3 views
            0 likes
            Last Post chbruno
            by chbruno
             
            Started by josh18955, 03-25-2023, 11:16 AM
            6 responses
            436 views
            0 likes
            Last Post Delerium  
            Started by FAQtrader, Today, 03:35 PM
            0 responses
            6 views
            0 likes
            Last Post FAQtrader  
            Started by rocketman7, Today, 09:41 AM
            5 responses
            19 views
            0 likes
            Last Post NinjaTrader_Jesse  
            Started by frslvr, 04-11-2024, 07:26 AM
            9 responses
            127 views
            1 like
            Last Post caryc123  
            Working...
            X