If you use OneDrive to back up your My Documents folder in windows, it might be creating problems for NinjaTrader.
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.”
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.
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 to temporarily close 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.
- 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.