I realized a trading strategy using several indicators, strategy and addons combined. With many object to backup it is clumsy to be obliged to manually select all of them (even though only one has been updated) to proceed and have a consistent backup file. Is there a way to automate the backup process? Thanks for help.
Announcement
Collapse
Looking for a User App or Add-On built by the NinjaTrader community?
Visit NinjaTrader EcoSystem and our free User App Share!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less
Partner 728x90
Collapse
NinjaTrader
Programmatically backup scripts
Collapse
X
-
Programmatically backup scripts
Hi,
I realized a trading strategy using several indicators, strategy and addons combined. With many object to backup it is clumsy to be obliged to manually select all of them (even though only one has been updated) to proceed and have a consistent backup file. Is there a way to automate the backup process? Thanks for help.Tags: None
-
Hello afoschini,
Thanks for your post.
You can schedule backups when creating a backup, but you will be prompted on the schedule set.
If you want to automate this more, you could create an AddOn that automatically copies parts of the NinjaTrader 8 folder in the Documents folder to a new location. If you would like to make this a NinjaTrader compatible backup, you will have to create an Info.xml file, zip up the folder and rename it so it has a file extension of ".nt8bk" NinjaTrader backup files are renamed zip files. I would suggest making some small backups and examining the created .nt8bk file so you can better understand what needs to be included.
AddOn windows will check OnWindowCreated for the Control Center to hook in a menu item on the Control Center. You could use this to start a timer that will then schedule your automatic back up. This should then copy the necessary files and build the back up so it is identical to one that you can export from NinjaTrader.
Much of this task will be general C# programming and not specifically NinjaScript code. If you would like to reference a sample AddOn for using OnWindowCreated, you can reference the sample AddOn linked below.
Basic AddOn example linked within - https://ninjatrader.com/support/help...t_overview.htm
An external resource for creating zip files in C# can be found here - https://stackoverflow.com/questions/...io-compression
If you have any other NinjaTrader or NinjaScript related inquiries, please don't hesitate to ask.JimNinjaTrader Customer Service
-
Not backup per se, but the way I handle this for my NinjaTrader development and customization is to put everything in a git repo so that I can go back and recover different versions of what I have developed. It also allows me to move easily between my main trading machine and my laptop when I travel.
Gary.
- Likes 1
Comment
-
Automated back up software may be an applicable approach, but I would recommend leaving historical data and log & trace out since these files could be accessed constantly be NinjaTrader and could create File Access Violations that we see when using NinjaTrader with syncing software like OneDrive. These file access violations would ultimately be the circumstances you would need to prepare for in your own back up solution.
Let me know if there is any other perspective I can share.JimNinjaTrader Customer Service
Comment
-
If you're using Visual Studio, there is a handy VS Plugin called "LocalHistory for Visual studio" that automatically makes a copy of every file every time it changes. You can view all the historical versions of each file.
Extension for Visual Studio - Local History for Visual Studio automatically creates a copy everytime you save a file.
You can also use Visual Studio Team Services to check your code into a secure, private source control repo. Set this up via the Team Explorer tab (see screenshot).
I use both of these. Mostly the VSTS Source control, but LocalHistory has come in very handy too for getting back code that wasn't checked in.
1 Photo
- Likes 1
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by Mestor, 03-10-2023, 01:50 AM
|
11 responses
304 views
0 likes
|
Last Post
by z.franck
Today, 02:29 AM
|
||
Started by Padan, Today, 02:02 AM
|
0 responses
6 views
0 likes
|
Last Post
by Padan
Today, 02:02 AM
|
||
Started by bukowa, 11-09-2023, 06:07 PM
|
20 responses
407 views
0 likes
|
Last Post
by Adfra
Today, 01:36 AM
|
||
Started by yertle, Yesterday, 05:49 PM
|
2 responses
11 views
0 likes
|
Last Post
by yertle
Today, 12:12 AM
|
||
Started by kaywai, Today, 12:06 AM
|
0 responses
10 views
0 likes
|
Last Post
by kaywai
Today, 12:06 AM
|
Comment