NinjaTrader Support Forum  

Go Back   NinjaTrader Support Forum > NinjaScript Development Support > Strategy Development

Strategy Development Support for the development of custom automated trading strategies using NinjaScript.

Reply
 
Thread Tools Display Modes
Old 02-27-2012, 07:36 PM   #1
roland_nt
Senior Member
 
Join Date: Feb 2008
Posts: 108
Thanks: 0
Thanked 0 times in 0 posts
Default manage order by 3rd party code

Is there a way (API?) to manage the exit of an order generated from within a strategy from outside the strategy?

Specifically i would like to move stops and targets on a multi contract entry (entry determined by logic in the strategy) from a program running concurrently with Ninja.
The strategy might or might not be using DOM/ATM facilities.

Thanks
roland_nt is offline  
Reply With Quote
Old 02-28-2012, 02:04 AM   #2
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,569
Thanks: 262
Thanked 1,018 times in 999 posts
Default

Hi Roland, not a full API unfortunately but an Automated Trading Interface that should offer what you seek here : http://www.ninjatrader.com/support/h...terface_at.htm

Here's all you could do with this inferface -

http://www.ninjatrader.com/support/h...o_and_how_.htm
NinjaTrader_Bertrand is offline  
Reply With Quote
Old 02-29-2012, 11:25 AM   #3
roland_nt
Senior Member
 
Join Date: Feb 2008
Posts: 108
Thanks: 0
Thanked 0 times in 0 posts
Default pick up id of trade not entered with DLL

Thanks Bertrand
The DLL appears to be the right interface, but I could not tell from the descriptions
if I could pick up from the DLL interface the details of a trade entered from strategy, i/e. a trade that was started not using the DLL API.

Can you tell me which call[s] would do that?
roland_nt is offline  
Reply With Quote
Old 02-29-2012, 12:22 PM   #4
NinjaTrader_RyanM
NinjaTrader Customer Service
 
NinjaTrader_RyanM's Avatar
 
Join Date: Sep 2009
Location: Denver, CO
Posts: 8,117
Thanks: 249
Thanked 418 times in 415 posts
Default

Hi roland_nt,

You could look into these two from the dll functions page:

string Orders(string account)
Gets a string of order ID's of all orders of an account separated by '|'. *If a user defined order ID was not originally provided, the internal token ID value is used since it is guaranteed to be unique.

string OrderStatus(string orderId)
Gets the order state (see definitions) for the orderId. Returns an empty string if the order ID value provided does not return an order.
NinjaTrader_RyanM is offline  
Reply With Quote
Old 02-29-2012, 04:23 PM   #5
roland_nt
Senior Member
 
Join Date: Feb 2008
Posts: 108
Thanks: 0
Thanked 0 times in 0 posts
Default pick up id of trade not entered with DLL

Ryan:
Just to be very certain,
1) the order id string WOULD contain orders generated from within a running strategy?
2) Is the name of initiating strategy indicated somehow?
3) are closed orders (trade completed) also in the list or only open/unfilled
Thanks for your patience
roland_nt is offline  
Reply With Quote
Old 03-01-2012, 06:08 AM   #6
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,569
Thanks: 262
Thanked 1,018 times in 999 posts
Default

Roland, it would give you access to order running on the specified account, this can include automated ones, too.

You can check for the StrategyID field of the order.

It should give you the orders string for the session being run.
NinjaTrader_Bertrand 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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Using 3rd party indicators kcyster General Programming 9 12-14-2010 09:38 AM
3rd Party Licensing DionysusToast Miscellaneous Support 4 12-10-2010 08:56 AM
3rd Party Developers stressless General Programming 0 09-29-2009 08:38 AM
3rd party indicator causing problems with modifying other code. andy2001 Miscellaneous Support 1 06-06-2008 11:20 AM
3rd Party Programming John_Aus General Programming 2 05-26-2008 10:51 PM


All times are GMT -6. The time now is 01:49 PM.