Robot TimeZone does nothing????

Created at 25 Aug 2013, 08:58
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!
lec0456's avatar

lec0456

Joined 14.11.2012

Robot TimeZone does nothing????
25 Aug 2013, 08:58


I don't understand what setting the robot time zone does.

 

I set the time zone to Eastern Europe or UTC I get the same times returned

with 

 MarketSeries.OpenTime

or 

Server.Time

 

Whats going on?????


@lec0456
Replies

cAlgo_Development
26 Aug 2013, 16:49

Can you provide robot code and its output to illustrate this?


@cAlgo_Development

lec0456
02 Sep 2013, 07:42

Can you explain technically what setting the TimeZone is doing within the robot?


@lec0456

cAlgo_Development
02 Sep 2013, 12:44

All dates and times presented in a robot (market series, orders entry dates, server time) are presented in specified timezone, for example:

 

    [Robot(TimeZone = TimeZones.EEuropeStandardTime)]
    public class TimeZonesRobot : Robot
    {
        protected override void OnStart()
        {
            Print("Current bar open: {0}", MarketSeries.OpenTime.LastValue);
        }
    }

Prints "Current bar open: 02/09/2013 12:00:00"

At the same time

    [Robot(TimeZone = TimeZones.UTC)]
    public class TimeZonesRobot : Robot
    {
        protected override void OnStart()
        {
            Print("Current bar open: {0}", MarketSeries.OpenTime.LastValue);
        }
    }

Prints "Current bar open: 02/09/2013 09:00:00"


@cAlgo_Development