Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

What does optimize on Long/Short actually do?

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

    What does optimize on Long/Short actually do?


    Hi there, on optimizing a strategy, for every option, there's the sub-options of Long/Short. I had the impression this option would only run Long/Short trades during optimization. However, on the Optimization results, I see both Long/Short were executed.

    On my example, I ran an Optimization on Short. Yet, by the results, there are both long/short trades being executed (see attachment). So, what's the difference between running a regular optimization, and an optimization by long/short.

    Thanks





    Attached Files

    #2
    Hello timmbbo,

    I'm not quite sure what you are referring to.

    Are you asking about the Optimize on 'Max net profit (long)' and 'Max net profit (short)'?

    This is going to be controlling the sorting and results that are returned, it does not change the orders that are submitted by the script. This will be returning the top results where the max net profit is highest for long orders.

    Currently NinjaTrader has released 8.1.3.1.

    Updates to NinjaTrader will contain the latest security updates and bug fixes, as well as occasional new features and instruments.

    To update NinjaTrader
    • Shutdown all programs including NinjaTrader *important
    • Download NinjaTrader from the link below
      Click here to download NinjaTrader
    • Double click the downloaded file to execute it
    • Follow the on screen instructions
    • Restart NinjaTrader
    You can read about changes to this release in the release notes linked below.
    https://ninjatrader.com/support/help...ease_notes.htm
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      It tries to minimize the drawndown of short positions, while still taking shorts.

      Comment


        #4

        Chelsea, yes, I should have clarified that I'm talking about the "Optimize on" option. For example, what's the difference between

        Optimize on: Max Profit
        Optimize on: Max Profit (Long)
        ​​​​​​​Optimize on: Max Profit (Short)

        Thanks,

        Comment


          #5
          Hello timmbbo,

          Max net profit - This will be returning the top results where the max net profit is highest for all orders.
          Max net profit (Long) - This will be returning the top results where the max net profit is highest for long orders.
          Max net profit (Short) - This will be returning the top results where the max net profit is highest for short orders.
          Chelsea B.NinjaTrader Customer Service

          Comment


            #6
            Chelsea - a follow up that I hope you can explain.

            When I ran the Optimizer on Min Draw Down / Long, I got a result of -$19K. When I took that same strategy and commented out the short trades, so it could only do long trades, and then the Optimizer on it, I got a result of +$15K.

            So, when I'm running to Optimize on (Min Draw Down / Long), why doesn't it generate the same result as just doing no short trades? It seems like to get the best test result, I'm going to need to bifurcate my candidate strategies into a Long / Short half, and then test each half, which then doubles my testing load.
            Attached Files

            Comment


              #7
              Hello timmbbo,

              Changing the logic may have changed when and at what price orders are being submitted.

              Add debugging prints to see if the long orders are still being submitted at the same time and price.

              Print the values and comparison operators of the conditions, enable TraceOrders, and print the order.ToString() in OnOrderUpdate().
              Chelsea B.NinjaTrader Customer Service

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by argusthome, 03-08-2026, 10:06 AM
              0 responses
              110 views
              0 likes
              Last Post argusthome  
              Started by NabilKhattabi, 03-06-2026, 11:18 AM
              0 responses
              59 views
              0 likes
              Last Post NabilKhattabi  
              Started by Deep42, 03-06-2026, 12:28 AM
              0 responses
              37 views
              0 likes
              Last Post Deep42
              by Deep42
               
              Started by TheRealMorford, 03-05-2026, 06:15 PM
              0 responses
              41 views
              0 likes
              Last Post TheRealMorford  
              Started by Mindset, 02-28-2026, 06:16 AM
              0 responses
              78 views
              0 likes
              Last Post Mindset
              by Mindset
               
              Working...
              X