Announcement
Collapse
Looking for a User App or Add-On built by the NinjaTrader community?
Visit NinjaTrader EcoSystem and our free User App Share!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less
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 strategist007, Today, 07:51 PM
|
0 responses
2 views
0 likes
|
Last Post Today, 07:51 PM | ||
Started by StockTrader88, 03-06-2021, 08:58 AM
|
44 responses
3,967 views
3 likes
|
Last Post
by jhudas88
Today, 06:59 PM
|
||
Started by rbeckmann05, Today, 06:48 PM
|
0 responses
4 views
0 likes
|
Last Post
by rbeckmann05
Today, 06:48 PM
|
||
Started by rhyminkevin, Today, 04:58 PM
|
4 responses
55 views
0 likes
|
Last Post
by dp8282
Today, 06:13 PM
|
||
Started by iceman2018, Today, 05:07 PM
|
0 responses
6 views
0 likes
|
Last Post
by iceman2018
Today, 05:07 PM
|
Comment