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 PeakTry, Today, 10:49 AM
|
0 responses
2 views
0 likes
|
Last Post
by PeakTry
Today, 10:49 AM
|
||
Started by llanqui, Today, 10:32 AM
|
0 responses
4 views
0 likes
|
Last Post
by llanqui
Today, 10:32 AM
|
||
Started by StockTrader88, 03-06-2021, 08:58 AM
|
45 responses
3,992 views
3 likes
|
Last Post Today, 09:51 AM | ||
Started by TAJTrades, Today, 09:46 AM
|
0 responses
8 views
0 likes
|
Last Post
by TAJTrades
Today, 09:46 AM
|
||
Started by rhyminkevin, Yesterday, 04:58 PM
|
5 responses
62 views
0 likes
|
Last Post
by dp8282
Today, 09:36 AM
|
Comment