If you use OneDrive to back up your My 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.
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. The process for unwinding this is a bit convoluted, as OneDrive backs up your files to the cloud, and actually serves them to you from the cloud without keeping local copies on your system. Therefore, if you turn off the OneDrive file syncing, 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, assuring that the Save space and download files as you use them option is unchecked. This will move the copies from the cloud back to your PC, after warning you that they will no longer be backed up to the cloud and available to other computers you log into. Then, you must cut and paste the files in 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 My 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 provide a message that files have been corrupted, or it may refuse to open your charts without any 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
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 is to stop using OneDrive completely, which is not necessary 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 My Documents folder. This works for some people, however, it defeats one of the primary benefits of OneDrive, in that it provides a backup for your files. Other cloud backup services (Google Drive, DropBox, etc.) allow you to selectively choose which folders within My 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 on Manage backup, and then make sure that My 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. This can easily be done by using OneDrive's Pause syncing option, which is accessible by right-clicking on the OneDrive system tray icon, and clicking on the Pause syncing menu to get a choice of 2 hours, 8 hours, and 24 hours. You can always "un-pause" 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 again after some time. The downside is that you have to remember to disable it each time before you start NinjaTrader.
- 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 the last we checked, these two options were not available:
- A better option would be for OneDrive users to specify folders within My Documents to be selectively backed up, but it's not clear how to easily exclude a folder within the My Documents folder in older versions of OneDrive.
- Another solution may be to move NinjaTrader's user file folder to another location, but apparently, that's not a current ability of NinjaTrader. NinjaTrader has created a feature add support ticket where they're considering allowing users to move their NinjaTrader user directory to somewhere other than My Documents, but we're not aware of that feature being in place yet.
In the meantime, try to be aware that having OneDrive backing up the NinjaTrader user folder at the same time NinjaTrader is using it may cause some unexpected issues, and probably should be avoided.
Some helpful links: