Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategies that use MAX() or MIN() take infinity to optimize

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

    Strategies that use MAX() or MIN() take infinity to optimize

    Today I once again noticed that strategy conditions, that include MAX() or MIN() functions take like forever to optimize.

    I ran an optimization test with 100 (!) iterations (values from 1 to 100) and it took 3,5 Hours!

    This is my personal record for the longest optimization.

    And formula was like this:

    Low[0] < (MAX (High, BarsSinceEntryExecution()+1)[0] - (TickSizeVariable * TickSize)) // Idea around it is to mimic End-of-trade drawdown real time: for long trade to take current low and see if it's lower than maximum high since execution minus X number of ticks.

    So nothing fancy, but it took soo long. Any way to improve it?

    I tried converting that MAX (High, BarsSinceEntryExecution()+1)[0] into variable and then calling it, but optimization didn't get faster.

    #2
    Hello UltraNIX, thanks for your post.

    If that is the amount of time it took for the code to run, then that's the amount of time it needs to complete. The only way to test alternatives would be to make your own Max and BarsSinceEntry methods to see if they are faster. Also, you could test a smaller number of iterations + a smaller time frame to see if there is some kind of exponential growth problem with the strategy.

    Kind regards,
    -ChrisL
    Chris L.NinjaTrader Customer Service

    Comment


      #3
      I am considering upgrading to new pc that would run those calculations faster. Can you advice which part of it should I pay most attention? RAM? Processor? Other?

      Comment


        #4
        Hello UltraNIX, thanks for your reply.

        The best CPU you can get would be advisable. Also, a high amount of RAM would be best, over 16 GB should be enough for heavy backtesting.
        Chris L.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Janfor, Today, 07:08 AM
        1 response
        8 views
        0 likes
        Last Post NinjaTrader_Zachary  
        Started by memonolog, Today, 06:49 AM
        0 responses
        6 views
        0 likes
        Last Post memonolog  
        Started by fawzanalim, Today, 04:37 AM
        1 response
        11 views
        0 likes
        Last Post NinjaTrader_PaulH  
        Started by SpongeRob, Today, 06:41 AM
        0 responses
        17 views
        0 likes
        Last Post SpongeRob  
        Started by focus333, Yesterday, 05:48 PM
        1 response
        20 views
        0 likes
        Last Post NinjaTrader_PaulH  
        Working...
        X