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!
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
NinjaTrader
COM Interface ?
Collapse
X
-
VB.Net and NinjaTrader.Client.dll
[quote=mgbloomfield;36051]I've had no problems using C#.net with NinjaTrader.Client.Dll
It works fine under VB.Net as well. Just a couple of other questions.
1. Is NinjaTrader.Client.dll COM or a managed assembly?
2. NT advises to use NTDirect.dll because of some issues with the COM interface. If NinjaTrader.Client.dll is a managed assembly, then the COM dll must be something else. If it is the COM that they refer to in the documentation, do you know of any serious issues?
Scott
-
I've had no problems using C#.net with NinjaTrader.Client.Dll
I have never tried VB.net. It shouldn't make a difference anyway.
Leave a comment:
-
Great. However, this makes no difference, since this is not .NET interop to access native code DLLs. Please consult the MS documents on that issue.
Leave a comment:
-
I suggest trying .NET interop to access the DLL if COM is not working as expected.
Leave a comment:
-
I imported the NTDirect.dll into my VB.Net app with the following results:
1. The API "Connect" command appear to work. The return value is 0, indicating success. If I disable ATI in the Control Center, then the return value is -1, as would be expected.
2. Unfortunately, I can't get any of the commands to work. They execute, but do not return anything meaningful. For example,
Dim sStrategies as String = ""
sStrategies = Strategies("Sim101")
returns <nothing> in sStrategies (which was initialized to "")
My guess is that strings are not being passed properly between my VB.Net app and the NTDirect.dll. I am going to investigate this by writing a C# wrapper for the API functions.
My questions is...Does anyone have (or know of) a VB.Net application working with the ATI? Or am I breaking new ground here??
Tx,
Scott
Leave a comment:
-
- NT supports the DLL and the COM ATI and nothing else. We recommend not to mess around with any other NT assembly/dll.
- we recommend the DLL interface over the COM interface since it works better for most users
- unfortunately there is no further information and samples available than those you already found
Thanks for your understanding
Leave a comment:
-
Basics of what I need
Perhaps I should have started with the basics:
1. My requirement is that I have a VB.Net external app and want to link to NT via the ATI to place and mange orders. It's that simple.
2. I started by asking about a COM Interface, which resulted in a recommendation to not use COM and go with NTDirect.dll. Upon my own research, I discovered that NTDirect.dll is just a regular C (unmanaged) dll. I would only use this as a last resort.
3. I then 'poked' around and found the file NinjaTrader.Client.dll. It turns out to be a managed assemply that contains external defs of the documented ATI interface. I added the reference to my VB.Net application. However, when I call the functions from my VB.Net app, they don't abort, but they don't work either. For example:
Private oClient = New NinjaTrader.Client.Client()
Dim iConnect as Integer=oClient.Connect(1)
Dim sStrategies as String = oClient.Strategies("Sim101")
Yes, the ATI menu choice is selected in NT and I do have strategies defined for the "Sim101" account, but the variable 'sStrategies" contains the null string upon return from the call. The 'Connect' returns a '0' indicating that it worked, but I have no evidence that it really did work. (there is nothing on the control panel that I could find that it accepted a connection from an external app). I also tried other functions, like:
iret = oClient.SubscribeMarketData("ES 06-08")
iret = oClient.Ask("ES 06-08", price, size)
They appear to execute, but do not provide any meaningful data.
The bottom line is that I have a simple requirement to access the ATI via my external VB.Net application. The API is (sparsley) documented at the NT website, and that is OK; as long as I can access it, I can try to figure out how it all works. However, there is no documentation that I have found that explains clearly and concisely how to do reference the API in various environments (including what files are what). So I am spending my time rooting around trying various things, without much success.
So, please, help me. I am trying to be a good customer. All I need to know is the basics of how to access the ATI API from an external VB.Net application. And BTW, it wouldn't take more than a paragraph or two to document how the various dlls NT has fit together so that developers can get off to a better start.
And finally, we do love NinjaTrader. It's great!!
Scott Masters
www.tic2tic.com
Leave a comment:
-
Unfortunately there is no more documentation. We do suggest that you use DLL interface as we have had reported issues with COM in the past. Search for NTDirect.dll on your PC.
Leave a comment:
-
COM Interface ?
Can anyone please answer the following questions for me:
1. Where is the COM Interface dll? What is it's name? I tried MBTCom.dll, since it was in the bin directory of the installation, but I cannot find any definitions that relate to the COM interface documentation? So, at this point, I am just guessing by looking at the files in the bin directory. Maybe it's not even there, do you have to ask for it?
2. Is there any other programming documentation on the COM interface OTHER than what is at the web site? Say, examples perhaps? The website doc is fine for a general overview, but there is no detailed description of the functions along with examples.
Thanks!
ScottTags: None
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by quantismo, Today, 05:13 PM
|
0 responses
3 views
0 likes
|
Last Post
by quantismo
Today, 05:13 PM
|
||
Started by AttiM, 02-14-2024, 05:20 PM
|
8 responses
166 views
0 likes
|
Last Post
by jeronymite
Today, 05:00 PM
|
||
Started by cre8able, Today, 04:22 PM
|
0 responses
7 views
0 likes
|
Last Post
by cre8able
Today, 04:22 PM
|
||
Started by RichStudent, Today, 04:21 PM
|
0 responses
5 views
0 likes
|
Last Post
by RichStudent
Today, 04:21 PM
|
||
Started by cre8able, Today, 04:16 PM
|
0 responses
8 views
0 likes
|
Last Post
by cre8able
Today, 04:16 PM
|
Leave a comment: