Quick answer: OneDrive is not compatible with Ninjatrader. Ninjatrader users who have enabled OneDrive so that their Documents folder is in the Microsoft Cloud will need to first mirror their files on their local system, then at least temporarily disable OneDrive to allow NinaTrader to function properly. Details below.
If you use OneDrive to back up your Documents folder in Windows, it might create problems for NinjaTrader. The same is true for Google Drive or anything that continually backs up the NinjaTrader 8 folder in the Documents folder. This can result in NinjaTrader errors, such as "duplicate name" or "Unhandled exception : The cloud file provider is not running".
Per the NinjaTrader Support forum, "NinjaTrader should not be used with OneDrive as you will see file access violations and other issues when OneDrive tries to sync files to the cloud."
You may be using OneDrive without realizing it. OneDrive is installed by default on many new Windows computers, and it's configured to back up your Documents folder to the cloud automatically. This can be initiated when you agreed to let Microsoft backup your files for you when you did a recent update. The process for unwinding this is a bit convoluted, as OneDrive backs up your files to the cloud and serves them to you from the cloud without keeping local copies on your system. If you turn off the OneDrive file syncing without first getting your filies available locally on your system, you may find that your Documents folder becomes empty, aside from a Where are my files? link. Clicking that link brings you to a OneDrive folder, which has a Documents folder in it - but again, those are pointers to the files on the cloud. You must go into the settings for OneDrive, and uncheck the box on the Settings (first) tab in the Files On-Demand section, ensuring that the Save space and download files as you use them option is NOT checked. If there's an option to have files both on your local system and cloud, then it may allow NinjaTrader to function correctly as long as OneDrive doesn't try to open the NinjaTrader files (to back them up) as you're using them. If you must configure OneDrive so that it's not using the cloud as tll, it will copy the files from the cloud back to your PC, after warning you that they will no longer be backed up to the cloud and will not be available on other computers you log into. Then you must cut and paste the files from the OneDrive Documents folder into your regular This PC/Documents folder. Only then will NinjaTrader find the files and update them without them being at risk of causing problems between NinjaTrader and OneDrive.
Why does this happen?
NinjaTrader, currently requires you to store NT user files in your Documents folder, typically in a folder named NInjaTrader 7 or NinjaTrader 8. While we don't know exactly why this problem occurs, it appears that when NinjaTrader attempts to open a file that is currently being accessed or backed up by OneDrive, it creates a conflict that is problematic with NinjaTrader. When this occurs, NinjaTrader may display a message that the files have been corrupted, or it may refuse to open your charts without a specific error message. It can also create other problems with indicators. Certainly, if you have intermittent or occasional issues with NinjaTrader and you can't figure out why, consider this potential cause.
You may have enabled the automatic backup to the cloud if you approved a prompt from OneDrive similar to the following:
The OneDrive application can vary from installation to installation, and by Operating System version, so the steps described below may not be exact. But the general summary of steps near the top of this article apply
Caution - these steps may be different on your system as Windows frequently updates the OneDrive interface.
To resolve this issue where you can use NinjaTrader without interference from OneDrive, you have several options to consider (and you may have other ideas as well):
- One option is to stop using OneDrive completely, which is unnecessary if you follow any of the other suggestions.
- Instead of completely disabling OneDrive, you may be able to set OneDrive to avoid backing up the Documents folder. This works for some people; however, it defeats one of the primary benefits of OneDrive: its ability to back up your files. Other cloud backup services (Google Drive, DropBox, etc.) allow you to selectively choose which folders within Documents are backed up - so you can exclude their backup of the NinjaTrader folders.
To do this, use an approach similar to the following - the actual steps change from time to time as OneDrive updates itself, but see if you can find similar options to the steps described here: Bring up OneDrive's settings by right-clicking on the OneDrive icon in the taskbar (the small icon that appears in the lower-right portion of the primary windows screen). Select Settings, and choose the Backup Tab. Click Manage backup, then make sure Documents is not checked. Click Start Backup, or Ok, until you're out of the Settings dialog.
- Another solution is to prevent OneDrive from backing up files while you're using NinjaTrader. You'll want to make sure that you've configured OneDrive to keep copies of all of all of your documents folder contents on your local system. This is sometimes called a "mirrored" configuration, where your desktop and cloud both have the same copies of your files - one locally, and one on the cloud, kept in sync by Onedrive. OneDrive will try to get you to not do this by claiming it will use a lot of space on your system, but most people don't have that much on their drive. Microsoft would prefer that users store their files on their cloud servers so they can be backed up, but you'll need a Microsoft subscription in order to do this. Preventing OneDrive from running can be paused by using OneDrive's Pause syncing option, which is accessible by right-clicking on the OneDrive system tray icon (a cloud icon), and clicking on the Pause syncing menu to get a choice of 2 hours, 8 hours, and 24 hours. You can always resume syncing when you're done using NinjaTrader for the day, to allow the OneDrive backups to occur. By using this feature, OneDrive won't be competing to open NinjaTrader files to back them up while you're using NinjaTrader. It has the added benefit of automatically restarting after some time. The downside is that you have to remember to disable it each time before you start NinjaTrader. Note that OneDrive is a cloud-based service and is updated frequently, so your configuration may look different from the one shown here. If it is, try to find the setting that lets you keep local copies of all your files on your system (even if Microsoft claims it uses up space on your hard drive). Let it complete the synchronization so that everything is available locally. Then pause the OneDrive sync and restart NinjaTrader again.
- Another option is temporarily closing OneDrive's sync session, by selecting Close OneDrive from the same menu as Pause syncing (as shown above). This will close OneDrive for the current session, and should automatically restart the next time you start your system (and it can do its backups at that time). Make sure you check to verify that your OneDrive syncing does actually restart when you reboot to confirm that it will automatically restart on your own system.
Some better options may come in the future, but last we checked, these two options were not available:
- A better option would be for OneDrive users to specify which folders within Documents are selectively backed up, but it's not clear how to easily exclude a folder within Documents in older versions of OneDrive. It appears that Microsoft still hasn't given us the option to select which folders with the Documents folder to back up. (Google Drive does give this ability, but not OneDrive).
- Another solution may be to move NinjaTrader's user file folder to another location, but apparently that's not currently possible in NinjaTrader. NinjaTrader has created a "feature add" support ticket in which they're considering allowing users to move their NinjaTrader user directory outside Documents, but we're not aware of that feature being in place yet.
In the meantime, be aware that OneDrive backing up the NinjaTrader user folder at the same time that NinjaTrader is using it may cause some unexpected issues, and probably should be avoided.
Some helpful links:
How to turn off, disable, or remove OneDrive
Disabling OneDrive / About moving the NT8 folder in MyDocuments
Microsoft's suggestion to stop OneDrive - unlink it
What the OneDrive icons indicate
How to disable specific folder syncing in OneDrive (from howtogeek)
Backup up your folders with OneDrive
Comments
0 comments
Article is closed for comments.