Confused about Trading Hours

Created at 04 Aug 2020, 14:41
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
AC

ac15x

Joined 22.07.2020

Confused about Trading Hours
04 Aug 2020, 14:41


  private bool IsTradingHours()
        {
            if (Server.Time.DayOfWeek == DayOfWeek.Friday && Server.TimeInUtc.TimeOfDay > new TimeSpan(20, 0, 0))
            {
                return false;
            }
            return true;
        }

Hi, 

I don't want my robot to trade near closing hours every friday both in live and backtesting. Is the code above the best way to deal with it where after 8PM Friday, no trade will be executed?

I find that when I'm back testing time is UTC +3. I trade with IC Markets.

 

Thanks,


@ac15x