PDA

View Full Version : 2x PC Platform ATI Connectivity


javatrader
04-04-2007, 08:18 PM
I am running WINXP , TradeStation 8.2 on PC-I, and Ninja Trader 6with Interactive Brokers on PC-II. The e-mail ATI has been working fine... However, I have been unsuccessful in getting the NTDirect.DLL from PC-I to PC-II to route communications from the NT Sample Strategy. I would like accomplish this so I can have NT manage the trade to completion once triggered by There are no issues if I run Ninja locally with TradeStation (trouble analysis).

I am comfortable with my LAN/ NIC / firewall port permission settings. As well as how Ninja Trader is setup. I am thinking the issue is where the dll file is located (C:Windows\system32) and where it is looking for port 36973. TS Error is "Failed to initialize NinjaTrader DLL NT Direct.dll". The TS event log states "User dll error".

I am confident my disired configuration's is common for resource division throughout the platform.... I am unexperienced with manipulating dlls for intra PC communications...Any direction and or sample easy language (not what is on this site) for the described setup is appreciated!! Thank you!

NinjaTrader_Dierk
04-04-2007, 09:59 PM
Let's take this step by step, simple things first:

Please install latest NT6B10 on the same PC as TS and try to get it running. I know you want to have it running on 2 different machines but let's go from simple to complicated.

Also: Do you want to send orders to NT or use TS realtime data as NT price feed?

javatrader
04-05-2007, 04:47 AM
Hello Dierk -

- I am able to apply the "NTSample " strategy on the "local" PC with the three componants (NT v. 6.0.0.10, TS v 8.2 - 3863, IB v870.2). No issues with placing orders....

Currently, the NT data-feed comes from IB. I use TS as a dedicated charting and strategy trigering platform with NT managing the trade. I have up to 8 SuperDoms managing trades simultaneously..... I have to manually place the trade in the SuperDom. The email works, but it is my understanding that I can not appy the NT ASM, which is critical for me.

I am familiarwith the data-feed setup from TS to NT. I could not see the advantage, as I use IB.Perhaps I am missing something there....

Thanks

NinjaTrader_Dierk
04-05-2007, 04:34 PM
Let's recap:
a) you not longer see the "Failed to initialize NinjaTrader DLL NT Direct.dll" problem if you run TS and NT on the same machine, correct?
b) I did not understand what your problem regarding the ATM strategy in the DOM. Could you please elbaroate?
c) if (b) is resolved we can move onand try to locate NT on a different machine than TS

javatrader
04-05-2007, 05:26 PM
Dierk -

Answers to your inquiry below..

a) Resolved

b) It is my understanding that you cannot request the specific NT Super DOM ATM Strategywith Easy Language utilizing the e-mail (SMTP) ATI. Subsequently, I am pursuing the dll method. It had appearedrelatively easy to convert my collection of TS strategy's over to dll.

c) If we are in agreement on "b"...let's proceed with getting the two PC's connect via the designated port.

Thanks!

NinjaTrader_Dierk
04-05-2007, 05:35 PM
a) great
b) You can start an ATM strategy using the ATI dll methods. You can not start an ATM strategy using the email interface. Does this make sense?
c) Here is what you need to do:
- you now have installed NT and TS on machine A
- please install NT on machine B as well. Leave it installed on machine A as well.
- start TS on machine A and NT on machine B
- your EL script on TS needs to amended, since by default ATI tries to open a connection to NT running on machine A. Here are the lines you need to add to your TS script:
DefineDLLFunc: "NtDirect.dll", int, "SetUp", lpstr, int;
and
{ "SetUp" needs to be called before the very first NT ATI call }
if CurrentBar = 1 then begin
SetUp("remote-machine-name-or-ip", 36973);
end;
This basically opens a connection to NT on machine B ("remote-machine-name-or-ip") using ATI default port 36973.

If you e.g. amended the NTExternalFeed TS strategy it would look like that
{ Copyright (c) 2005, NinjaTrader LLC ninjatrader@ninjatrader.com }
[IntrabarOrderGeneration = TRUE]

DefineDLLFunc: "NtDirect.dll", int, "Ask", lpstr, double, int;
DefineDLLFunc: "NtDirect.dll", int, "Bid", lpstr, double, int;
DefineDLLFunc: "NtDirect.dll", int, "Last", lpstr, double, int;
DefineDLLFunc: "NtDirect.dll", int, "SetUp", lpstr, int;

vars: vol(Volume);

{ "SetUp" needs to be called before the very first NT ATI call }
if CurrentBar = 1 then begin
SetUp("remote-machine-name-or-ip", 36973);
end;

if LastBarOnChart then begin
if Volume > Volume[1] then
vol = Volume - Volume[1];

Ask(GetSymbolName, CurrentAsk, AskSize);
Bid(GetSymbolName, CurrentBid, BidSize);
Last(GetSymbolName, Close, vol);
end;

javatrader
04-06-2007, 06:05 PM
Thank you Dierk! I am fully connected!

OT question... My initial goal here is to have NT manage the trade once triggered by TS via an NTBUY or NTSELL Market. Is it nesscary to put a line item in EL to identify the ATM strategy for the order. Else does it place the order with the ATM strategy selected in the DOM?

If I need to code it on the TS side, where, and how in EL does the ATM DOM strategy need to be coded?

I am a little confused in the help documents on the references to "strategies".. It would seem that there are multiple types..ie ID, template, and ATM strategy.

Thanks again, Brian

NinjaTrader_Ray
04-07-2007, 03:46 AM
Yes, you have to specify the ATM strategy otherwise its just a plain order. See the NTCommand() function.

Template name refers to the ATM strategy template that is created in the SuperDOM
id is a user generated identifier string so that you can reference a live working strategy to modify its orders etc...

Ray