StartTime
EndTime
I would like to implement a condition of running a strategy within the times inputted. Including over a 24 hour period.
ie: RTH
StartTime = 9:00 AM
EndTime = 4:00 PM
ie: ETH
StartTime = 6:00 PM
EndTime = 6:00 PM Next Day (a full 24 hours.)
Now I would like to do this with only one set. I know if I broke this down to 2 sets, I could simply do If ALL conditions are met (within the RTH timeframe) then execute strategy.
Also I have found the OverNightTrading.zip file to be helpful in adding a If ANY example to handle the trade over a 24 hour period, yet it just not allow for User Input .
if ((Times[0][0].TimeOfDay > new TimeSpan(17, 0, 0))
&& (Times[0][0].TimeOfDay < new TimeSpan(18, 0, 0))
Whereas the TimeSpan is hardcoded. 17,18.
How can I use that same logic but make the TimeSpan use "time" or more clearly the StartTime as a String.
I know I could use it as an "int" as if start time is 5 (5:00 am) or 20 (8:00 PM) but I want to use the variables as time.
User Input
Start Time as "Time" not as an integer.
Again All coded as if one logical step. If this and/or that .
Thanks.

Comment