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


No announcement yet.

Partner 728x90


Creating a standalone "Custom" folder

  • Filter
  • Time
  • Show
Clear All
new posts

    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?
    Last edited by RandyT; 07-20-2018, 03:46 PM. Reason: Make title more accurate.

    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.


        Hello Randy,

        You can put folders inside the indicator folder and put your scripts in there. Would this work for you?

        I look forward to your reply.
        Alan P.NinjaTrader Customer Service


          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


            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:

                         - myAddons
                         - myIndicators
                         - myStrategies
            Not ideal, but might be workable if some of the issues I am running into with partial classes in Strategies worked. I'm currently working on a different approach that is working for me in AddOns which does require an object reference to use these methods but at least works. The challenge seems to be with putting a partial class in a subfolder (which may very well be my lack of knowledge on the inheritance topic).


              Hello RandyT,

              Rather than have 2 people working on the issue I suggest you follow the advice of Jesse who is the best resource on the topic.

              Thank you.
              Alan P.NinjaTrader Customer Service



                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

                git config --global user.email "[email protected]"
                git config --global user.name "Your Name"

                to set your account's default identity.
                4. Replicate the folder layout you would like to use for your own local Indicator, AddOn and Strategy development. Something like the following:

                cd $HOME/Documents/NinjaTrader 8/bin/Custom
                mkdir -Path AddOns/myAddOns
                mkdir -Path indicators/myIndicators
                mkdir -Path Strategies/myStrategies
                5. Create or move any NinjaScript code that you want to put under your own git source code management into the respective folders shown above.

                cd $HOME/<random temp folder>
                mkdir -Path AddOns/myAddOns
                mkdir -Path indicators/myIndicators
                mkdir -Path Strategies/myStrategies
                7. Copy any of the Ninjascript files that you relocated into personal folders in step #5 into this temporary file layout.
                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/
                8. This step assumes that you have a remote git repository that you have created a clean repo to store your NT files.
                git init
                git add .
                git commit -m "first commit"
                git remote add origin ssh://[email protected]/mygithub/myNTrepo.git
                git push -u origin master
                9. With the following steps, since it is not easy to clone this partial set of files into an existing NT Custom folder, the following steps work around the challenge.
                git clone sh://[email protected]/mygithub/myNTrepo.git
                cd myNTrepo
                mv .git $HOME/Documents/NinjaTrader 8/bin/Custom/
                10. Now change to the Ninjatrader Custom folder
                cd $HOME/Documents/NinjaTrader 8/bin/Custom
                11. Edit a file named `.gitignore` and put the following contents in that file.
                12. Run `git status` and look for output.
                $ git status
                On branch master
                Your branch is up to date with 'origin/master'.

                nothing to commit, working tree clean
                13. If you see the above output, then you are set. git will track source code changes for you. If you see other output identifying untracked files, you may need to add patterns to the `.gitignore` to exclude them from management.

                Hope someone finds this useful.


                  Hello RandyT,

                  Thank you for sharing this with the forum.
                  Alan P.NinjaTrader Customer Service


                    Looking forward to trying your suggestions Randy.


                    Latest Posts


                    Topics Statistics Last Post
                    Started by aligator, Today, 10:11 PM
                    0 responses
                    1 view
                    Last Post aligator  
                    Started by psquare, Today, 03:11 PM
                    4 responses
                    Last Post psquare
                    by psquare
                    Started by ballboy11, Today, 03:20 PM
                    1 response
                    Last Post NinjaTrader_ChelseaB  
                    Started by tonynt, Today, 02:18 PM
                    1 response
                    Last Post NinjaTrader_JoshG  
                    Started by denalek2419, Today, 01:46 PM
                    3 responses
                    Last Post NinjaTrader_ChristopherJ