Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Ninjascript Server Side ?

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

    Ninjascript Server Side ?

    Hi - Very new to NT ... Tried to search the forums, but did not find the answer really.

    So ATM can be left alone on the/a server somewhere. But what about my own NinjaScript full strategy ? Must I leave my PC running with it, or can it be run on a server somewhere ? (and I don't mean my own)

    If no server side execution is possible, can you please refer to a page which explains consequences when my PC crashes or M$ likes to update my W10 without my consent ?

    I know about the cloud version, but this is not the same as what I'm after, right ?

    Thanks !



    #2
    No, your NinjaScript cannot run on NinjaTrader's servers. But you can get an inexpensive VPS and run it there. That is what I would recommend that you do.

    No, the cloud version (web platform) cannot run NinjaScript. It is programmable, but not really in the same sense, and there is not yet any documentation.

    Regarding Windows Update, you can generally stop it from updating on Windows 10 and on Windows 11 you can suspend updates for two weeks at a time. If you Google for your windows version and "stop windows updates" you'll find there are lots of instructions about this.
    Bruce DeVault
    QuantKey Trading Vendor Services
    NinjaTrader Ecosystem Vendor - QuantKey

    Comment


      #3
      Thank you, Bruce. Assuming that the hoster is never rebooting that VM unless on agreement, this should work.

      N.b.: Yeah, I know about the Windows update prevention (Metered and such), but the other day I received one anyway. It is killing for various reasons.

      Comment


        #4
        VPS providers won't reboot normally... they also won't push Windows updates either... normally...

        Make sure you find out the details from the provider... I was on a VPS the other day that hadn't been rebooted in 6 months and no current windows updates either... So they do exist...
        Your biggest problem is going to be staying connected to the Ninjatrader servers... No matter the data feed you have, you WILL be disconnected on the weekends when the market is closed...
        And periodically throughout the week you will randomly for no real reason just lose connections to those same servers...

        Comment


          #5
          The issue here is a VPS provider can configure their Windows image such that it only gets updates, by default, from them, rather than from Microsoft, and they never post any because they are tired of people complaining their machine installed an update and maybe rebooted, so if "stability" is what you desire over "security," then you can certainly stop windows updates and that will be a complete non-thing. No updates, no reboots, ever.
          Bruce DeVault
          QuantKey Trading Vendor Services
          NinjaTrader Ecosystem Vendor - QuantKey

          Comment


            #6
            Originally posted by brenthilburn View Post
            No matter the data feed you have, you WILL be disconnected on the weekends when the market is closed...
            Oops, right. I read about that in this forum already indeed - I forgot about it.

            OK, not to be ignorant (sure not !), but I worked with the API to IB. I sure recognize the issue, but that also did not bother for the environment of concern. Of course it requires some logic to "stay in", like the ability to find out whether the connection is there in the first place - plus re-connect logic, but ... wouldn't that solve the problem ? I mean, if a connection is not there (what about daily reset of IB (USA 11pm or midnight I think ?)), you can't trade anyway (always think Autotrading). Of course your trade can go under and such, but that's life. The problem would be that the program(/script) crashes from it ... that would not be allowed.

            Doable ? (at worst with try - catch)

            Comment


              #7
              try-catch is irrelevant here, except insofar as you can catch your OWN exceptions that you somehow caused e.g. attempt to dereference null. In NinjaTrader, you can configure it not to disable your strategy if you are disconnected, but there are more issues here than this. It's not entirely clear that reconnecting you will always be able to resume your existing positions and open orders. You would have to test your specific scenario to see if what you want to do works because there are lots of cases and it isn't possible to simply say yes or no you can do that without a LOT of details. People do use NinjaTrader to trade long-held positions including over weekends, but there are lots of specifics to their cases - it's not the case that with any broker, with any data feed, with any type of strategy, with any type of orders, it all works or does not work.
              Bruce DeVault
              QuantKey Trading Vendor Services
              NinjaTrader Ecosystem Vendor - QuantKey

              Comment


                #8
                Appreciated.

                If one knows what can all happen (e.g. no response from broker to your new order (could be an Exit)) it should be a matter of anticipating those cases explicitly. And Bruce, it is almost like you're telling that a "no response" is the big issue (that would indeed not error-trap in our own code). Of course I have no experience with NT yet, but I now start to envision what issues could be. Example (correct me when I'm talking from my neck) :

                Connection is lost. Program is not called any more (no new bars appear), and meanwhile the SL was hit - I thus don't even see that coming. Connection comes up, and my trade loses 100 while I expected 40. This kind of assumes the broker also was inoperative and not only the connection was lost.
                So yeah, this is one small scenario out of dozens if not hundreds, and most deal with "broker not responding" (underlaying reason unknown). This often costs money, but it is part of it all. All I'd want is the program never to crash and it being able to continue when the connection is there again.

                Background : It could be difficult for me to put myself in the shoes of this "not-server-side" environment, because I am used to server-side and don't need to bother about broker connections. But don't I ? well, it would even be more difficult (as I see it now) because also with a server-side provider the connections get lost to the broker just the same. And the chain still needs to report to me what happened. And the provider would do it their way, which is almost always with insufficient detail.

                After a few posts about this subject, I may even like the "direct" (not-server-side) way better ...

                Comment


                  #9
                  If you use only server-side ATMs trading with NinjaTrader Brokerage (currently in beta), then you do not need to stay connected, and the broker is responsible for seeing that either your stop or target is hit once you get in. This assumes that you are not arbitrarily exiting on some technical condition e.g. go flat when RSI goes over 80 or whatever and that you will hit your stop or target or whatever chasing or trailing or scaling out the ATM supports.

                  If you are trading with IB, you have a few of these capabilities, especially if you talk directly to their API. If you are using NT to communicate with IB, you'll have to check which capabilities the IB adapter supports and whether it's true server-side OCO or not - it depends how NT is sending the orders.

                  For every other case, you should assume that your strategy MUST be monitored by a person at all times - not just with NinjaTrader, but really, with any retail trading platform including IB. All the same things would be true on TradeStation, or Sierra Chart, etc. - you can't set it and walk away, generally.
                  Bruce DeVault
                  QuantKey Trading Vendor Services
                  NinjaTrader Ecosystem Vendor - QuantKey

                  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