How to get DateTime offset specified in cTrader desktop chart?

Created at 24 Feb 2020, 05: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!
FI

firemyst

Joined 26.03.2019

How to get DateTime offset specified in cTrader desktop chart?
24 Feb 2020, 05:32


HI all:

While I can obtain the Server time offset, and the local computer's datetime offset, is it possible to obtain the datetime offset the user has specified looking at their charts? If so, how?

For example, my local computer's time might be UTC - 5, but the chart displayed in cTrader desktop is set for UTC + 8.

Thank you.


@firemyst
Replies

PanagiotisCharalampous
24 Feb 2020, 09:23

Hi firemyst,

Here it is.

Best Regards,

Panagiotis 

Join us on Telegram

 


@PanagiotisCharalampous

firemyst
24 Feb 2020, 10:12

RE:

PanagiotisCharalampous said:

Hi firemyst,

Here it is.

Best Regards,

Panagiotis 

Join us on Telegram

 

Thanks @Panagiotis!

For anyone looking for a code sample, this will return the time as specified on the chart regardless of local user's computer's timezone:

DateTime.UtcNow + Application.UserTimeOffset

 


@firemyst

trading.ternet
10 Sep 2020, 12:08

RE: RE:

firemyst said:

PanagiotisCharalampous said:

Hi firemyst,

Here it is.

Best Regards,

Panagiotis 

Join us on Telegram

 

Thanks @Panagiotis!

For anyone looking for a code sample, this will return the time as specified on the chart regardless of local user's computer's timezone:

DateTime.UtcNow + Application.UserTimeOffset

Hi,
I am a newbie in cAlgo,
many thanks for informations.
But I don't understand how I can get hour value from UserTimeOffset (to use in a Bot Time filter for example)

Many thanks for help
Michel

 

 

 



 

 


@trading.ternet

trading.ternet
10 Sep 2020, 12:30

RE: RE: RE:

trading.ternet said:

firemyst said:

PanagiotisCharalampous said:

Hi firemyst,

Here it is.

Best Regards,

Panagiotis 

Join us on Telegram

 

Thanks @Panagiotis!

For anyone looking for a code sample, this will return the time as specified on the chart regardless of local user's computer's timezone:

DateTime.UtcNow + Application.UserTimeOffset

Hi,
I am a newbie in cAlgo,
many thanks for informations.
But I don't understand how I can get hour value from UserTimeOffset (to use in a Bot Time filter for example)

Many thanks for help
Michel

Oh sorry
I have found
Thank you

 

 

 



 

 

 


@trading.ternet