I have code as follows
private void TakeTrade()
{
TimeSpan timeToTakeTrade = new TimeSpan(11, 5, 0);
DateTime Min5Time = Times[1][0];
if (BarsInProgress == 1) // 5 minute bars
{
if (Min5Time.TimeOfDay.CompareTo(timeToTakeTrade) == 0)
ProcessTrade();
}
else if (BarsInProgress == 0) // daily bars
{
// do nothing
}
}
What do I need to do to set the timeToTakeTrade value correctly? Do I get the timezone from the user's computer or is there a better way?
Thanks

Comment