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 Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
626 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
359 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
105 views
0 likes
|
Last Post
by Mindset
02-09-2026, 11:44 AM
|
||
|
Started by Geovanny Suaza, 02-02-2026, 12:30 PM
|
0 responses
562 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
567 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment