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
OnExecutionUpdate() Timing Clarification
Collapse
X
-
OnExecutionUpdate() Timing Clarification
I have thought that OnExecutionUpdate() is called immediately after each broker confirmation of order execution. However, while testing an unmanaged strategy that I have developed using the Playback Historical capability and with the Primary Data Series being 15-second bars and the Secondary 1-tick data OnExecutionUpdate() is called only at 15-second intervals. Is that due to a Playback Historical testing limitation or have I misunderstood when OnExecutionUpdate() is called? There obviously is no way to know how long order confirmations would have taken, but I had assumed that the test system would either immediately confirm following the crossing of a limit price level, for example, or would confirm after a short random delay period to approximate reality.Last edited by caveat_lector; 04-03-2020, 03:29 PM.Tags: None
-
I just noticed the OnExecutionUpdate() Help states:
"Playback connection triggers executions immediately, for the sake of consistency in backtesting. Because of this, OnExecutionUpdate() can appear to be triggered earlier than it would in live trading, or when simulation trading on a live connection."
That isn't what I am seeing. OnExecutionUpdate() is always called 15-seconds after the close of a bar that crosses an order limit price, so order execution confirmations are always 15 to 30 seconds later than would have occurred real-time, depending on exactly when during a 15-second bar a price limit was crossed.
-
Thanks very much for the time you spent on that. I will compare your script and video to what I am doing and seeing.
Comment
-
Sorry, my mistake. I was using:
Code:Print(execution.Name + " " + Time[0] + "." + Time[0].Millisecond + " Time Series");
Code:Print(execution.Name + " " + Times[1][0] + "." + Times[1][0].Millisecond + " Time Series");
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by f.saeidi, Today, 12:14 PM
|
8 responses
17 views
0 likes
|
Last Post
by f.saeidi
Today, 01:55 PM
|
||
Started by Mikey_, 03-23-2024, 05:59 PM
|
3 responses
49 views
0 likes
|
Last Post
by Sam2515
Today, 01:47 PM
|
||
Started by Russ Moreland, Today, 12:54 PM
|
1 response
7 views
0 likes
|
Last Post Today, 01:01 PM | ||
Started by philmg, Today, 12:55 PM
|
1 response
7 views
0 likes
|
Last Post Today, 01:00 PM | ||
Started by TradeForge, 04-19-2024, 02:09 AM
|
2 responses
32 views
0 likes
|
Last Post
by TradeForge
Today, 12:32 PM
|
Comment