Function of Robot.TimeZone attribute

Created at 10 Sep 2015, 22:43
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!
moneybiz's avatar

moneybiz

Joined 06.12.2011

Function of Robot.TimeZone attribute
10 Sep 2015, 22:43


What's the function of the TimeZone property of the Robot attribute?

Does anybody use it, for what?

[Robot(TimeZone = TimeZones.UTC)]

Does the time zone selection at the right side of the status bar have any effect on that setting above?


@moneybiz
Replies

moneybiz
11 Sep 2015, 01:23

RE:

When doing backtests I noticed that on 28 Jun 2015 the EUR/USD the market opened with a huge gap of ~165 pips which was draining my equity.

Then I decided to close all the open positions on Friday 30 mins before market closes. But how?

I noticed that the Robot class has Time property which gives you the price's date and time as the ticks are coming. But these values are controlled by the TimeZone setting which is specified as an attribute property.

At GMT+3 the market closes at 00:00, so when I set TimeZone = TimeZones.GTBStandardTime I was able to compare whether Robot.Time is greater than 23:30 to be able to close the open positions.

This is when the TimeZone comes to play. It gives you the price date and time according to the setting specified.


@moneybiz