Any help is appreciated.
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Variable Assignments
Collapse
X
-
Variable Assignments
When using the unmanaged approach, should I assign orders in OnBarUpdate or OnOrderUpdate? And when that order is filled, should I assign the executed order in OnExecutionUpdate? The help guide gives an example of assigning variables in OnBarUpdate, but then says to assign in OnOrderUpdate for more accurate assignments.
Any help is appreciated. -
Hello Lumbeezl,
In general, this would be up to your design but it is commonly suggested to use the OnOrderUpdate or OnExecutionUpdate for multiple reasons, often to assign variables as this would be more accurate toward the actual order events. These overrides are event-driven based on the events of the orders so you can use that information to further drive logic. This is more accurate in the sense that you are not waiting on a bar close or for data to come in to drive the script.
If you only need to know when the order is filled to assign the variable, you could just use OnExecution however if you needed to track the order earlier on OnOrderUpdate would be best. Using the order events would generally be suggested for situations where you may need to track partial fills or also do other actions based on the order events rather than waiting for bar closes, however, this is again dependant on your overall goal.
I look forward to being of further assistance.
JesseNinjaTrader Customer Service
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by algospoke, Yesterday, 06:40 PM
|
2 responses
24 views
0 likes
|
Last Post
by algospoke
Today, 07:04 PM
|
||
Started by ghoul, Today, 06:02 PM
|
3 responses
15 views
0 likes
|
Last Post Today, 06:43 PM | ||
Started by jeronymite, 04-12-2024, 04:26 PM
|
3 responses
46 views
0 likes
|
Last Post
by jeronymite
Yesterday, 10:10 PM
|
||
Started by Barry Milan, Yesterday, 10:35 PM
|
7 responses
23 views
0 likes
|
Last Post Today, 06:16 PM | ||
Started by AttiM, 02-14-2024, 05:20 PM
|
10 responses
181 views
0 likes
|
Last Post
by jeronymite
Today, 06:11 PM
|
Comment