Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Millisecond precision
Collapse
X
-
Hello U0000999,
Thanks for your post.
Your strategy code, when set to Calculate.OnEachTick, would run as each tick is received. If you look at the Historical data you can see the time stamps of ticks in the format of Hours:Minutes:seconds:milliseconds. I've attached a screenshot of the ES 09-19 for July 5th. As you can see in the example several ticks have the same timestamp (means that they had a less than 1 millisecond difference)and each tick would cause your code to run (if set to Calculate.OnEachTick). You can also see that at 9:32:59:335, the next tick did not occur until 9:32:59:943 which would be 608 milliseconds later.
So your code would execute as fast as your PC will calculate it, however when considering a "system", while the code executes extremely fast (based on your PC) actual live trades depend on the asynchronous process of order transmission, exchange/broker receiving, order filling and transmitting back the order status and data. Depending on your internet connection, this could be many milliseconds to hundred of milliseconds, So unless you are using a Virtual Private Server at an actual exchange, the filling of orders would not happen as quickly as your PC processes each tick.
Paul H.NinjaTrader Customer Service
-
Hello U0000999,
Thanks for your replies.
I would not be able to advise regarding what would be the best scenario for you regarding VPS (Virtual Private Server) and recommend that you research the topic on your own through various VPS vendors
It terms of the platform, as discussed the OnBarUpdate() method is an event driven (run on incoming tick) method. If you wanted to do something with a timer after x milliseconds, you could take a look at the example code in SampleCustomEvents here: https://ninjatrader.com/support/help...to_output_.htmPaul H.NinjaTrader Customer Service
Comment
-
May be to make better solution: understand what's the real delay in real trading, and programm trade system according to this delay? If I know that I have stable delay 50ms, I may create code, which activates system with 50ms before ending close of a candle? It's just an idea....
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by jaybedreamin, Today, 05:56 PM
|
0 responses
3 views
0 likes
|
Last Post
by jaybedreamin
Today, 05:56 PM
|
||
Started by DJ888, 04-16-2024, 06:09 PM
|
6 responses
18 views
0 likes
|
Last Post
by DJ888
Today, 05:12 PM
|
||
Started by Jon17, Today, 04:33 PM
|
0 responses
1 view
0 likes
|
Last Post
by Jon17
Today, 04:33 PM
|
||
Started by Javierw.ok, Today, 04:12 PM
|
0 responses
6 views
0 likes
|
Last Post
by Javierw.ok
Today, 04:12 PM
|
||
Started by timmbbo, Today, 08:59 AM
|
2 responses
10 views
0 likes
|
Last Post
by bltdavid
Today, 04:10 PM
|
Comment