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

Can I run strategy in background?

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

    Can I run strategy in background?

    Does the NinjaTrader software need to be open and active for a strategy to run? For example, if I'm running a strategy on 4-hour char or a daily chart, can I just run the strategy in the background and leave/close the software? Same question what if I want to run the strategy overnight or indefinite duration?

    #2
    Yes, the NinjaTrader software must be open and active for a strategy to run.

    You can minimize windows, sure, but the software itself must be started and
    have an internet connection in order for your strategy to run.

    As soon as you exit/terminate the NinjaTrader application, all NinjaScript plugins
    will, by definition, also terminate.

    In other words,
    To run your strategy, the NinjaTrader.exe application must also be running.

    Regardless of overnight or indefinite duration, the only way any NinjaScript
    plugin can execute is if NinjaTrader.exe is also executing. Period. Full Stop.

    -=o=-

    Which brings us to the underlying purpose of a VPS.

    Such is the allure of a VPS, which runs continuously in a data center, with
    power backups and other fail-safes -- the point is, a VPS is attractive precisely
    because it is designed to keep your NinjaScript strategy always running,
    because it keeps your NinjaTrader.exe always running.

    Comment


      #3
      Hello,

      Thank you for your post hasana1 and thank you for your input bltdavid.

      As bltdavid mentioned, NinjaTrader must be open and connected for an automated strategy to run properly. If you try to close the software while a strategy is running, you will get a pop-up message notifying you that you have strategy(s) running and it will ask if you really want to shut down. If you choose yes, the strategy (or strategies) will be disabled as NinjaTrader shuts down. If you want to run a strategy overnight or for an extended duration, NinjaTrader must remain open with a connection to your broker. In the event of a connection loss while a strategy is running, NinjaTrader has the options to keep strategies running, recalculate the strategy position when the connection is reestablished, or stop the strategy once there is a disconnect. These settings may be adjusted by going to Control Center > Tools > Options > Strategies > On connection loss. For more information:



      bltdavid mentioned using a VPS, and some of our users choose to use a VPS for the reasons that were mentioned. That being said, using a VPS is not supported by NinjaTrader. There has been a lot of discussion in the forums about which VPS to use, and we also may have vendors in our NinjaTrader Ecosystem that offer VPS services. If you would like, I could get you in touch with our Vendor Support team for more information.

      If you wanted to run a strategy for an indefinite duration, it is also important to keep in mind that NinjaTrader should be restarted periodically and kept up-to-date. This means that you might need to stop your strategy in order to restart NinjaTrader/restart your PC. The recommendation is to restart NinjaTrader daily per our performance tips:



      Please let us know if we may be of further assistance.
      Emily C.NinjaTrader Customer Service

      Comment


        #4
        Thank you for the detailed reply bltdavid and NinjaTrader_Emily
        Could you share some of the VPS choices for this purpose? Thanks!

        Comment


          #5
          Hello hasana1,

          There are a handful of third-party VPS providers that would allow you to run NinjaTrader on a remote server. Here is a link to the NinjaTrader Ecosystem website with search results for third-party VPS providers. You can find more information about these companies by visiting their websites and contacting them directly:The NinjaTrader Ecosystem website is for educational and informational purposes only and should not be considered a solicitation to buy or sell a futures contract or make any other type of investment decision. The companies and services listed on this website are not to be considered a recommendation and it is the reader's responsibility to evaluate any product, service, or company. NinjaTrader Ecosystem LLC is not responsible for the accuracy or content of any product, service or company linked to on this website.
          Christopher S.NinjaTrader Customer Service

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by wzgy0920, 04-20-2024, 06:09 PM
          2 responses
          26 views
          0 likes
          Last Post wzgy0920  
          Started by wzgy0920, 02-22-2024, 01:11 AM
          5 responses
          32 views
          0 likes
          Last Post wzgy0920  
          Started by wzgy0920, Yesterday, 09:53 PM
          2 responses
          49 views
          0 likes
          Last Post wzgy0920  
          Started by Kensonprib, 04-28-2021, 10:11 AM
          5 responses
          191 views
          0 likes
          Last Post Hasadafa  
          Started by GussJ, 03-04-2020, 03:11 PM
          11 responses
          3,230 views
          0 likes
          Last Post xiinteractive  
          Working...
          X