Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Live-Trading on VPS with strategy development on local machine

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

    Live-Trading on VPS with strategy development on local machine

    Hi there,

    as a lifetime license holder, I've always been annoyed by the license limitations of NT8 for my specific use case. Now I know the easy answer is "buy another license" but honestly, I don't feel like spending another 1000 EUR on NT8, hope that can be acknowledged in the further discussion of this thread.

    Here is my specific use case, hopefully others can find this useful who are working on similar setups and maybe somebody has a good suggestion:


    Machine 1: Trading VPS - hosted with a German ISP, Windows 2016, 2 x AMD Epyc Cores, 8GB RAM, 250 GB SSD, around 8 Eur per month
    Machine 2: Local Development Server located in the UAE - Windows 10 Pro, AMD Ryzen 9 3900X 12 Core 24 Threads, RTX 2060 GPU, 32 GB DDR4 4000 RAM, 2 TB NVME

    Machine 1 is used for live trading with NT8 connected to the IB Gateway (older version that doesn't reconnect every 24 hours). This is extremely stable, no reboots, no downtime, etc. Perfect setup for NT8 trading strategy execution.
    However, this machine should not be used to run heavy optimizations such as WFA, as it's 1) a live trading machine and 2) simply not powerful enough to do this efficiently.

    Machine 2 is only used for strategy development and testing, leveraging the CPU power to run heavy workloads of optimizations. This machine never trades live.


    Question: I don't need live data on Machine 2, however I do occasionally need to refresh my tick data for more recent optimizations and playback testing and sync the strategies. Two solutions come to my mind:
    1. Create a Google Drive sync between the two machines allowing the "\Documents\NinjaTrader 8" folder from Machine 1 to be available on Machine 2. Same for "\Documents\NinjaTrader 8\bin\Custom\Strategies" to sync the strategies when I've made updates.
      Via the scheduler, regularly copy the contents of the cache, db and strategy folders from the sync'ed Machine 1 folder to the same folder on Machine 2.
      Downside: not 100% sure this won't corrupt anything over time
      Upside: no nagging on license keys, runs in the background, automated
    2. On machine 1, create an export of the historical data and strategies, save it to the Google Drive folder and then re-import that data on machine 2 (vice versa for strategies). A bit more manual but maybe the intended way of doing it.
      Downside: constantly confronted with different machine ID, need to update the license key, disable simulation mode, etc.
      Upside: peace of mind that this is how it's intended to be done.

    I've posted this honest setup here and I hope it's clear that I am not trying to circumvent the license terms of NinjaTrader here (given machine 2 is never actively trading and just used like the "free" version. I'd be grateful for some expert advice on whether what I am doing with Option 1 can be a permanent setup without negative implications.
    What are other options as I am sure I'm not the only person who doesn't want to use a live trading system for strategy testing, given the instability this often causes with NT8 freezing, using up all the RAM and the usual known issues in this forum.

    Thanks for any feedback, suggestions or any other feedback, really!



    #2
    Hello,

    Thanks for your post.

    Yes, I would go with the indended way of backing up through the platform, as undesirable functionality can occur when syncing to a cloud storage provider.

    The following instructions will explain how to backup your NinjaTrader 8 files to a second computer.

    Please note that the following list is the items you can choose to include or exclude from your backup (Configuration files, Database, Historical Chart Data, Log and Trace files, Market Replay Data, NinjaScript Files, Templates, Workspaces). Many users exclude the historical chart data, log and trace files, and Market Replay data to reduce the file size.

    Also, the new computer will have a different Machine ID and will result in any passwords for account connections being removed along with the NinjaTrader License key being removed. For security purposes all account connections will need to have the username and password re-entered and the License key will also need to be re-entered.

    You will also need to contact any 3rd party vendors and let them know that your machine ID has changed. You can locate the new machine ID by the following:
    • Control Center > Help > About... (e.g. Machine ID: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX)

    Follow these steps:
    • Open NinjaTrader 8 on the computer you wish to backup from and disconnect from any open connections if applicable
    • Go to Tools > Export > Backup File
    • Select which items you would like to backup and click 'Export'
    • Email or Save the file to an external storage device. The file can be found in the Documents\NinjaTrader 8 Backup folder on your PC

    Open NinjaTrader 8 on the computer you wish to restore to and disconnect from any open connections if applicable.
    • Open the email with the backup file or connect the external storage and save the backup file to a destination of your choosing (I recommend the desktop as it is easy to find)
    • Go to Tools > Import > Backup File...
    • Select the backup file you created from the location you saved it

    I have also attached the publicly available Help Guide section regarding backup and restore below:

    Help Guide - https://ninjatrader.com/support/help...ightsub=backup

    Please let us know if we may provide further assistance.
    Marco G.NinjaTrader Customer Service

    Comment


      #3
      Thanks Marco, I was hoping for a more elegant solution by sharing some folders within two installations but understand that may cause stability issues, with both applications running at the same time.

      Comment


        #4
        Hi Oracletrades,
        To separate development from live trading environment makes perfect sense to me. I have a similar set-up, but I don't export strategies from the live environment to the development system. For me, it's always the opposite direction and doesn't bother me much, because I'm very selective during development/backtesting and only export/activate those (few) strategies to the live environment successfully passing the backtests. Live trading (first on paper account, then with real money) is then done in the live environment. I keep the live environment as (c)lean as possible. Strategy and template inventory in both worlds is - on purpose(!) - not the same.
        Historic data is not an issue for me. Some data providers allow to use connections from different machines at different times, not concurrently of course. Thus, you can perhaps quickly disconnect from your live environment (e.g. outside of trading hours), update your development environment, then re-activate the real time data feed on your live environment.
        NT-Roland

        Comment


          #5
          Originally posted by NinjaTrader_Marco View Post
          For security purposes all account connections will need to have the username and password re-entered and the License key will also need to be re-entered.
          Is it ok to use the exact same NinjaTrader License on both his machines?

          From a technical perspective, I know this works.

          However, if one machine is a VPS and does all the live trading, and the second
          machine is for development only (and does no live trading), is using the same
          NinjaTrader License Key on both machines permissible according to the terms
          of the NinjaTrader License Agreement?

          I think this question is pretty fundamental to OP's situation.

          Comment


            #6
            Originally posted by NT-Roland View Post
            To separate development from live trading environment makes perfect sense to me. I have a similar set-up, but I don't export strategies ...
            I agree with w/Roland.

            I have something similar but I use Dropbox, which is installed
            on both machines -- it works great for me.

            I setup a Dropbox folder,
            PHP Code:
            C:\Users\David\Dropbox\NinjaTrader 
            which is the only part of my Dropbox I allow my VPS to see.
            (Frankly, this folder doesn't really have much in it.)

            On the development machine, I create an exported protected
            release of a 'strategy set' and/or 'indicator set', and I always
            put my own full version number in the export dialog. The reason
            is simple, I want to right-click -> Properties on the DLL and see
            my 'set' release version number in the 'Details' tab.

            Then I rename the exported .zip file to reflect this version number,
            such as, "BltIndicators_7.1.0.24.zip", and copy to the Dropbox.

            Next, log into the VPS and un-install the old assembly and import
            the new assembly directly from the 'Dropbox\NinjaTrader' folder.

            No elaborate or excessive syncing, no sharing, no scheduled
            copy events are necessary.

            Frankly, I wouldn't want that. I have plenty of work-in-progress
            files on my development machine that should not reside on the
            live machine. Just like in my software engineering career, I make
            the act of making a release a big deal
            -- in fact, that's all the
            VPS machine ever sees is the compiled exported DLL.

            As an added benefit, my strategies write to a log file, which is at,
            PHP Code:
            C:\Users\David\Dropbox\NinjaTrader\<StratName>\logs 
            I monitor this log file back on my development machine using a
            Windows 'tail' program, such as BareTail -- works great.

            Lastly, Growl for Windows has also come in handy for alerts.
            Last edited by bltdavid; 08-30-2020, 12:13 PM.

            Comment


              #7
              Originally posted by bltdavid View Post

              Is it ok to use the exact same NinjaTrader License on both his machines?

              From a technical perspective, I know this works.

              However, if one machine is a VPS and does all the live trading, and the second
              machine is for development only (and does no live trading), is using the same
              NinjaTrader License Key on both machines permissible according to the terms
              of the NinjaTrader License Agreement?

              I think this question is pretty fundamental to OP's situation.
              Hello bltdavid,

              Thank you for your reply.

              NinjaTrader's Terms of Service Agreement states that live license keys are for non-concurrent use. This means you can use the same license key to install NinjaTrader on multiple computers as long as you do not have multiple installations of NinjaTrader running at the same time. So you will need to close NinjaTrader on your first computer before logging on to trade from a second computer.

              Comment


                #8
                Got it, thanks.

                That means the usual 'Desktop+Laptop' combo situation is probably not an issue,
                assuming just one machine is running NinjaTrader at time, the same license key
                can be used for both installations.

                But the hybrid 'AutoTradingVPS+DevOnlyPC' combo situation will probably need
                a separate license key for each machine, especially if the strategy is designed to
                run 23/5 on the VPS.

                Seems a shame.

                Comment


                  #9
                  thanks all, I was using onedrive to sync the contents of select NT8 folders (like DB, templates, for example). That seems to work as well... I like the idea of keeping the VPS clean with only the essentials. Thanks everyone for weighing in!

                  Comment


                    #10
                    I copy templates to Dropbox\NinjaTrader\Templates, and then log into the VPS
                    and copy from the Dropbox to the correct NT folder.

                    Yes, I keep the VPS very thin, very clean. In fact, every few months, I would
                    goto into the 'db' folder and delete the cache, minute, tick, and day folders,
                    then use the Historical Data manager, download 2 weeks of recent historical
                    data. You may need more, or less, historical data. I certainly never do any
                    back testing or optimizing on the VPS, so it doesn't need that much historical
                    data -- and besides, my VPS package had a 50GB disk size limit.

                    The point is:
                    By making DLL releases, the VPS doesn't need all that much extra setup to
                    do auto trading. Maybe a few templates, maybe a few simple open source
                    common indicators, then configure the Connections, configure email, setup
                    any additional options, and voila, you can begin auto trading. Dropbox has
                    been very effective for my work flow, but other cloud services should work
                    well, too.

                    In summary:
                    A clean VPS makes your life easier.
                    I've found that creating versioned releases via DLLs helps this mindset.

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by traderqz, Today, 12:06 AM
                    4 responses
                    7 views
                    0 likes
                    Last Post traderqz  
                    Started by Mongo, Today, 11:05 AM
                    0 responses
                    3 views
                    0 likes
                    Last Post Mongo
                    by Mongo
                     
                    Started by Tim-c, Today, 10:58 AM
                    0 responses
                    1 view
                    0 likes
                    Last Post Tim-c
                    by Tim-c
                     
                    Started by traderqz, Yesterday, 09:06 AM
                    3 responses
                    23 views
                    0 likes
                    Last Post NinjaTrader_ThomasC  
                    Started by f.saeidi, Today, 10:19 AM
                    1 response
                    5 views
                    0 likes
                    Last Post NinjaTrader_BrandonH  
                    Working...
                    X