Time help -- I'm confused
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?
Replies
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
Balena
26 Aug 2013, 06:32
RE:
ok... I think I fixed it
I changed to this...
[Robot(TimeZone = TimeZones.UTC)]
Balena said:
@Balena