Difference between Bars[index].OpenTime and Server.Time for an Indicator on Tick

Created at 02 Mar 2021, 20:35
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!
JE

JeanPaul

Joined 17.10.2020

Difference between Bars[index].OpenTime and Server.Time for an Indicator on Tick
02 Mar 2021, 20:35


In an indicator set to 1 Tick:

public override void Calculate(int i)
{
    Print(Bars[i].OpenTime + "," + Server.Time);
}

Shouldn't the time be the same? Also, which time (OpenTime or Server.Time) is the one representing the tick time?

(I am using cTrader 3.8)


@JeanPaul
Replies

PanagiotisCharalampous
03 Mar 2021, 10:48

Hi JeanPaul,

It seems that you are comparing historical times with the current time. Server.Time always displays the current time so it should be aligned with the last bar only. See below

Best Regards,

Panagiotis 

Join us on Telegram


@PanagiotisCharalampous

JeanPaul
03 Mar 2021, 13:25 ( Updated at: 21 Dec 2023, 09:22 )

RE:

PanagiotisCharalampous said:

Hi JeanPaul,

It seems that you are comparing historical times with the current time. Server.Time always displays the current time so it should be aligned with the last bar only. See below

Best Regards,

Panagiotis 

Join us on Telegram

Thank you for the detailed reply.


@JeanPaul