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

How to increase the speed of optimisation with a GPU?

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

    How to increase the speed of optimisation with a GPU?

    As my strategy develops, parameters increase. This geometrically increase the combination for optimisation and process time.
    Thinking of shortening the process time, I googled and learnt about something called GPU which has a greater power of calculation than CPU. I also learnt form one of the posts in this forum that "All strategy calculations are performed on the CPU."
    So my question is how can I make GPU do the calculation work during optimisation?
    Thank you!

    #2
    Hello alantse123,

    Thanks for your post.

    NinjaTrader does not offer a means to offload optimizations to the GPU, and we could not offer support for accomplishing this task.

    For best optimization performance, we typically advise to write strategies so class levels variables are reset in State.Configure/State.DataLoaded, and the strategy is then set to use IsInstantiatedOnEachOptimizationIteration = false. I'll include some publicly available information on this property and the best practices that should be followed when setting this property to false.

    IsInstantiatedOnEachOptimizatonIteration documentation — http://ninjatrader.com/support/helpG...niteration.htm

    State Management Best Practices (please see Resetting class level variables for Strategy Analyzer Optimization) - https://ninjatrader.com/support/help...urceManagement

    If you have any additional questions on this property, please do not hesitate to ask.
    JimNinjaTrader Customer Service

    Comment


      #3
      NinjaTrader does not offer a means to offload optimizations to the GPU, and we could not offer support for accomplishing this task.
      So, I've spent a good bit of time with optimizations/backtesting and at this point am trying to speed up my optimizations in all the ways that I can. One point that I would like to have clarified, and which seems to support the idea that increasing the GPU power could help speed up optimizations are those cases where there are drawing objects in a strategy. Is this correct? (e.g., from what I understand Ninjatrader 8 uses the GPU for drawing objects, so if a strategy which is being optimized has drawing objects then increasing the GPU power would/should be able to help there)

      If someone could please confirm or deny whether this is (at least theoretically) true, that would be helpful. Thanks.

      Comment


        #4
        Hello Calebg,

        I don't believe in that situation a more powerful GPU would apply. The drawings would only be rendered if you are looking at a chart which is also only going to relate to one test. The objects will be called in your code during each optimization and will use resources but would otherwise not be rendered until you view them.

        One point that you can control here would be to turn off the drawings in your logic during the optimization so that no drawings are being added or removed. That can help performance as the underlying drawing object code is not being run.


        I look forward to being of further assistance.
        JesseNinjaTrader Customer Service

        Comment


          #5
          The drawings would only be rendered if you are looking at a chart which is also only going to relate to one test. The objects will be called in your code during each optimization and will use resources but would otherwise not be rendered until you view them.
          Respectfully, I'm not sure this is actually true - one of the largest gains I made with speed in my optimizations was when I commented out a Draw.TextFixed() statement based on something I read in another post. Unfortunately, regarding the many other draw objects I have in my strategy - I'm kind of hosed for the moment because I used them as glorified Series<t> objects throughout my code. At the time it seemed like a good idea - get my object store AND a handy drawing for my charts all in one, but now I'm not so sure....however the cost to find out whether or not it matters to performance, or by how much it matters, would be fairly steep for me (e.g., refactor of much of my core logic).

          Comment


            #6
            Hello Calebg,

            This goes with what I had noted, if you remove the drawings all together you will see performance gains.

            The visual rendering is only a part of the performance impact that a drawing object has. Creating the object will also pull resources even if it is not being drawn visually. You would only start to include rendering into the performance toll if the object is visible and being drawn. The GPU should not help increase performance for the question you asked if the object is not visually drawn but does exist in memory as an object (optimization). Not calling the Draw method at all completely avoids this because you are creating less objects in memory and overall have less load.

            The best suggestion I could make here would be to limit using Drawing objects for strictly visuals and use the other more appropriate objects like a Series<T> where you can for logical uses. It sounds like your logic right now relies on the drawing objects in some way, so it may not be possible at this point to determine if changing would make a big difference. I can say that if you have a very large number of objects being used to where the chart is no longer smooth when scrolling or if you are seeing a large impact when testing, you can likely classify that as logic that would perform better using other drawing means like OnRender.


            I look forward to being of further assistance.
            JesseNinjaTrader Customer Service

            Comment


              #7
              Thanks Jesse - I get it now, 'yes, drawing objects can slow down optimizations just due to them being instantiated at all, something which is in no way tied to actually rendering them' (and it's obviously only the rending which would be what a GPU would be worthwhile for).

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by ct, 05-07-2023, 12:31 PM
              6 responses
              202 views
              0 likes
              Last Post wisconsinpat  
              Started by kaywai, Today, 06:26 AM
              1 response
              2 views
              0 likes
              Last Post kaywai
              by kaywai
               
              Started by kevinenergy, 02-17-2023, 12:42 PM
              118 responses
              2,778 views
              1 like
              Last Post kevinenergy  
              Started by briansaul, Today, 05:31 AM
              0 responses
              9 views
              0 likes
              Last Post briansaul  
              Started by traderqz, Yesterday, 12:06 AM
              11 responses
              28 views
              0 likes
              Last Post NinjaTrader_Gaby  
              Working...
              X