NinjaTrader Support Forum  

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 03-15-2006, 03:35 AM   #1
MrMilesIL
 
Join Date: Feb 2006
Location: , Illinois, USA
Posts: 20
Thanks: 0
Thanked 0 times in 0 posts
Post imported post

Hi,
I understand that I can use Stop1, Target1 in place of OrderID to get the status of an order or to change it. My question is how do you do this when you have multiple positions across mulitple instruments? THe NTORderStatus function only takes orderID and this would be the same for every position (ie Stop1, Target1, etc)

I was thinking there must be a way to send the StrategyID with the request but don't know the correct parameter input order to use in the dll call,
ie is it
dll.call(("OrderStatus",orderid, strategyid)
or
dll.call("OrderStatus, orderid,"","","","","","","","","","","",strategyi d)

Or is there some other way to do it?

THanks,

Jonathan
MrMilesIL is offline  
Reply With Quote
Old 03-15-2006, 05:26 AM   #2
NinjaTrader_Ray
Administrator
 
NinjaTrader_Ray's Avatar
 
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,164
Thanks: 6
Thanked 46 times in 32 posts
Post imported post

You need to pass in a strategy id which would uniquely identify the stop/target . This means you need to pass in a strategy id on the first order that creates the strategy. Make sure you use unique strategy ids.

Ray
NinjaTrader_Ray is offline  
Reply With Quote
Old 03-15-2006, 05:35 AM   #3
MrMilesIL
 
Join Date: Feb 2006
Location: , Illinois, USA
Posts: 20
Thanks: 0
Thanked 0 times in 0 posts
Post imported post

THanks. I am doing that. Where I'm confused is when I'm checking order status for a specific instrument/strategy combo, what do I pass through the NTORderStatus function? If I use Stop1, Target1, etc, and I have 5 open positions, how do I know which status is being reported back?
Jonathan
MrMilesIL is offline  
Reply With Quote
Old 03-15-2006, 06:42 AM   #4
NinjaTrader_Ray
Administrator
 
NinjaTrader_Ray's Avatar
 
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,164
Thanks: 6
Thanked 46 times in 32 posts
Post imported post

Sorry for the confusion. Right now there is no way to retrieve order status on a strategy based order. It is on our list. No ETA at this time.

Ray
NinjaTrader_Ray is offline  
Reply With Quote
Old 03-15-2006, 08:35 AM   #5
MrMilesIL
 
Join Date: Feb 2006
Location: , Illinois, USA
Posts: 20
Thanks: 0
Thanked 0 times in 0 posts
Post imported post

Bummer.
Let me ask the question another way. I need to determine if there is are outstanding stop & target orders for a specific instrument. I have the orderID and strategyID available. Using orderID I can determine if the entry order was filled, but how do I determine if any of the stops or targets are still open?

The issue is I am running into is with IB and forex trades. THere are no positions so NTMarketPosition always returns flat so I can't determine if I am still in a position when another signal is generated. I thought checking if any of the stops/targets are still unfilled from the last order sent from Esignal would give me the information I need.

Thanks,

Jonathan
MrMilesIL is offline  
Reply With Quote
Old 03-15-2006, 01:00 PM   #6
NinjaTrader_Ray
Administrator
 
NinjaTrader_Ray's Avatar
 
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,164
Thanks: 6
Thanked 46 times in 32 posts
Post imported post

There is no way to retrieve this information. This is a known limitation and on our list. The only thing you could do is take care of the stop/target submission on your side and not use an NT strategy.

Ray
NinjaTrader_Ray is offline  
Reply With Quote
Old 03-15-2006, 03:17 PM   #7
MrMilesIL
 
Join Date: Feb 2006
Location: , Illinois, USA
Posts: 20
Thanks: 0
Thanked 0 times in 0 posts
Post imported post

OK. THanks. Just wanted to make sure there was no way around it.

Jonathan
MrMilesIL is offline  
Reply With Quote
Old 03-16-2006, 01:33 AM   #8
NinjaTrader_Ray
Administrator
 
NinjaTrader_Ray's Avatar
 
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,164
Thanks: 6
Thanked 46 times in 32 posts
Post imported post

No problem. The problem is that there can be more than one order at the T1 level and therefore you can have multiple order states....
NinjaTrader_Ray is offline  
Reply With Quote
Old 05-11-2006, 11:38 AM   #9
bobio
 
Join Date: May 2006
Location: , ,
Posts: 6
Thanks: 0
Thanked 0 times in 0 posts
Post imported post

Hello,

Just looking for the same thing, just wondering if there has been any progress on this since March?
bobio is offline  
Reply With Quote
Old 05-11-2006, 08:05 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
Post imported post

No progress.
NinjaTrader_Dierk is offline  
Reply With Quote
Old 05-18-2006, 03:54 AM   #11
bobio
 
Join Date: May 2006
Location: , ,
Posts: 6
Thanks: 0
Thanked 0 times in 0 posts
Post imported post

Ok,

Does anybody know of any work arounds? I am using esignal to trigger with efs and IB as the broker. The ASMs are the best way to initiate the trade, but I need to know how the strategy went after it was filled. Has anybody done a method using the IB activeX controls or Ninja Script.

I would like to use something better then account p/l to calculate this.

Please please please get back to me.
bobio is offline  
Reply With Quote
Old 05-18-2006, 04:47 AM   #12
bobio
 
Join Date: May 2006
Location: , ,
Posts: 6
Thanks: 0
Thanked 0 times in 0 posts
Post imported post

Sorry to ramble, but is maybe the best way to do this:

place a strategy with an order id
if it gets filled monitor the strategy position.
If it goes flat
look at current price
if it is close to the target or above
assume success
else
assume failed trade

???

bobio is offline  
Reply With Quote
Old 05-18-2006, 06:50 AM   #13
NinjaTrader_Ray
Administrator
 
NinjaTrader_Ray's Avatar
 
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,164
Thanks: 6
Thanked 46 times in 32 posts
Post imported post

That could work.
NinjaTrader_Ray is offline  
Reply With Quote
Old 05-19-2006, 04:56 AM   #14
bobio
 
Join Date: May 2006
Location: , ,
Posts: 6
Thanks: 0
Thanked 0 times in 0 posts
Post imported post

I got this working and so far it is pretty accurate, but it would be great if in the next version you could get more information about a stratefy like relized p/l and unrelized p/l plus th stuff you can use on a regular order.

My next question is this: why would I get this error?

5/19/2006 8:21
Strategy
Entry order quantity is greater than cummulative totals of stop loss/profit target quantities
5/19/2006 8:21 Strategy Entry order quantity is greater than cummulative totals of stop loss/profit target quantities

bobio is offline  
Reply With Quote
Old 05-19-2006, 05:08 AM   #15
NinjaTrader_Ray
Administrator
 
NinjaTrader_Ray's Avatar
 
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,164
Thanks: 6
Thanked 46 times in 32 posts
Post imported post

Because the order qty of the order you are entering exceeds the total qty the strategy will manage.

If you have a strategy to manage 5 contracts, your entry order needs to be 5 contracts.
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 10:21 PM.