NinjaTrader Support Forum  
X

Attention!

This website will be down for maintenance from Friday May 24th at 6PM MDT until Saturday May 25th at 11AM MDT. We apologize for the inconvenience. If you need assistance during this time, please email sales@ninjatrader.com


Go Back   NinjaTrader Support Forum > NinjaScript Development Support > General Programming

General Programming General NinjaScript programming questions.

Reply
 
Thread Tools Display Modes
Old 04-19-2012, 01:16 PM   #1
sh_daggett
Member
 
Join Date: Feb 2011
Location: Georgia, USA
Posts: 32
Thanks: 17
Thanked 15 times in 9 posts
Question 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 is offline  
Reply With Quote
Old 04-19-2012, 01:35 PM   #2
NinjaTrader_Brett
NinjaTrader Customer Service
 
NinjaTrader_Brett's Avatar
 
Join Date: Dec 2009
Location: Denver, CO, USA
Posts: 6,498
Thanks: 109
Thanked 291 times in 280 posts
Default

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
NinjaTrader_Brett is offline  
Reply With Quote
The following 2 users say thank you to NinjaTrader_Brett for this post:
Old 04-19-2012, 01:58 PM   #3
sh_daggett
Member
 
Join Date: Feb 2011
Location: Georgia, USA
Posts: 32
Thanks: 17
Thanked 15 times in 9 posts
Default

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 is offline  
Reply With Quote
Old 04-19-2012, 02:31 PM   #4
NinjaTrader_Brett
NinjaTrader Customer Service
 
NinjaTrader_Brett's Avatar
 
Join Date: Dec 2009
Location: Denver, CO, USA
Posts: 6,498
Thanks: 109
Thanked 291 times in 280 posts
Default

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

-Brett
NinjaTrader_Brett is offline  
Reply With Quote
Old 09-06-2012, 08:16 AM   #5
e-man
Senior Member
 
Join Date: Dec 2008
Location: http://coroin.com
Posts: 156
Thanks: 8
Thanked 7 times in 7 posts
Default

Quote:
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
e-man is offline  
Reply With Quote
Reply

Tags
custom class, custom dll, custom dll installation

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to install custom indicator? pipsuk Installation and Licensing 20 12-12-2011 01:33 PM
NT 7 Install Failure tradetree Version 7 Beta General Questions & Bug Reports 2 09-26-2010 02:04 PM
3rd Party Dll Intellisense failure in NinjaScript tomleeson General Programming 2 10-04-2009 10:59 AM
V6 - Beta 8 Install failure jbeninga Installation and Licensing 5 03-12-2007 09:51 AM
Repeated Install Failure Sacpokr Installation and Licensing 5 12-12-2006 04:33 PM


All times are GMT -6. The time now is 07:51 PM.