• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Programmatically backup scripts

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

  • afoschini
    started a topic Programmatically backup scripts

    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.

  • kevinenergy
    replied
    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.

    https://marketplace.visualstudio.com...-Visual-Studio

    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.

    Leave a comment:


  • NinjaTrader_Jim
    replied
    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.

    Leave a comment:


  • sledge
    replied
    What about an external drive that comes with backup software?

    Leave a comment:


  • garysu
    replied
    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.

    Leave a comment:


  • NinjaTrader_Jim
    replied
    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.

    Leave a comment:

Latest Posts

Collapse

Topics Statistics Last Post
Started by dr0832, 01-04-2019, 10:34 AM
7 responses
140 views
0 likes
Last Post Lancer
by Lancer
 
Started by cbentrikin, Today, 07:46 PM
0 responses
4 views
0 likes
Last Post cbentrikin  
Started by RedDuke, Today, 06:14 PM
0 responses
4 views
0 likes
Last Post RedDuke
by RedDuke
 
Started by DariusDeck, Today, 04:22 PM
1 response
11 views
0 likes
Last Post NinjaTrader_Marco  
Started by pstrusi, Today, 05:05 PM
1 response
3 views
0 likes
Last Post pstrusi
by pstrusi
 
Working...
X