![]() |
|
|||||||
| Miscellaneous Support Miscellaneous support issues. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Senior Member
Join Date: Nov 2009
Posts: 205
Thanks: 0
Thanked 0 times in 0 posts
|
I have the following code:
if (DateTime.Now.TimeOfDay < ToTime(10, 00, 00)) { Print("Less than"); } and Im getting the following error "Operator '<' cannot be applied to operands of type 'System.TimeSpan' and 'int'" I thought ToTime would be of type TimeSpane too? Whats the correct syntax? Thanks |
|
|
|
|
|
#2 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,377
Thanks: 252
Thanked 966 times in 949 posts
|
mefTrader, no ToTime() returns an Int value -
http://www.ninjatrader-support.com/H...V6/ToTime.html Do you need the TimeOfDay timespan specifically? This below should compile - Code:
if (ToTime(DateTime.Now) < ToTime(10, 00, 00))
{
Print("Less than");
}
Bertrand
NinjaTrader Customer Service |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How do I get the value of a bar at a specific time | TraderFoo | Strategy Development | 5 | 06-23-2009 12:42 PM |
| Computer clock setting | markw | Charting | 1 | 01-03-2009 10:22 AM |
| price at specific time | Kowal | General Programming | 2 | 10-06-2008 08:43 AM |
| Ninja using local CPU clock time? | RK_trader | Miscellaneous Support | 5 | 08-17-2007 02:36 AM |
| new candle bar at different time than clock? | coffee898 | Charting | 4 | 03-28-2007 06:48 AM |