Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Current time of the bar
Collapse
X
-
Hello cay7man,
Bars in NinjaTrader are marked by the close time of the bar.
If the time is 9:23, the 30 minute bar would close at 9:30.
If you want to show the time of each tick, you would need to a 1 tick series or a 1 second series with AddDataSeries().
https://ninjatrader.com/support/help...dataseries.htm
If you want to show the computer time you can print Core.Globals.Now.Chelsea B.NinjaTrader Customer Service
- Likes 1
-
Hello cay7man,
The BarsPeriod would be BarsPeriodType.Second and the value would be 1.
AddDataSeries(null, BarsPeriodtype.Second, 1);
In OnBarUpdate() this becomes BarsInProgress index 1, Times[1][0], Closes[1][0], etc.
if (BarsInProgress == 1)
{
Print(string.Format("{0} | BarsInProgress: {1}, CurrentBars[1]: {2}", Times[1][0], BarsInProgress, CurrentBars[1]));
}
Chelsea B.NinjaTrader Customer Service
- Likes 1
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by CarlTrading, 03-31-2026, 09:41 PM
|
1 response
78 views
1 like
|
Last Post
|
||
|
Started by CarlTrading, 04-01-2026, 02:41 AM
|
0 responses
40 views
0 likes
|
Last Post
by CarlTrading
04-01-2026, 02:41 AM
|
||
|
Started by CaptainJack, 03-31-2026, 11:44 PM
|
0 responses
63 views
2 likes
|
Last Post
by CaptainJack
03-31-2026, 11:44 PM
|
||
|
Started by CarlTrading, 03-30-2026, 11:51 AM
|
0 responses
63 views
0 likes
|
Last Post
by CarlTrading
03-30-2026, 11:51 AM
|
||
|
Started by CarlTrading, 03-30-2026, 11:48 AM
|
0 responses
54 views
0 likes
|
Last Post
by CarlTrading
03-30-2026, 11:48 AM
|

Comment