Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
GetBar() performance
Collapse
X
-
Yes, I generally do this as well, but sometimes you don't know what you need until you know what you need.Originally posted by Ralph View PostI do not use this method. Instead of searching for a timestamp in the past I prefer to store the desired value/values when they are processed in OnBarUpdate().
Comment
-
Ok, I ran a quick test over 40000 bars, comparing GetBar(), a simple binary search, and a simple linear search. Granted, my methods are a little rough, but thankfully the results show that GetBar is not a linear search. The results also showed that a simple binary search would be upto 6X faster depending what you are looking for (always looked at indexes that were worst case for bin search). That being said, I think the Ninja version is adequate, but I will write my own version to maximize perf.
Comment
-
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by SalmaTrader, 07-07-2026, 10:26 PM
|
0 responses
35 views
0 likes
|
Last Post
by SalmaTrader
07-07-2026, 10:26 PM
|
||
|
Started by CarlTrading, 07-05-2026, 01:16 PM
|
0 responses
20 views
0 likes
|
Last Post
by CarlTrading
07-05-2026, 01:16 PM
|
||
|
Started by CaptainJack, 06-17-2026, 10:32 AM
|
0 responses
13 views
0 likes
|
Last Post
by CaptainJack
06-17-2026, 10:32 AM
|
||
|
Started by kinfxhk, 06-17-2026, 04:15 AM
|
0 responses
19 views
0 likes
|
Last Post
by kinfxhk
06-17-2026, 04:15 AM
|
||
|
Started by kinfxhk, 06-17-2026, 04:06 AM
|
0 responses
21 views
0 likes
|
Last Post
by kinfxhk
06-17-2026, 04:06 AM
|

Comment