![]() |
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
|
|||||||
| General Programming General NinjaScript programming questions. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Member
Join Date: Feb 2011
Location: Georgia, USA
Posts: 32
Thanks: 17
Thanked 15 times in 9 posts
|
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 |
|
|
|
|
|
#2 |
|
NinjaTrader Customer Service
Join Date: Dec 2009
Location: Denver, CO, USA
Posts: 6,498
Thanks: 109
Thanked 291 times in 280 posts
|
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
Brett
NinjaTrader Customer Service |
|
|
|
|
The following 2 users say thank you to NinjaTrader_Brett for this post: |
|
|
|
#3 |
|
Member
Join Date: Feb 2011
Location: Georgia, USA
Posts: 32
Thanks: 17
Thanked 15 times in 9 posts
|
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 |
|
|
|
|
|
#4 |
|
NinjaTrader Customer Service
Join Date: Dec 2009
Location: Denver, CO, USA
Posts: 6,498
Thanks: 109
Thanked 291 times in 280 posts
|
Glad you are up and running and thanks for the good feedback!
-Brett
Brett
NinjaTrader Customer Service |
|
|
|
|
|
#5 |
|
Senior Member
Join Date: Dec 2008
Location: http://coroin.com
Posts: 156
Thanks: 8
Thanked 7 times in 7 posts
|
|
|
|
|
![]() |
| Tags |
| custom class, custom dll, custom dll installation |
| Thread Tools | |
| Display Modes | |
|
|
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 |