Announcement
Collapse
Looking for a User App or Add-On built by the NinjaTrader community?
Visit NinjaTrader EcoSystem and our free User App Share!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less
Partner 728x90
Collapse
NinjaTrader
Placing Order ERROR
Collapse
X
-
Hello Luigio,
bltdavid is asking the right questions.
To start, is the myLongOrder OrderState OrderState.Accepted or OrderState.Working when you are calling CancelOrder()?
-
First, have you studied the constraints here?
Read section "Internal Order Handling Rules that Reduce Unwanted Positions" and pay special attention to the example showing how "EnterLongLimit" might be ignored.
Second, some questions for you,
1. NT7 or NT8?
2. Are you saving the order handles returned by EnterLongLimit?
3. Are you using unique signals for your calls to EnterLongLimit?
4. Are you setting order handles returned by EnterLongLimit to null inside OnOrderUpdate when that order is OrderState.Cancelled?
5. Are you setting order handles returned by EnterLongLimit to null inside OnExecution when that order is OrderState.Filled?
6. Are you waiting for the completion of all orders to be cancelled before sending your next EnterLongLimit?
Assuming NT7, you may not be doing #6, which is a common error.
To start debugging, try something like this,
Code:if (EntryOrder != null) Print("Not ready yet - EntryOrder has not been nullified by OnOrderUpdate or OnExecution"); else EntryOrder = EnterLongLimit(...);
PPS: Doesn't sound like your issue, but you should be very familiar with EnterLongLimit and "Live Until Cancelled Orders", and with this sample.Last edited by bltdavid; 03-16-2019, 02:50 AM.
Leave a comment:
-
Placing Order ERROR
Hello, I have a strategy which place EnterLongLimit orders. If the markets go higher this order is canceled by command:
Code:CancelOrder(myLongOrder);
Code:CancelAllOrders(true, true);
Code:EnterLongLimit
Please can anyone help?
Thanks.Last edited by Luigio; 03-15-2019, 05:43 PM.Tags: None
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by Haiasi, 04-25-2024, 06:53 PM
|
4 responses
62 views
0 likes
|
Last Post
by effraenk
Today, 02:15 AM
|
||
Started by ccbiasi, 11-23-2017, 06:06 AM
|
5 responses
2,200 views
0 likes
|
Last Post
by leodavis
Today, 02:11 AM
|
||
Started by kujista, Yesterday, 12:39 AM
|
2 responses
14 views
0 likes
|
Last Post
by kujista
Today, 02:02 AM
|
||
Started by Austiner87, Yesterday, 11:24 AM
|
2 responses
13 views
0 likes
|
Last Post Today, 01:42 AM | ||
Started by Rogers101, 05-05-2024, 11:30 AM
|
3 responses
22 views
0 likes
|
Last Post
by Rogers101
Today, 12:48 AM
|
Leave a comment: