Is this possible?
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
Creating a standalone "Custom" folder
Collapse
X
-
Creating a standalone "Custom" folder
Trying to find a way to move all of my strategy and indicator development under a standalone "Custom" folder in order to manage that development with source code management. (git)
Is this possible?Tags: None
-
Hello RandyT,
Thank you for your note.
This would not be possible in NinjaTrader however you could copy your NinjaTrader files to a new custom folder which your git app references, however you would have to copy paste these files back over to ninjatrader for the changes to be reflected.
I will submit a feature request for this.
Please let us know if you need further assistance.Alan P.NinjaTrader Customer Service
-
Just to make sure I understand your suggestion, you are suggesting that I should maintain the files in git, and then copy them to the existing Custom folder in order to update the platform?
If that is your suggestion, it is a bit rough but might be made to work...
It would be super helpful if even a requirement to edit a registry entry to add another Custom folder to an import list would accomplish the goal.
I've depended on source code management for too many years. It is hard not to have that fallback and associated tools.
Comment
-
Hello RandyT,
Yes, that was the suggestion, the files would need to be inside of the bin/custom folder in the appropriate folder for the platform to compile them. The only alternative would be to compile your code into a DLL and reference the DLL like a third party import. You can use visual studio to compile NinjaScript code into a dll which that code would reside outside of the bin/custom folder. This process does require the platform to restart to reload the DLL to see changes, so this would not be advisable for development and only for a release.
As far as Source control goes, that is outside of what our support can provide assistance with. You are free to use source control programs as you need, how you accomplish backing up the data would be up to you and how you find works for your goals. If you use GIT, you could potentially use a .gitignore file to only commit what you need in that project. You could also use Alan's suggestion for subfolders. Additionally, You could also search online for advance source control use and filtering for more ideas.
Please let me know if I may be of further assistance.JesseNinjaTrader Customer Service
Comment
-
I've been going round and round on that topic here: https://ninjatrader.com/support/foru...d.php?t=111207
From what I am finding, it at least requires the following layout. It is not possible to just have one folder that I could checkout within the Custom folder:
Code:Addons - myAddons Indicators - myIndicators Strategies - myStrategies
Comment
-
Alan,
I created this separate thread since I believe it to be different than the issue that Jesse was helping me with. Thanks to Jesse's persistence, that other issue is resolved.
In the interest of contributing back, on the topic of setting up git managed Custom directory, I wanted to share the following steps that I have taken to get this working in case someone else finds it helpful. This is not intended as a tutorial on how to use git source code management. Just a few notes on what it takes to get it working for NinjaTrader code management.
1. Download git for Windows from https://gitforwindows.org/
2. Recommend installing with the bash terminal, especially if you are familiar with Unix/Linux environment.
3. Configure your name and email address for git
Run
git config --global user.email "[email protected]"
git config --global user.name "Your Name"
to set your account's default identity.
cd $HOME/Documents/NinjaTrader 8/bin/Custom
mkdir -Path AddOns/myAddOns
mkdir -Path indicators/myIndicators
mkdir -Path Strategies/myStrategies
6.
cd $HOME/<random temp folder>
mkdir -Path AddOns/myAddOns
mkdir -Path indicators/myIndicators
mkdir -Path Strategies/myStrategies
cp $HOME/Documents/NinjaTrader 8/bin/Custom/AddOns/myAddons/*.cs ./AddOns/myAddOns/
cp $HOME/Documents/NinjaTrader 8/bin/Custom/AddOns/myAddons/*.cs ./Indicators/myIndicators/
cp $HOME/Documents/NinjaTrader 8/bin/Custom/AddOns/myAddons/*.cs ./Strategies/myStrategies/
git init
git add .
git commit -m "first commit"
git remote add origin ssh://[email protected]/mygithub/myNTrepo.git
git push -u origin master
git clone sh://[email protected]/mygithub/myNTrepo.git
cd myNTrepo
mv .git $HOME/Documents/NinjaTrader 8/bin/Custom/
cd $HOME/Documents/NinjaTrader 8/bin/Custom
de-DE
es-ES
fr-FR
obj
pt-PT
ru-RU
zh-Hans
*.resx
*.dll
*.csproj
AssemblyInfo.cs
NinjaTrader.Vendor.cs
Resource.Designer.cs
ResourceEnumConverter.cs
ExportNinjaScript/
Indicators/*.cs
Indicators/TG/
Strategies/*.cs
AddOns/*.cs
@*.cs
$ git status
On branch master
Your branch is up to date with 'origin/master'.
nothing to commit, working tree clean
Hope someone finds this useful.
- Likes 3
Comment
-
-
so nobody here has any problem with trying to get .gitignore to ignore NinjaTrader.Custom*.dll files? I tried naming them explicity in .gitignore, *.dll, and variations with wildcards in the name... can't get any of them to work. But I can ignore other files, it leads me to believe that there is some problem with the way these files are named... but if I'm the only one having this problem (both with git on VS and VS Code) then I really don't understand what is going on... can anyone send some insight? I'm no git configuration expert.
Comment
-
Originally posted by NinjaCustomer View Postso nobody here has any problem with trying to get .gitignore to ignore NinjaTrader.Custom*.dll files? I tried naming them explicity in .gitignore, *.dll, and variations with wildcards in the name... can't get any of them to work. But I can ignore other files, it leads me to believe that there is some problem with the way these files are named... but if I'm the only one having this problem (both with git on VS and VS Code) then I really don't understand what is going on... can anyone send some insight? I'm no git configuration expert.
Code:.vs/ *.resx *.dll *.csproj *.xml AssemblyInfo.cs NinjaTrader.Vendor.cs NinjaTrader.Custom.sln NinjaTrader.Custom.* Resource.Designer.cs ResourceEnumConverter.cs ExportNinjaScript/ Indicators/*.cs Indicators/TG/ Strategies/*.cs AddOns/*.cs BarsTypes/*.cs @*.cs
Comment
-
thanks Randy, I figured it out finally - I had accidentally committed some dlls originally. So I committed their deletions and all is well now. You have some useful ignores there - I'll add them to mine.
Comment
-
Randy, thanks so much. I think I have it working, and this saved me a ton of time; not to mention possible code losses into the future. Much appreciated.
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by johnMoss, 03-04-2024, 01:53 PM
|
3 responses
46 views
0 likes
|
Last Post
by AndyM
Today, 06:13 PM
|
||
Started by algospoke, Today, 06:01 PM
|
0 responses
8 views
0 likes
|
Last Post
by algospoke
Today, 06:01 PM
|
||
Started by cre8able, Today, 05:53 PM
|
0 responses
8 views
0 likes
|
Last Post
by cre8able
Today, 05:53 PM
|
||
Started by Wessel, 03-23-2024, 02:37 PM
|
3 responses
24 views
0 likes
|
Last Post Today, 04:58 PM | ||
Started by martini, Yesterday, 04:45 PM
|
4 responses
32 views
0 likes
|
Last Post
by martini
Today, 04:48 PM
|
Comment