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

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Custom DLL Install Failure

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

    Custom DLL Install Failure

    Boy do I feel stupid. But here goes...

    I have a simple class called TestClass that has an empty constructor and one simple public method that returns a string: GetColor(). That's it. I compile the thing using SharpDevelop, copy the DLL to ...\My Documents\NinjaTrader 7\bin\Custom, then run NinjaTrader and edit my very simple test indicator. I add the reference via the References dialog and add the using statement to include the namespace (MyTest). In the OnStartUp event handler, I create an instance and call GetColor to store the color in a string instance variable. All that seems straight forward, but I'm obviously missing something. Restarting Ninja does not help.

    The code terminates (does not generate an exception, just terminates) when it gets to the line that creates the instance. If I comment out all the lines referring to the included class, it runs fine. Once I uncomment the line that creates the class, it just terminates when it runs in the chart window. (The code that uses this simple test paints the color of the bars. The test class returns "Blue" and the default color is "Red". With the above mentioned lines commented out, the bars paint Red. Otherwise Gray. I put a MessageBox.Show("OnStartUp") in the OnStartUp handler just before the creation of the TestClass, and it does not display when the line is uncommented. Everything compiles fine, although intellisense does not work for the TestClass. It seems like the runtime is not seeing the referenced class as it builds something. I am obviously missing something!)

    Is there a reference somewhere that explains in detail what you need to do to create an assembly that plugs into NinjaTrader for use from custom NanjaScript indicators and strategies?

    Any help you can offer is greatly appreciated!

    Thanks
    sh_daggett
    NinjaTrader Ecosystem Vendor - NinjaLaunchpad

    #2
    Hello,

    Thanks for the forum post and welcome to the NinjaScript support forums.

    Although this is a bit outside of what we can officially support I suspect the primary issue may be how the .DLL is compiled. It needs to be compiled for .NET 3.5 as .net 4.0 DLL's will not run in NinjaTrader.

    This would be my first item to check, also when you add the reference and compile to clarify you don't run into any reported compile issues?

    -Brett
    BrettNinjaTrader Product Management

    Comment


      #3
      Ha! Ninja Bret!!!! You da MAN!

      That was it. Changed compile target to 3.5 Client Profile and we're off to the races.

      So...how do I tell your boss how fast and great you are?

      Many thanks.

      - sh_daggett
      sh_daggett
      NinjaTrader Ecosystem Vendor - NinjaLaunchpad

      Comment


        #4
        Glad you are up and running and thanks for the good feedback!

        -Brett
        BrettNinjaTrader Product Management

        Comment


          #5
          Originally posted by NinjaTrader_Brett View Post
          <snip>
          [dll] needs to be compiled for .NET 3.5 as .net 4.0 DLL's will not run in NinjaTrader.
          <snip>
          you should make this a sticky :-)

          cheers,
          -e

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Mberg, Today, 05:13 PM
          0 responses
          0 views
          0 likes
          Last Post Mberg
          by Mberg
           
          Started by Barry Milan, Today, 01:33 PM
          2 responses
          7 views
          0 likes
          Last Post marcus2300  
          Started by NW Trader, Today, 03:42 PM
          2 responses
          7 views
          0 likes
          Last Post NW Trader  
          Started by ralett, Today, 01:42 PM
          1 response
          4 views
          0 likes
          Last Post NinjaTrader_ShawnB  
          Started by dkbyond, Yesterday, 04:11 PM
          1 response
          22 views
          0 likes
          Last Post NinjaTrader_ChrisL  
          Working...
          X