![]() |
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 |
|
Member
Join Date: Mar 2008
Posts: 49
Thanks: 0
Thanked 0 times in 0 posts
|
Hi Guys, hopefully soon I'll start asking questions that are beyond novice level!
However, say I have CalculateOnBarClose set to false and I want to do something at certain intervals, how can I code this? For example if I wanted to check every 60 minutes i could write pseudocode if time=09:00||10:00||11:00 ... etc or variations of that theme do something But there must be a more efficient way to do this i.e. some way to say if last two digits of time are 00 ... or 25 or whatever do something Like a substring type function? Been a while since I last wrote any code properly and I'm new to c#. Thanks, Al |
|
|
|
|
|
#2 |
|
Senior Member
Join Date: Jul 2007
Location: Fairfax, VA
Posts: 216
Thanks: 0
Thanked 0 times in 0 posts
|
Just type Time[0]. into the editor, you will see the fields available in the time structure. You don't need to parse any strings, just evaluate those fields.
|
|
|
|
|
|
#3 |
|
Member
Join Date: Mar 2008
Posts: 49
Thanks: 0
Thanked 0 times in 0 posts
|
Perfect, cheers.
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Why is hour granularity unsupported? | henry.omd | Miscellaneous Support | 1 | 12-24-2007 09:53 AM |
| chart time is one hour behind | sean606 | Charting | 3 | 11-04-2007 07:07 PM |
| How to hold a position for half hour? | Jenny | Strategy Development | 13 | 10-23-2007 09:17 PM |
| 1st Hour High/Low | pijamatrader | Indicator Development | 42 | 07-16-2007 05:31 PM |
| OHLC for non-midnight 24 hour market | StinkiePhish | Indicator Development | 1 | 07-12-2007 11:07 PM |