![]() |
This website will be down for maintenance from Friday May 24th at 6PM MDT until Saturday May 25th at 11AM MDT. We apologize for the inconvenience. If you need assistance during this time, please email sales@ninjatrader.com
|
|||||||
| 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. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Junior Member
Join Date: Jan 2009
Posts: 28
Thanks: 0
Thanked 0 times in 0 posts
|
Hello,
It is my understanding that duplicate orders (unfilled, same underlying, same quantity, same direction) will be cancelled. Does anyone know a way to either override this or make a strategy pause before sending another order with the same attributes? Thanks |
|
|
|
|
|
#2 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
|
worow@yahoo.com,
You can use your own flags to limit resending. Code:
if (some condition && flag)
{
EnterLongLimit(...);
flag = false;
}
if (position changes or execution received)
flag = true;
Josh
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
Junior Member
Join Date: Jan 2009
Posts: 28
Thanks: 0
Thanked 0 times in 0 posts
|
Thanks Josh,
Would the live until cancel bool work in this situation? Suppose you're looking at stocks A, B and C. A event happens that triggers a buy A, sell B order. Before the fills for A and B return an event happens that triggers a buy C and sell B set of orders. I'm still not sure if the first sell B order gets canceled or the second and will the liveuntilcancel bool prevent either from being canceled? |
|
|
|
|
|
#4 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
|
Not sure what you mean. Just because you call ExitLong() again does not cancel the order. If anything it will either a) keep it alive or b) modify it to the new parameters you are calling the exit with.
Josh
NinjaTrader Customer Service |
|
|
|
|
|
#5 |
|
Junior Member
Join Date: Jan 2009
Posts: 28
Thanks: 0
Thanked 0 times in 0 posts
|
Hi Josh,
This is the kind of situation I am trying to avoid: In my output window I recieve the following trace message: Ignored PlaceOrder() method... Reason = "There is already a matching order with the same prices and quantity" I actually want both orders even though the first isn't filled yet. Would liveuntilcancel achieve that? |
|
|
|
|
|
#6 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
|
If you want both orders use different signal names and also ensure you have EntriesPerDirection set higher. You can also just try submitting at double the quantity to modify the first. That will lower your commissions.
Josh
NinjaTrader Customer Service |
|
|
|
|
|
#7 |
|
Junior Member
Join Date: Jan 2009
Posts: 28
Thanks: 0
Thanked 0 times in 0 posts
|
I'm not sure how I would use different signal names. From the A, B C example above an order can be generated to sell B is B's bid changed or if A or C's offer changed. I wouldn't want to miss any of those events. I could split all the cases into different strategies but I need to keep track of the aggregate short position in the stocks and I don't know how to share variables safely across strategies. Any suggestions?
|
|
|
|
|
|
#8 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
|
Post an example of your code.
Signal names are definable every time you call Enter() or Exit().
Josh
NinjaTrader Customer Service |
|
|
|
|
|
#9 |
|
Junior Member
Join Date: Jan 2009
Posts: 28
Thanks: 0
Thanked 0 times in 0 posts
|
Gotcha, thanks that will solve the issue.
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Phantom execution | MelbourneRich | Miscellaneous Support | 1 | 08-13-2008 07:10 AM |
| Order execution | funky_boy | Strategy Development | 11 | 07-18-2008 01:19 AM |
| Two step execution | stefy | Strategy Development | 3 | 05-12-2008 03:19 PM |
| order execution | HelloHello | Automated Trading | 2 | 08-29-2007 12:17 AM |
| Execution on the same bar | MrBaffalo | Strategy Development | 3 | 01-23-2007 01:57 AM |