![]() |
This website will be down for maintenance from Friday May 24th at 6PM MDT until Saturday May 25th at 11AM 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 |
|
Junior Member
Join Date: Feb 2011
Posts: 12
Thanks: 0
Thanked 1 time in 1 post
|
Can you advise how to get a time value updated each second?
ToTime(Time[0]) function gives only a value of bar's opening. |
|
|
|
|
|
#2 |
|
NinjaTrader Customer Service
Join Date: Dec 2011
Location: India
Posts: 3,286
Thanks: 580
Thanked 546 times in 541 posts
|
Hello alexeymarvel,
You can use the DateTime.Now function to get the current timestamp of your PC. http://msdn.microsoft.com/en-us/libr...etime.now.aspx Please note it will work in realtime only and not for historical bars or in backtesting. Please let me know if I can assist you any further.
Joydeep M.
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
Junior Member
Join Date: Feb 2011
Posts: 12
Thanks: 0
Thanked 1 time in 1 post
|
Yes I Know how to get it in real time. But how to get it in market replay mode?
|
|
|
|
|
|
#4 |
|
NinjaTrader Customer Service
Join Date: Dec 2011
Location: India
Posts: 3,286
Thanks: 580
Thanked 546 times in 541 posts
|
Hello alexeymarvel,
You can try the below unsupported code Code:
this.Bars.MarketData.Connection.Now
Joydeep M.
NinjaTrader Customer Service |
|
|
|
|
|
#5 |
|
Junior Member
Join Date: Feb 2011
Posts: 12
Thanks: 0
Thanked 1 time in 1 post
|
It gives the same value as Time[0] as at bar's open. But I need the timer the same as in the replay window.
|
|
|
|
|
|
#6 |
|
Senior Member
|
|
|
|
|
|
The following user says thank you to koganam for this post: |
|
|
|
#7 |
|
NinjaTrader Customer Service
Join Date: Dec 2011
Location: India
Posts: 3,286
Thanks: 580
Thanked 546 times in 541 posts
|
Hello alexeymarvel,
In addition to koganam's query, can you say what CalculateOnBarClose you are using? I look forward to assisting you further.
Joydeep M.
NinjaTrader Customer Service |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Math.max method? Long time reader, first time poster ;) | backspace123 | General Programming | 3 | 02-08-2012 12:01 PM |
| how to use weekly, monthly, yearly time frames in real time charting using 6.5 versi | qwert12 | Charting | 2 | 10-05-2010 04:35 PM |
| Highest High/Lowest Low from xxxx time to yyyy time... | Unhommefou | Indicator Development | 3 | 03-22-2010 02:00 PM |
| Multi-time frame strategy - Longer-term real-time calculations | Shansen | Strategy Development | 1 | 04-19-2009 06:36 AM |
| Dynamic base pointer or time reference for secondary time interval | ct | Strategy Development | 11 | 06-20-2007 02:27 PM |