Setting Time Zone in Robot

Created at 22 Oct 2013, 02:32
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!
jhtrader's avatar

jhtrader

Joined 15.10.2013 Blocked

Setting Time Zone in Robot
22 Oct 2013, 02:32


Hi,

I am trying to set the timezone in my robot so that the chart that displays in back testing which I set to UTC-5 is synchronised with the print messages in the robot

This is just not happening.. I have been through all the GMT zones in Robot(TimeZone = TimeZones.(...)

and none of them will match my timezone.. furher when and if the time prints the chart displays a different bar then what it did previously.  Its really strange.. that in one moment a bar on the chart appears at say 5pm and then when I compile the robot to a diferent zone in certain times it changes what time is displayed on the chart

The chart should constantly show the bars at the UTC -5 so I am not sure why it does not.

 

   [Robot(TimeZone = TimeZones.AlaskanStandardTime)]

 protected override void OnBar()
        {

 var lastIndex = MarketSeries.Close.Count - 1;

 double close = MarketSeries.Close[lastIndex - 1];

 DateTime CurrTime = MarketSeries.OpenTime[lastIndex - 1];

 Print("TIME = {0} BUYPRICE (ASK) = {1}  SELL PRICE (BID) = {2} CLOSE PRICE = {3}", CurrTime, Symbol.Bid, Symbol.Ask,close);

}

 

If I change to       [Robot(TimeZone = TimeZones.EasternStandardTime)]

 

NOTE: the print statment changes as expected but I dont understand why the chart displays the bar at a different location.. I did not change the UTC value

Please let me know how I can modify the timezone so that the print statements and the chart display line up to the UTC-5 time zone.

 

 

 

 

 

 


Replies

Spotware
22 Oct 2013, 16:46

This has been fixed and will be available in the next release. You can currently confirm this by testing your code using Spotware cAlgo.
Try CentralStandardTime for UTC - 5. 
 


@Spotware

jhtrader
22 Oct 2013, 17:16

RE:

Spotware said:

This has been fixed and will be available in the next release. You can currently confirm this by testing your code using Spotware cAlgo.
Try CentralStandardTime for UTC - 5. 
 

Unfortunately this does not work.. please let me know when the issue is fixed.. when is the next release due?


Spotware
22 Oct 2013, 17:42 ( Updated at: 21 Dec 2023, 09:20 )

You can verify that it is fixed using the Spotware build. Download it here.



 


@Spotware