For example, will Time[0] give me the DateTime of the start of the current bar or the end?
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
Does the built-in Time DataSeries refer to beginning or end of bar?
Collapse
X
-
Does the built-in Time DataSeries refer to beginning or end of bar?
Does the DateTime from builtin Time DataSeries refer to beginning or end of bar?
For example, will Time[0] give me the DateTime of the start of the current bar or the end? -
Hello overflowing,
That will depend on the settings of CalculateOnBarClose (COBC) setting. If COBC is true then it will give you the Time[] at the end of the current bar. If COBC is false, then it will be the Time[] of the incoming tick data from the provider from within the current bar.
You can see more information about COBC on the following link.
http://www.ninjatrader.com/support/h...onbarclose.htm
Here is a forum post that you may want to read that goes over using [] brackets.
http://www.ninjatrader.com/support/f...ad.php?t=19346
Let us know if we can be of further assistance.JCNinjaTrader Customer Service
-
Originally posted by NinjaTrader_JC View PostHello overflowing,
That will depend on the settings of CalculateOnBarClose (COBC) setting. If COBC is true then it will give you the Time[] at the end of the current bar. If COBC is false, then it will be the Time[] of the incoming tick data from the provider from within the current bar.
You can see more information about COBC on the following link.
Here is a forum post that you may want to read that goes over using [] brackets.
Let us know if we can be of further assistance.
Comment
-
i think the simple answer to the original question "will Time[0] give me the DateTime of the start of the current bar or the end" is clearly: End
but i'm not sure i am clear about the COBC issue. if we're talking about a tick-based chart (eg. tick, range, renko, volume), then wouldn't COBC be irrelevant since Time[] always reflects the last incoming tick which is also the then-current last tick (end) of the bar?
makes perfect sense for time-based series to be able to calculate/predict the bar.
thanks in advance for clarifying :-)
cheers,
-e
Comment
-
Hello e-man,
COBC will still be relevant in tick based charts since on a tick based chart you do not know when the end of the bar is going to be so you get the time of each incoming tick of data if COBC is set to false. For example if you are using a 500 Tick chart then use COBC set to true; your indicator/strategy will only run OnBarUpdate() once the bar is closed so you will get all the values at the end of the bar. If COBC is set to false then OnBarUpdate() will run on each incoming tick of data and if you use Time[0] then it will give you the DateTime of that Tick of data.
http://www.ninjatrader.com/support/h....html?time.htm
Let us know if we can be of further assistance.JCNinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by bortz, 11-06-2023, 08:04 AM
|
47 responses
1,606 views
0 likes
|
Last Post
by aligator
Today, 07:22 PM
|
||
Started by jaybedreamin, Today, 05:56 PM
|
0 responses
8 views
0 likes
|
Last Post
by jaybedreamin
Today, 05:56 PM
|
||
Started by DJ888, 04-16-2024, 06:09 PM
|
6 responses
18 views
0 likes
|
Last Post
by DJ888
Today, 05:12 PM
|
||
Started by Jon17, Today, 04:33 PM
|
0 responses
4 views
0 likes
|
Last Post
by Jon17
Today, 04:33 PM
|
||
Started by Javierw.ok, Today, 04:12 PM
|
0 responses
13 views
0 likes
|
Last Post
by Javierw.ok
Today, 04:12 PM
|
Comment