Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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

    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

        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 maybeimnotrader, Yesterday, 05:46 PM
          2 responses
          21 views
          0 likes
          Last Post maybeimnotrader  
          Started by adeelshahzad, Today, 03:54 AM
          5 responses
          32 views
          0 likes
          Last Post NinjaTrader_BrandonH  
          Started by stafe, 04-15-2024, 08:34 PM
          7 responses
          32 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by merzo, 06-25-2023, 02:19 AM
          10 responses
          823 views
          1 like
          Last Post NinjaTrader_ChristopherJ  
          Started by frankthearm, Today, 09:08 AM
          5 responses
          22 views
          0 likes
          Last Post NinjaTrader_Clayton  
          Working...
          X