Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to properly develop NinjaTrader strategy / indicators on two computers...

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

    How to properly develop NinjaTrader strategy / indicators on two computers...

    Hello awesome NinjaTraders support staff!

    I regularly need to develop a complex strategy and associated indicators on two different computers.

    Unfortunately, if I use Windows Explorer to simply copy the files from one computer to the other I find that the the indicators do not appear in the NT8 indicator window. (i.e. I cannot insert them into a chart for example)

    I've tried restarting NT8 to no avail. I've also loaded each indicator in the NinjaScript Editor to manually compile each one, and while everything compiles fine and I restart NT8 afterwards the indicators still do not appear in the Indicator GUI for insertion into a chart.

    Using Windows Explorer to manually insert new files into the NT8 folders probably gets the NT code cache corrupted and possibly explains the weird issues I'm seeing...

    Q1: Is there a way to force a 'rebuild all' in NinjaTrader so I can use file syncing software to keep my many files in sync?
    Q2: Is there some code versioning software that can run with NT8 (e.g. Git, Mercurial, SourceTree, etc)
    Q3: What is the 'right way' to develop indicators / strategies on two different machines?

    Thanks!

    #2
    Hello JPPoulin,

    Thanks for your post.

    If you have a NinjaScript Editor open, scripts will automatically compile when you drop them into the bin/Custom folder. If the scripts are dropped in but not compiled, the NinjaScript Editor will need to be opened and then you can recompile with F5.

    Please ensure that there are no errors in the log tab of the Control Center if an indicator is not listed. If there are errors, this would point to an issue with the script's OnStateChange method or another issue with the script where it fails before it lists.

    If there are no errors, but you do not see the initiators in the GUI after recompiling, please be sure you are looking for the indicator in the GUI by its Name Property set in OnStateChange under State.SetDefaults. The GUI will not list the indicator by class or file name.

    We don't recommend using automatic syncing software with NinjaTrader as it can create file access violations between NinjaTrader and the syncing software, but I would not see any issue using version control software like Git to maintain a NinjaScript source code repository. I would say that would be the ideal way to develop on two different machines. I'll leave the thread open for other community members who would like to share their input for using version control with NinjaTrader.

    We look forward to assisting.
    JimNinjaTrader Customer Service

    Comment


      #3
      Hi Jim, thanks for the prompt and useful answer.

      Looking further into this, I eventually realized that most of my indicators would not load (and show in the Indicator GUI) because of an error with a static class instance I didn't initialize properly that would influence all of them.

      Good to know however that I can drop in files with Windows Explorer (or other OS-based file sync methods such as what Git uses) and that if a Script Editor is opened it will trap the file changes and automatically recompile.

      Great work!

      Comment


        #4
        Hi Forum:

        I want to use the same function (e.g. CalculateTradeLevels(double idLow, double idHigh) ) within different indicators; how can I access this function from multiple indicators source files, while maintaining it in just one place?
        If I remember correctly, in "C" this was done via an include statement (e.g. #include function.c ) - so basically looking for a way to create a repository for commonly used methods.

        Thanks for your help
        Last edited by abctrader; 07-23-2020, 03:35 AM.

        Comment


          #5
          Hello abctrader,

          You can follow an approach like the below to add code to the Indicator namespace and place that source file in the AddOns folder.



          We look forward to assisting.
          JimNinjaTrader Customer Service

          Comment


            #6
            You can also try the techniques in this thread.
            See here also.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by josh18955, 03-25-2023, 11:16 AM
            6 responses
            435 views
            0 likes
            Last Post Delerium  
            Started by FAQtrader, Today, 03:35 PM
            0 responses
            3 views
            0 likes
            Last Post FAQtrader  
            Started by rocketman7, Today, 09:41 AM
            5 responses
            18 views
            0 likes
            Last Post NinjaTrader_Jesse  
            Started by frslvr, 04-11-2024, 07:26 AM
            9 responses
            126 views
            1 like
            Last Post caryc123  
            Started by selu72, Today, 02:01 PM
            1 response
            12 views
            0 likes
            Last Post NinjaTrader_Zachary  
            Working...
            X