Go Back   NinjaTrader Support Forum > Application Technical Support > Automated Trading

Automated Trading Support for automated trading systems using NinjaScript. Support for our ATI (Automated Trading Interface) used to link an external application such as TradeStation and eSignal to NinjaTrader.

Reply
 
Thread Tools Display Modes
Old 04-04-2007, 08:18 PM   #1
javatrader
 
Join Date: Mar 2007
Location: Minneapolis, Minnesota, USA
Posts: 4
Thanks: 0
Thanked 0 times in 0 posts
Post imported post

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!


javatrader is offline  
Reply With Quote
Old 04-04-2007, 09:59 PM   #2
NinjaTrader_Dierk
Administrator
 
NinjaTrader_Dierk's Avatar
 
Join Date: Mar 2005
Location: Bamberg, Germany
Posts: 9,994
Thanks: 0
Thanked 7 times in 7 posts
Post imported post

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?
NinjaTrader_Dierk is offline  
Reply With Quote
Old 04-05-2007, 04:47 AM   #3
javatrader
 
Join Date: Mar 2007
Location: Minneapolis, Minnesota, USA
Posts: 4
Thanks: 0
Thanked 0 times in 0 posts
Post imported post

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


javatrader is offline  
Reply With Quote
Old 04-05-2007, 04:34 PM   #4
NinjaTrader_Dierk
Administrator
 
NinjaTrader_Dierk's Avatar
 
Join Date: Mar 2005
Location: Bamberg, Germany
Posts: 9,994
Thanks: 0
Thanked 7 times in 7 posts
Post imported post

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
NinjaTrader_Dierk is offline  
Reply With Quote
Old 04-05-2007, 05:26 PM   #5
javatrader
 
Join Date: Mar 2007
Location: Minneapolis, Minnesota, USA
Posts: 4
Thanks: 0
Thanked 0 times in 0 posts
Post imported post

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!


javatrader is offline  
Reply With Quote
Old 04-05-2007, 05:35 PM   #6
NinjaTrader_Dierk
Administrator
 
NinjaTrader_Dierk's Avatar
 
Join Date: Mar 2005
Location: Bamberg, Germany
Posts: 9,994
Thanks: 0
Thanked 7 times in 7 posts
Post imported post

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:
Code:
DefineDLLFunc: "NtDirect.dll", int, "SetUp", lpstr, int;
and
Code:
{ "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
Code:
{ 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;

NinjaTrader_Dierk is offline  
Reply With Quote
Old 04-06-2007, 06:05 PM   #7
javatrader
 
Join Date: Mar 2007
Location: Minneapolis, Minnesota, USA
Posts: 4
Thanks: 0
Thanked 0 times in 0 posts
Post imported post

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




javatrader is offline  
Reply With Quote
Old 04-07-2007, 03:46 AM   #8
NinjaTrader_Ray
Administrator
 
NinjaTrader_Ray's Avatar
 
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,352
Thanks: 10
Thanked 173 times in 101 posts
Post imported post

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
NinjaTrader_Ray 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


All times are GMT -6. The time now is 07:35 PM.

FULL RISK DISCLOSURE: Futures trading contains substantial risk and is not for every investor. An investor could potentially lose all or more than the initial investment. Risk capital is money that can be lost without jeopardizing ones financial security or lifestyle. Only risk capital should be used for trading and only those with sufficient risk capital should consider trading. Past performance is not necessarily indicative of future results. View Full Risk Disclosure.