Backtesting: DateTime

Created at 11 Jun 2015, 23:20
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!
deklin's avatar

deklin

Joined 31.12.2014

Backtesting: DateTime
11 Jun 2015, 23:20


When backting a cBot, this seems to always return the current time and date:

DateTime.Now.ToString("HH:mm - MM/dd/yyyy") 

How can I get it to return the time and date of the backtested event?


@deklin
Replies

trend_meanreversion
12 Jun 2015, 07:26

RE:

deklin said:

When backting a cBot, this seems to always return the current time and date:

DateTime.Now.ToString("HH:mm - MM/dd/yyyy") 

How can I get it to return the time and date of the backtested event?

 

Hi mate, normally i use Server.Time to get the time during the historical events in backtesting. You can see one simpleBot i created which dumps High and Low Time of a bar historically which is using server.Time class ( /algos/cbots/show/864 ) . Hope it helps.

 


@trend_meanreversion