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 timko, Today, 06:45 AM
|
0 responses
0 views
0 likes
|
Last Post
by timko
Today, 06:45 AM
|
||
Started by JonesJoker, 04-22-2024, 12:23 PM
|
7 responses
41 views
0 likes
|
Last Post Today, 06:43 AM | ||
Started by Waxavi, 04-19-2024, 02:10 AM
|
2 responses
37 views
0 likes
|
Last Post
by poeds
Today, 06:37 AM
|
||
Started by chbruno, Yesterday, 04:10 PM
|
1 response
44 views
0 likes
|
Last Post Today, 06:36 AM | ||
Started by Max238, Today, 01:28 AM
|
1 response
24 views
0 likes
|
Last Post
by CactusMan
Today, 06:18 AM
|
Comment