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 sjsj2732, Yesterday, 04:31 AM
            0 responses
            33 views
            0 likes
            Last Post sjsj2732  
            Started by NullPointStrategies, 03-13-2026, 05:17 AM
            0 responses
            286 views
            0 likes
            Last Post NullPointStrategies  
            Started by argusthome, 03-08-2026, 10:06 AM
            0 responses
            284 views
            0 likes
            Last Post argusthome  
            Started by NabilKhattabi, 03-06-2026, 11:18 AM
            0 responses
            133 views
            1 like
            Last Post NabilKhattabi  
            Started by Deep42, 03-06-2026, 12:28 AM
            0 responses
            91 views
            0 likes
            Last Post Deep42
            by Deep42
             
            Working...
            X