![]() |
This website will be down for maintenance from Friday May 24th at 6PM MDT until Sunday May 26th at 12PM MDT. We apologize for the inconvenience. If you need assistance during this time, please email sales@ninjatrader.com
|
|||||||
| General Programming General NinjaScript programming questions. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Member
Join Date: Nov 2008
Posts: 95
Thanks: 0
Thanked 0 times in 0 posts
|
solved. thanks.
Last edited by leontancfa; 08-14-2009 at 10:43 AM.
Reason: solved
|
|
|
|
|
|
#2 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 107 times in 70 posts
|
Not sure what you mean. Time[0] gives you the timestamp of the bar which is the closing timestamp of that bar when using time intervals.
Josh
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
NinjaTrader Customer Service
Join Date: Jun 2009
Location: Denver, CO
Posts: 3,149
Thanks: 10
Thanked 89 times in 81 posts
|
To build on what Josh said, a solution to find a bar's closing time would be to use Time[0] and add the time from BarsPeriod.Value if BarsPeriod.Id == PeriodType.Minute/some other time based period.
Code:
// all the following code is untested, but should show the general idea. DateTime timeOfInterest = Time[0] // set timeOfInterest to the time of the current bar + the period of the chart timeOfInterest = Time[0].AddMinutes(BarsPeriod.Value);
Austin
NinjaTrader Customer Service
Last edited by NinjaTrader_Austin; 08-14-2009 at 10:45 AM.
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Can cross hair mode show the time beyond the current time? | leontancfa | Charting | 3 | 07-01-2009 08:42 AM |
| Replay's Current Time, Time[0] isn't what I'm expecting | Brian1 | Strategy Analyzer | 4 | 02-19-2009 02:09 PM |
| Exit positions on current bar close | forextim | Strategy Development | 1 | 11-12-2008 08:39 AM |
| Added Property to Strategy but Not Showing on Property Grid | stocastix | Automated Trading | 2 | 11-07-2008 04:00 PM |
| how to sendmail() with current symbol and close price | tbtrades | Miscellaneous Support | 3 | 10-17-2008 12:28 PM |