![]() |
|
|||||||
| Indicator Development Support for the development of custom indicators using NinjaScript. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Member
Join Date: Aug 2008
Posts: 66
Thanks: 1
Thanked 8 times in 5 posts
|
Is there a way to get the open and close time of a tick-chart bar?
I would like to make a small indicator that shows how much time was needed for eg. a 200 tick bar to get created. |
|
|
|
|
|
#2 |
|
NinjaTrader Customer Service
Join Date: Dec 2011
Location: India
Posts: 3,286
Thanks: 580
Thanked 546 times in 541 posts
|
Hello Zapzap,
Thanks for writing in and I am happy to assist you. Unlike minute based bars where the end time can be predetermined, the end time of the tick bars cannot be predetermined. As such you cannot make an indicator which determines the end time of a tick bar. I look forward to assist you further.
Joydeep M.
NinjaTrader Customer Service |
|
|
|
|
|
#3 | |
|
Senior Member
|
Quote:
Code:
TimeSpan timeElapsed = Time[2] - Time[1]; Code:
timeElapsed.TotalSeconds That having been said, you sound like you are reinventing the wheel: NT ships with an indicator called BarTimer that does what you want. ![]()
Last edited by koganam; 02-22-2012 at 12:22 PM.
|
|
|
|
|
|
The following 3 users say thank you to koganam for this post: |
|
|
|
#4 |
|
Member
Join Date: Aug 2008
Posts: 66
Thanks: 1
Thanked 8 times in 5 posts
|
Joydeep: I don't want to predetermine anything. I'd like to know "how much time was needed for a bar"
koganam: Thanks a lot I knew it was easy, I haven't programmed NT for 3 years though. ![]() BTW: BarTimer is an indicator for minute based charts showing how much time is left. So I needed the new wheels.
Last edited by Zapzap; 02-22-2012 at 12:42 PM.
|
|
|
|
|
|
#5 |
|
Senior Member
|
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Calculate On Bar Close/Open-Low-High-Close relationship | jkmott59 | Indicator Development | 6 | 04-10-2012 10:47 AM |
| Current Bar Open Equals Previous Bar Close | ramacan | Charting | 6 | 05-23-2009 11:07 AM |
| Backtest vs real-time Chart orders placed at Open of next bar vs Close of curr bar? | tomace | Strategy Analyzer | 3 | 03-18-2009 07:06 AM |
| Open and Close from same Bar | RJay | Strategy Development | 3 | 03-04-2009 04:25 PM |
| Does NT simulator place orders at the Close of current bar, or Open of next bar? | tomace | Strategy Development | 1 | 03-02-2009 12:43 PM |