Use of either == or >= results in error "Operator cannot be applied to operands of type"System.Date.Time" and "int"). Any ideas here? Regards to all
Announcement
Collapse
Looking for a User App or Add-On built by the NinjaTrader community?
Visit NinjaTrader EcoSystem and our free User App Share!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less
Partner 728x90
Collapse
NinjaTrader
ToTime Error
Collapse
X
-
Hello elliot5,
Thank you for your post.
This error is stating that System.Date.Time cannot be compared to an int value. You would need to compare the Time series to a Time value. You could view the code that accomplishes this by setting up a time comparison in the Strategy Builder and selecting the 'View code' button.
Please see the help guide documentation below demonstrating how to make time comparisons.
Time Comparison - https://ninjatrader.com/support/help...imeComparisons
Let us know if we may assist further.Brandon H.NinjaTrader Customer Service
-
Originally posted by elliot5 View Post&& ToTime(Time[0]) == 161200)
Use of either == or >= results in error "Operator cannot be applied to operands of type"System.Date.Time" and "int"). Any ideas here? Regards to all
The boolean '==' operator is being applied to "Time[0] == 161200", which is nonsensical.
The result of this '==' operation is then input to ToTime, which is also nonsensical.
But why that message?
Because the code has errors.
Because ToTime is missing its closing ')' parenthesis.Last edited by bltdavid; 05-19-2021, 02:22 PM.
- Likes 1
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by DJ888, Today, 10:57 PM
|
0 responses
6 views
0 likes
|
Last Post
by DJ888
Today, 10:57 PM
|
||
Started by MacDad, 02-25-2024, 11:48 PM
|
7 responses
158 views
0 likes
|
Last Post Today, 10:23 PM | ||
Started by Belfortbucks, Today, 09:29 PM
|
0 responses
7 views
0 likes
|
Last Post
by Belfortbucks
Today, 09:29 PM
|
||
Started by zstheorist, Today, 07:52 PM
|
0 responses
7 views
0 likes
|
Last Post
by zstheorist
Today, 07:52 PM
|
||
Started by pmachiraju, 11-01-2023, 04:46 AM
|
8 responses
151 views
0 likes
|
Last Post
by rehmans
Today, 06:44 PM
|
Comment