NinjaTrader Support Forum  

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

General Programming General NinjaScript programming questions.

Reply
 
Thread Tools Display Modes
Old 07-20-2008, 03:51 PM   #1
Hyppo
Junior Member
 
Join Date: Jul 2008
Location: Maryland, USA
Posts: 5
Thanks: 0
Thanked 0 times in 0 posts
Default Using external .NET DLL's.

Hi,
I am evaluating the NinjaTrader and trying to find out its major capabilities. I have a question, for which I couldn't find an explicit answer in documentation. Can I use in NinjaTrader scripts external .NET libraries like we do in regular .NET solutions simply by referencing them? I have DLL's with methods for time series analysis, which I'd like to use while scripting custom strategies. Is it possible?
Hyppo is offline  
Reply With Quote
Old 07-20-2008, 05:47 PM   #2
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
Default

It is possible, but it is beyond the scope of what we can offer support for here on the forums.
NinjaTrader_Josh is offline  
Reply With Quote
Old 07-21-2008, 06:54 AM   #3
Hyppo
Junior Member
 
Join Date: Jul 2008
Location: Maryland, USA
Posts: 5
Thanks: 0
Thanked 0 times in 0 posts
Default

Thank you, Josh, for your prompt response. Does it mean that I still can find some documentation on how to do that?
Hyppo is offline  
Reply With Quote
Old 07-21-2008, 07:47 AM   #4
NinjaTrader_Dierk
Administrator
 
NinjaTrader_Dierk's Avatar
 
Join Date: Mar 2005
Location: Bamberg, Germany
Posts: 9,994
Thanks: 0
Thanked 6 times in 6 posts
Default

Unfortunately there is no documentation available.
NinjaTrader_Dierk is offline  
Reply With Quote
Old 07-21-2008, 10:08 AM   #5
Hyppo
Junior Member
 
Join Date: Jul 2008
Location: Maryland, USA
Posts: 5
Thanks: 0
Thanked 0 times in 0 posts
Default

Thank you. This helps me to save time searching for it.
Hyppo is offline  
Reply With Quote
Old 07-23-2008, 10:46 AM   #6
mrlogik
Certified NinjaScript Consultant
 
mrlogik's Avatar
 
Join Date: Sep 2006
Location: New York, USA
Posts: 774
Thanks: 1
Thanked 7 times in 5 posts
Default

Hyppo,

Google is your friend. Search for "import DLL .net" and you will find a wealth of information.
mrlogik is offline  
Reply With Quote
Old 07-23-2008, 12:03 PM   #7
Hyppo
Junior Member
 
Join Date: Jul 2008
Location: Maryland, USA
Posts: 5
Thanks: 0
Thanked 0 times in 0 posts
Default

Thank you, mrlogic, for you tip. I suspect you are talking about .net DLL's in general (I've been doing that for years), but I was trying to find out how to use them in NT. Out of curiosity I still searched Internet for DLL's in conjunction with NinjaTrader, but didn't see anything relevant to what I'm looking for. And even if I did, I am usually pretty cautious about using "undocumented" features. Too much at stake and not enough time! Today there is no lack of other products that do that.
Hyppo is offline  
Reply With Quote
Old 07-29-2008, 07:14 AM   #8
greentrader
Member
 
Join Date: Jul 2008
Posts: 80
Thanks: 0
Thanked 0 times in 0 posts
Default

Quote:
Originally Posted by Hyppo View Post
Thank you, mrlogic, for you tip. I suspect you are talking about .net DLL's in general (I've been doing that for years), but I was trying to find out how to use them in NT. Out of curiosity I still searched Internet for DLL's in conjunction with NinjaTrader, but didn't see anything relevant to what I'm looking for. And even if I did, I am usually pretty cautious about using "undocumented" features. Too much at stake and not enough time! Today there is no lack of other products that do that.
There's nothing special about using a DLL in NT NinjaScript C#. For a generic DLL...

using System.Runtime.InteropServices;

...

[DllImport("c:/MyFilePath/MyDLL.dll")]
public static extern double MyGetDouble(int myInput);

...

double myDouble = MyGetDouble(10);
greentrader is offline  
Reply With Quote
Old 07-29-2008, 06:43 PM   #9
Hyppo
Junior Member
 
Join Date: Jul 2008
Location: Maryland, USA
Posts: 5
Thanks: 0
Thanked 0 times in 0 posts
Default

Thank you, greentrader, for responding. Do you know what actually stands behind "C#-based script"? Is it a full-fledged C# or some proprietary subset of it? I don't remember seeing in the documentation any requirements for .NET framework.
Hyppo is offline  
Reply With Quote
Old 07-29-2008, 10:28 PM   #10
NinjaTrader_Dierk
Administrator
 
NinjaTrader_Dierk's Avatar
 
Join Date: Mar 2005
Location: Bamberg, Germany
Posts: 9,994
Thanks: 0
Thanked 6 times in 6 posts
Default

>> Is it a full-fledged C#
Correct. See our website for installation requirements (includes .NET framework).
NinjaTrader_Dierk is offline  
Reply With Quote
Reply

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
external data pgabriel Charting 12 05-10-2009 11:41 AM
external interactions Burga1 General Programming 2 05-13-2008 10:01 AM
External DLL mgbloomfield Automated Trading 1 04-18-2008 10:39 PM
external API Futures_Shark General Programming 1 08-11-2007 11:08 PM
Using DLL's in NinjaScript SigmaTrader Indicator Development 5 09-24-2006 04:23 PM


All times are GMT -6. The time now is 01:23 PM.