NinjaTrader Support Forum  

Go Back   NinjaTrader Support Forum > NinjaScript Development Support > General Programming

General Programming General NinjaScript programming questions.

Reply
 
Thread Tools Display Modes
Old 12-26-2007, 09:30 PM   #1
andrewbee
Member
 
Join Date: Dec 2007
Posts: 65
Thanks: 0
Thanked 0 times in 0 posts
Default limit orders

Hi,

I have a strategy that is designed to run on a tick-by-tick basis. I want to place limit orders within this, but found it incredulous that when you place a limit order from within onBarUpdate(), they are canceled at the end of the bar and have to be resubmitted! Surely that means they are not active all the time in the market until filled? An opportunity for a fill could "slip through the cracks"? And also, is there a positive way to find out whether it has even been filled, or do you just have to check for a change in the position size? I can't believe there isn't a callback method of some sort to indicate a fill.

Thanks,

Andrew
andrewbee is offline  
Reply With Quote
Old 12-26-2007, 09:39 PM   #2
andrewbee
Member
 
Join Date: Dec 2007
Posts: 65
Thanks: 0
Thanked 0 times in 0 posts
Default

Actually I think I figured out the answer to my first question. The documentation says: "Orders are kept alive provided that they are re-submitted on each call of the OnBarUpdate() method. If the order is not re submitted, the order is then canceled.". So, it seems the same order is kept alive, rather than new ones being created and destroyed all the time.

My second question still stands though: how do you get positive confirmation of a fill? Is there any way to access the history of executed trades?
andrewbee is offline  
Reply With Quote
Old 12-26-2007, 10:45 PM   #3
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
Default

To find if a position is filled you can check for position size or even market position. You would start flat then you would be either long or short.

In NT6.5 you can do much more position management through the new IOrder object in the context of OnOrderUpdate(). This seems to be the most fitting route from what I can discern of your needs. It will fire off events like "Partial Fill", "Filled", "Cancelled", etc. Please take a look at the NT6.5 beta help guide for more description on this.
NinjaTrader_Josh 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
Stop Limit orders... pgabriel SuperDOM and other Order Entry Windows 16 03-14-2008 02:19 PM
limit orders smithy Strategy Development 3 11-30-2007 01:15 PM
Limit orders - book position kept when new orders are generated Fabrice Automated Trading 6 10-13-2007 03:16 PM
Stop Limit Orders Quicktrader10 Miscellaneous Support 3 08-11-2006 07:05 AM
Negative Limit - Stop Limit Entry Orders biswar Automated Trading 1 10-18-2005 12:58 AM


All times are GMT -6. The time now is 11:39 AM.