How to get the time value of a bar during back testing

Created at 08 May 2023, 14:59
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!
PR

prasanthtp

Joined 14.09.2022

How to get the time value of a bar during back testing
08 May 2023, 14:59


I am back testing a strategy in cAlgo. How do I get the time value of the current tick/bar that is in the past.

I am using Server.Time.ToLocalTime(); this is not working always . Something there is a 1 hour difference because of the timezone difference. 


@prasanthtp
Replies

prasanthtp
11 May 2023, 01:16

Thanks. How do I get the time value of the current bar from this list. 

Bars.OpenTimes  is a list of datetime values . Is it Bars.OoenTimes[0]?

 

 

 

PanagiotisChar said:

Hi there,

You can use Bars.OpenTimes for this.

Aieden Technologies

Need help? Join us on Telegram

Need premium support? Trade with us

 

 


@prasanthtp