Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Running multiple instance of strategy (10+)

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

    Running multiple instance of strategy (10+)

    I have a strategy which i run on multiple accounts (prop firm style setup). I need to run about 10+ instances of this. My strategy needs to be added against the chart. What is the most efficient way to run this kind of setup. Should I run all the strategies on one chart, or make one chart per strategy?

    How does NT handle strategies in terms of multi threading? Will it take advantage of more cores? Is there a point where I will start to hit a wall (30 instances for example).

    I assume I can only run one NT instance on my account, so its not like I can run multiple server instances to improve performance or is there a way around this.

    #2
    Hello mayurav2604,

    Thank you for your post.

    There is no hard limit on how many strategies you can run simultaneously. It would depend on your computer how many strategies could be operating at once, as well as the complexity of the strategies you're using and how often they are calculating values.

    However please note that having multiple strategies running on the same instrument and account will likely cause the strategy instance's position to not be in sync with the account position (which is likely what you are seeing leading to the unexpected behavior).

    It is recommended to run these on separate accounts instead, to prevent unwanted account positions. Further, each strategy instance has an independent position which does not have any supported methods to be read by another strategy instance.

    Below is a link to forum post that provides a warning about this.

    https://forum.ninjatrader.com/forum/...660#post792660

    Comment


      #3
      HI,
      Yes i am running one account per strategy instance. My strategy is very complex and running on BarClose. I have noticed performance starting to slip as I go with more instances, hence the question with multi threading and such. I am running on a VPS server so I need to know if getting more vCPU will help or whether the issue could be resolved by running more charts or one chart with 20 instances of the strategy.

      I am mostly trying to understand how the broker executions etc are queued. Is everything running in parallel or once my strategy sends commands to the broker, this is being queued by NT internally before being sent. Same with the actual code execution, is it trying to run all 20 bar close scripts at once? or does it say do a max of 4 in parallel before moving onto the next 4.

      Perhaps this question might beyond the information publicly available, but really its mostly in regards to understanding the underlying strategy execution engine deployed by NT.

      Comment


        #4
        Hello,

        Thank you for your response.

        If the charts have the same instrument, this would mean all the charts have to be loaded (get bar updates and render), so there would be more of a performance impact. If the charts are using separate instruments, they would all run on different threads and therefore would not be stressing a single logical processor.

        As far as how executions are queued, NinjaScripts send orders to the Account thread which does have a queue and sends out one order at a time. However, there are not any delays that our team is aware of. ​

        Comment


          #5
          Thanks for the info. My setup is 1 instrument and 1 strategy running 20 instances on 20 accounts.

          So if I understand it clearly its only 1 instrument per thread, so the best performance comes from just running a single chart with all the strategies instances running on it? Would I get any multithreading at this point (so would it say be worth going from a 4vCPU to 8vCPU), or effectively would I already be utilising my CPU as best I can. (As in NT won't offload the strategy calculations across all the cores).

          One additional element of my strategy is I am running 5 data series and using about 20 days of loaded data. Again I imagine I would get best performance just using a single chart in this regard.

          Comment


            #6
            Hello,

            Correct, if your script is using just a single instrument they will all run on the same thread so with opening additional charts there would be overhead.

            Comment


              #7
              So what is the best vCPU needed and ram and storage for running strategies without problem in different scenarios?

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by NullPointStrategies, Today, 05:17 AM
              0 responses
              41 views
              0 likes
              Last Post NullPointStrategies  
              Started by argusthome, 03-08-2026, 10:06 AM
              0 responses
              124 views
              0 likes
              Last Post argusthome  
              Started by NabilKhattabi, 03-06-2026, 11:18 AM
              0 responses
              64 views
              0 likes
              Last Post NabilKhattabi  
              Started by Deep42, 03-06-2026, 12:28 AM
              0 responses
              41 views
              0 likes
              Last Post Deep42
              by Deep42
               
              Started by TheRealMorford, 03-05-2026, 06:15 PM
              0 responses
              46 views
              0 likes
              Last Post TheRealMorford  
              Working...
              X