Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Namepaces in other directory

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

    Namepaces in other directory

    Hi,

    I have some 3rd party (open source) namespaces (.cs files) that contain certain complicated mathematical calculations that I want to use for an indicator. It is quite a large number of files. I have moved them to the bin\indicator directory and everything compiles nicely (though I don't know yet if they will actually work, since I haven't called the methods yet)

    However, I would prefer to have them in a different location, not mixed with all the indicator files. For example it would be great if I could put them in a subdirectory like bin\indicator\special\. But that doesn't workt, they have to be in the indicator directory.

    Is there a way to accomplish this? Or if not, do you have any suggestions how I could organise this to keep the overview?

    #2
    Unfortunately not. There is no functionality for organizing these at this point in time.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Is there a plan to do this in NT7? If only NT would look in subdirectories below bin\indicator\ or bin\strategy\ that would already be very helpful.

      Comment


        #4
        It is on our list of future considerations. Unfortunately this is not a feature in the feature list of NT7 though.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          Would it be possible to just compile them to dlls that I store somewhere and that I can just call them? Such that I can remove the .cs files from my indicator directory? After all I'm not going to change these 3rd party methods (but will change the indicator part). But I guess the .cs code has to be present if I (re-)compile my indicator?

          Sorry if this is a stupid question, I have never looked into these kind of things before.

          Comment


            #6
            If you had the files compiled as DLLs you can right click and add references to the DLL in the NinjaScript Editor and locate the files elsewhere. Would not know if this would actually work though, but is worth a shot.
            Josh P.NinjaTrader Customer Service

            Comment


              #7
              OK, I'll give that a try

              Last question: how can I compile these files into a DLL that I can reference to using NT?

              Comment


                #8
                You could try exporting them as NinjaScript assemblies? Otherwise you would have to do it externally through other software which I would not be able to support.
                Josh P.NinjaTrader Customer Service

                Comment


                  #9
                  OK, I have tried converting to a DLL using the 'export' function and then linking to it using 'Reference' in the scripteditor. That doesn't work. The whole thing gets messed up and NT is complaining that it cannot find all kind of stuff. Even the default indicators stop working.

                  However, what DOES work is removing all strategies and indicators except @Indicator.cs and @Strategy.cs, placing my 3rd party .cs files in the indicator directory and compile. After this rename NinjaTrader.Custom.dll to specialfunctions.dll, remove all 3rd party .cs and restore the indicator and strategy directories to their original state and restart NT. Then link to 'specialfunctions.dll' using 'reference' in the scripteditor.

                  This works perfect! I can now store the almost 100 3rd party .cs files in a safe place where they don't pollute my indicator directory. This is exactly what I want.

                  Thanks for your help!

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by Renejm, Today, 06:17 AM
                  0 responses
                  3 views
                  0 likes
                  Last Post Renejm
                  by Renejm
                   
                  Started by kazisl, Yesterday, 06:41 PM
                  2 responses
                  10 views
                  0 likes
                  Last Post NinjaTrader_PaulH  
                  Started by impactX, 05-04-2021, 01:07 AM
                  2 responses
                  11 views
                  0 likes
                  Last Post NinjaTrader_Melissa  
                  Started by op1031, Yesterday, 05:51 PM
                  1 response
                  9 views
                  0 likes
                  Last Post NinjaTrader_PaulH  
                  Started by aaadetos, 05-04-2021, 09:28 AM
                  3 responses
                  14 views
                  0 likes
                  Last Post NinjaTrader_Heath  
                  Working...
                  X