Time help -- I'm confused

Created at 26 Aug 2013, 04:28
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!
BA

Balena

Joined 17.12.2012

Time help -- I'm confused
26 Aug 2013, 04:28


1. I have my gui set to UTC - 4

2. I want to trade Sunday open to 24 hrs later

3. I want to use US Eastern Time Zone

 

It seems my backtesting works correctly, but forward does not and my log show conflicting information it seems...

here's my code...

 

 

namespace cAlgo.Robots
{

    [Robot(TimeZone = TimeZones.EasternStandardTime)]
    public class v7 : Robot
    
    {
    

        private double startingEquity;

        private DateTime startTime;
        private DateTime activeTime;
        private DateTime stopTime;
        private DateTime resetTime;

  protected override void OnStart()
        {

            startTime = Server.Time.Date;
            activeTime = startTime.AddHours(21);
            stopTime = startTime.AddHours(44);
            resetTime = startTime.AddHours(45);
            
            Print("Server.Time = {0}", Server.Time);
            Print("startTime = {0}", startTime);
            Print("activeTime = {0}", activeTime);
            Print("stopTime = {0}", stopTime);            
            Print("resetTime = {0}", resetTime);

 

again... for backtesting it works as I think it should... starting at 17:00:00 local time (which displays in "Events" correctly)

but... 

my log printout shows this when backtesting:

            Server.Time = 8/22/2013 5:05:00  (this is correct)
           startTime =  8/22/2013 12:00:00     (this is not)
           activeTime =  8/22/2013 9:00:00     (this is not)
           stopTime =    8/23/2013 8:00:00   (this is not)
           resetTime =  8/23/2013 9:00:00    (this is not)

 

and when forward testing... 

it starts at 9:00:00..... vs 17:00:00 (5:00:00 Eastern) or 21:00:00 UTC as expected

 again... with my inputs above... backtesting works correct, but forward starts late

 

how can I fix this?


@Balena
Replies

Balena
26 Aug 2013, 06:32

RE:

ok... I think I fixed it

 

I changed to this...

 

  [Robot(TimeZone = TimeZones.UTC)]

 

Balena said:

1. I have my gui set to UTC - 4

2. I want to trade Sunday open to 24 hrs later

3. I want to use US Eastern Time Zone

 

It seems my backtesting works correctly, but forward does not and my log show conflicting information it seems...

here's my code...

 

 

namespace cAlgo.Robots
{

    [Robot(TimeZone = TimeZones.EasternStandardTime)]
    public class v7 : Robot
    
    {
    

        private double startingEquity;

        private DateTime startTime;
        private DateTime activeTime;
        private DateTime stopTime;
        private DateTime resetTime;

  protected override void OnStart()
        {

            startTime = Server.Time.Date;
            activeTime = startTime.AddHours(21);
            stopTime = startTime.AddHours(44);
            resetTime = startTime.AddHours(45);
            
            Print("Server.Time = {0}", Server.Time);
            Print("startTime = {0}", startTime);
            Print("activeTime = {0}", activeTime);
            Print("stopTime = {0}", stopTime);            
            Print("resetTime = {0}", resetTime);

 

again... for backtesting it works as I think it should... starting at 17:00:00 local time (which displays in "Events" correctly)

but... 

my log printout shows this when backtesting:

            Server.Time = 8/22/2013 5:05:00  (this is correct)
           startTime =  8/22/2013 12:00:00     (this is not)
           activeTime =  8/22/2013 9:00:00     (this is not)
           stopTime =    8/23/2013 8:00:00   (this is not)
           resetTime =  8/23/2013 9:00:00    (this is not)

 

and when forward testing... 

it starts at 9:00:00..... vs 17:00:00 (5:00:00 Eastern) or 21:00:00 UTC as expected

 again... with my inputs above... backtesting works correct, but forward starts late

 

how can I fix this?

 


@Balena

cAlgo_Development
26 Aug 2013, 15:59

In general output of your robot is correct, but it is in 12-hours format. In order to fix this we plan to format dates in robot's outputs the same way we format other dates in the platform.


@cAlgo_Development