Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Time to bar conversion
Collapse
X
-
Time to bar conversion
How do I get the bars number of the 1 tick series for some arbitrary amount of time (say, 30 seconds) before the current bar ?Tags: None
-
Hi Spotty, thanks for posting. You will need C# logic that will loop back through the historical bars and stop at a certain point. I would use a While loop to do this and use the DateTime.Compare() method to compare the tick's timestamp to a hard coded timestamp.
The DateTime.Compare() method in C# is used for comparison of two DateTime instances. It returns an integer value,0 − If date1 is later than date2SyntaxFollowing is the syntax −publ
Kind regards.
-
Hmm. Well, what I'm trying to do is get the lowest tick price over that time interval, and am thinking "LowestBar()" will part of this solution. So, isn't there a way within NT to convert a time to a bar? I'm pretty sure I've done this before. I've scoured the HelpGuide, but can't find it now. I must be looking in the wrong place. Any ideas?
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by CarlTrading, 03-31-2026, 09:41 PM
|
1 response
45 views
0 likes
|
Last Post
|
||
|
Started by CarlTrading, 04-01-2026, 02:41 AM
|
0 responses
21 views
0 likes
|
Last Post
by CarlTrading
04-01-2026, 02:41 AM
|
||
|
Started by CaptainJack, 03-31-2026, 11:44 PM
|
0 responses
31 views
1 like
|
Last Post
by CaptainJack
03-31-2026, 11:44 PM
|
||
|
Started by CarlTrading, 03-30-2026, 11:51 AM
|
0 responses
50 views
0 likes
|
Last Post
by CarlTrading
03-30-2026, 11:51 AM
|
||
|
Started by CarlTrading, 03-30-2026, 11:48 AM
|
0 responses
42 views
0 likes
|
Last Post
by CarlTrading
03-30-2026, 11:48 AM
|

Comment