EnterLong(1, "EL1");
protected override void OnExecutionUpdate(Execution execution, string executionId, double price, int quantity, MarketPosition marketPosition, string orderId, DateTime time)
{
if (execution.Order.Name.StartsWith("EL1"))
{
if (execution.Order.OrderState == OrderState.Filled || execution.Order.OrderState == OrderState.PartFilled)
{
++Cnt;
Print(Cnt.ToString() + " EnterLong");
}
}
}
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Easy Event Question
Collapse
X
-
Easy Event Question
can a single EnterLong call create two OnExecutionUpdate events?
Code:Tags: None
-
Hello delTik,
Thank you for your post.
In the case of a quantity of it would only be expected to call OnExecutionUpdate() based on the event of that 1 quantity filling.
Are you seeing something to the contrary? If so, are you using 'Set Order Quantity' as ' Default Quantity' and a specific 'Default Quantity' in the Strategies menu when enabling your strategy?
-
If the condition returns true multiple times and your have EntriesPerDirection set up to allow for multiple entries, then multiple submissions of the EnterLong() will occur, one for each time the condition is true up to the EntriesPerDirection.Originally posted by delTik View Postok I'll go back and check but if I call EnterLong(1, "EL1") only once should I expect only one execution event?
Comment
-
ok thanks but confused ..
so if I call EnterLong(1, "EL1") once then the number of execution events raised will equal EntriesPerDirection, not one for each EnterLong call?
can I ask what the purpose of "EntriesPerDirection" is?
although I'd need to re-confirm this at the moment for a single EnterLong(1, "EL1") call with EntriesPerDirection = 3 I'm getting 2 execution events.Last edited by delTik; 07-11-2016, 03:13 AM.
Comment
-
Hello delTik,
Thank you for your response.
EntriesPerDirection sets the number of entries per side based on the EntryHandling.
If you set EntryHandling to AllEntries and use 3 for your EntriesPerDirection, then each time your condition returns true to place an order up to three times, it will place that order. If it only sees the condition twice it will only submit it twice.
EntriesPerDirection does not duplicate your order on the same bar, but if the condition to place the order returns true on another bar afterwards then it will submit another entry.
Comment
-
That is only true of COBC = false, in which case the point is moot anyway, as the trade conditions evaluation takes place only once per bar, there being only one tick per bar. If COBC = false, one can get whipsawed multiple times on the same bar. In fact, the very first piece of code that I posted in the File Sharing section of the forum, was to deal with that exact scenario.Originally posted by NinjaTrader_PatrickH View Post...
EntriesPerDirection does not duplicate your order on the same bar, but if the condition to place the order returns true on another bar afterwards then it will submit another entry.
By the same token, if there are no valid exit conditions on the bar, one can get filled multiple times on the bar.
Comment
-
sorry but confused (again) ... my code only allows a single EnterLong(1, "EL1") call regardless of COBC = True or False, whipsawing or anything else.
unless I've totally misunderstood, should I not expect a single execution confirmation event for a single call of EnterLong?Last edited by delTik; 07-15-2016, 10:20 AM.
Comment
-
Let's start from the beginning and we can give you a walk through. What is the condition for entry?Originally posted by delTik View Postsorry but confused (again) ... my code only allows a single EnterLong(1, "EL1") call regardless of COBC = True or False, whipsawing or anything else.
unless I've totally misunderstood, should I not expect a single execution confirmation event for a single call of EnterLong?
Comment
-
Yes, one confirmation per one call, but there can be more than one entry call on a bar, if COBC is false, and the conditions for entry occur more than once in the bar. If COBC is true, there is only one tick per bar, and so also only one entry.should I not expect a single execution confirmation event for a single call of EnterLong?
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
571 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
330 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
101 views
0 likes
|
Last Post
by Mindset
02-09-2026, 11:44 AM
|
||
|
Started by Geovanny Suaza, 02-02-2026, 12:30 PM
|
0 responses
548 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
549 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment