Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Critical: logic of submission StopLoss orders
Collapse
X
-
Hi koganam,
:-) In a way yes, you are correct.
I was just meaning that both the handle associated with the order and the order variable that is supplied to the OnBarUpdate method will both be IOrders.
Specifically, I believe this is saying to use the OnBarUpdate supplied IOrder (order variable) and not the IOrder the entry is set to (myEntry).
They will both be IOrders though.
-
Not sure of the difference: I think that is what I said. No?Originally posted by NinjaTrader_ChelseaB View PostHey koganam,
I agree with the first part, where the preferred place to place to execute code after a fill is in the OnExecution.
However, for the second part, I think this is insisting that the OnOrder update order IOrder object is used instead of the handle associated IOrder object.
"... then make sure that you use IOrders."
Leave a comment:
-
Hey koganam,
I agree with the first part, where the preferred place to place to execute code after a fill is in the OnExecution.
However, for the second part, I think this is insisting that the OnOrder update order IOrder object is used instead of the handle associated IOrder object.
ALWAYS reference the properties on the IOrder object passed into the OnOrderUpdate() method.
Leave a comment:
-
I read that to mean that the preferred and recommended place is in OnExecution(), but if, for any reason, you think that you MUST use OnOrderUpdate(), then make sure that you use IOrders.Originally posted by pstrusi View PostNinjas, I got a confusion here trying to know which situation is the correct.
Reading the part regarding when to submit StopLoss orders ,using either OnOrderUpdate() or OnExecution() , like is shown on the help guide:
I'm kind of confused with this:
and this:
Which method is the right for submit Stop orders?
Leave a comment:
-
Hello pstrusi,
Thanks for your note.
The first message is letting you know that OnExecution will always be triggered after OnOrderUpdate. It is also advising that if you are waiting for an order to be filled, to use OnExecution instead of OnOrderUpdate to execute code at that time.
The second message is saying that if you are using OnOrderUpdate(IOrder order) always use the order IOrder object.
For example if you have an entry order associated to an IOrder handle.
private IOrder myEntry = null;
myEntry = EnterLong();
In on order update, check that the order object is equal to the myEntry object. But use the order object to check the state of the order.
protected override void OnOrderUpdate(IOrder order)
{
// check if myEntry equals order
if (myEntry != null && myEntry == order)
{
// check the order state of the order object
if (order.OrderState == OrderState.Cancelled)
{
// execute code
}
}
}
Leave a comment:
-
Critical: logic of submission StopLoss orders
Ninjas, I got a confusion here trying to know which situation is the correct.
Reading the part regarding when to submit StopLoss orders ,using either OnOrderUpdate() or OnExecution() , like is shown on the help guide:
I'm kind of confused with this:
and this:CRITICAL: If you want to drive your strategy logic based on order fills you must use OnExecution() instead of OnOrderUpdate(). OnExecution() is always triggered after OnOrderUpdate(). There is internal strategy logic that is triggered after OnOrderUpdate() is called but before OnExecution() that can adversely affect your strategy if you are relying on tracking fills within OnOrderUpdate().
Which method is the right for submit Stop orders?If you are relying on the OnOrderUpdate() method to trigger actions such as the submission of a stop loss order when your entry order is filled ALWAYS reference the properties on the IOrder object passed into the OnOrderUpdate() method.Tags: None
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by cmoran13, 04-16-2026, 01:02 PM
|
0 responses
36 views
0 likes
|
Last Post
by cmoran13
04-16-2026, 01:02 PM
|
||
|
Started by PaulMohn, 04-10-2026, 11:11 AM
|
0 responses
23 views
0 likes
|
Last Post
by PaulMohn
04-10-2026, 11:11 AM
|
||
|
Started by CarlTrading, 03-31-2026, 09:41 PM
|
1 response
162 views
1 like
|
Last Post
|
||
|
Started by CarlTrading, 04-01-2026, 02:41 AM
|
0 responses
96 views
1 like
|
Last Post
by CarlTrading
04-01-2026, 02:41 AM
|
||
|
Started by CaptainJack, 03-31-2026, 11:44 PM
|
0 responses
152 views
2 likes
|
Last Post
by CaptainJack
03-31-2026, 11:44 PM
|

Leave a comment: