![]() |
|
|||||||
| General Programming General NinjaScript programming questions. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Member
Join Date: Dec 2007
Posts: 65
Thanks: 0
Thanked 0 times in 0 posts
|
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 |
|
|
|
|
|
#2 |
|
Member
Join Date: Dec 2007
Posts: 65
Thanks: 0
Thanked 0 times in 0 posts
|
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? |
|
|
|
|
|
#3 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
|
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.
Josh
NinjaTrader Customer Service |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
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 |