Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Using Visual Studio 2008

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

    Using Visual Studio 2008

    I am using VS2008 to develop a dll involved in a strategy.

    At the moment I am modifying the code, saving the project, copying the dll into the Ninja custom directory, starting up Ninja etc.

    This is obviously a pain after each small modification.

    Is there a way I can run Ninja and modify the dll at the same time? I know there is something in User Manual about attach to process but it really did not make much sense to me.

    #2
    Hi MicroAl,

    I didn' t find a perfect solution.

    If you can do without NinjaTrader:
    My choice is to write a console test application that calls into the dll.

    if you must be in Ninja: Compile all the source within Ninja, test and debug , and only when all is working fine convert to a dll.

    Usually a mixture:
    As soon as a class/code piece/part is working fine I start pulling it out of the Ninja .cs files into a dll.

    regards

    Comment


      #3
      MicroAl, are you referring to this?



      This way you can debug code in the NinjaScript editor using the VS debugging tools and breakpoints.

      Comment


        #4
        Using Visual Studio 2008

        Hmmm

        I am developing a windows form that communicates with Ninja. Obviously Visual Studio makes this easy, and creates the dll but its a pain to keep saving and opening up Ninja again. The form is loaded by a strategy as per the example on this forum.

        Is there an alternative to the dll route? Still trying to get my head round this C# stuff. Know this is unsupported but I am not looking for precise coding instructions, just wondered if their was an easier way to work on a form in Visual Studio and run Ninja to test it without all the saving and closing etc.

        Comment


          #5
          There are several better ways but they are all advanced techniques

          The easiest way is using 2 external dll's.. one which is static and contains an interface that the other dll implements. Ninja only references this static dll and all communication passes through it.

          The static dll then loads the 'dynamic' dll which contains the actual implementation. So you can recompile the dynamic dll in visual studio at any time, then have the static dll reload it in the indicator Initialize() method.

          This is a basic version of Dependency Injection/Inversion of Control which is an advanced but very common technique in object oriented languages like java or c#.

          It can save you a lot of time but in the beginning there is a lot of plumbing code which must be written to allow the dll's to communicate indirectly through interfaces.

          If you think this is something you want to pursue look for LinFu SimpleIoC on codeproject for a very simple implementation which you can modify to work with Ninja.

          Comment


            #6
            Using Visual Studio 2008

            Thanks everyone for the suggestions.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            558 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            324 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            101 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            545 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            547 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X