• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

COM Interface ?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • smasers
    replied
    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
    Last edited by smasers; 04-17-2008, 08:51 PM. Reason: Update

    Leave a comment:


  • mgbloomfield
    replied
    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:


  • NinjaTrader_Dierk
    replied
    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:


  • smasers
    replied
    Originally posted by NinjaTrader_Dierk View Post
    I suggest trying .NET interop to access the DLL if COM is not working as expected.
    I had imported System.Runtime.InteropServices in the test that I just reported.

    Leave a comment:


  • NinjaTrader_Dierk
    replied
    I suggest trying .NET interop to access the DLL if COM is not working as expected.

    Leave a comment:


  • smasers
    replied
    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:


  • NinjaTrader_Dierk
    replied
    - 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:


  • smasers
    replied
    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:


  • NinjaTrader_Ray
    replied
    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:


  • smasers
    started a topic COM Interface ?

    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!

    Scott

Latest Posts

Collapse

Topics Statistics Last Post
Started by fredfred, Today, 04:17 PM
0 responses
9 views
0 likes
Last Post fredfred  
Started by p.lozanski, Today, 03:51 PM
0 responses
5 views
0 likes
Last Post p.lozanski  
Started by JTizz, Yesterday, 04:56 PM
1 response
25 views
0 likes
Last Post NinjaTrader_ChelseaB  
Started by brunoviveiros, Yesterday, 09:10 AM
2 responses
11 views
0 likes
Last Post NinjaTrader_ChelseaB  
Started by cyril120, Yesterday, 07:14 AM
1 response
13 views
0 likes
Last Post NinjaTrader_ChelseaB  
Working...
X