Problem reading D1 bars in H4 chart (always late to update)

Created at 20 Oct 2023, 09:19
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!
MM

MMII

Joined 28.08.2023

Problem reading D1 bars in H4 chart (always late to update)
20 Oct 2023, 09:19


Hi All

I try to read D1 bars data from H4 chart with the following code

But the result (Daily bar) is always late:

I can't figure out what I am not missing.

Any help is greatly appreciated.


@MMII
Replies

PanagiotisChar
21 Oct 2023, 07:12

Hi there,

I don't see anything wrong. The code reads the value of the last closed bar, not the current bar. If you are looking for the current bar use Last(0)


@PanagiotisChar

MMII
21 Oct 2023, 13:40 ( Updated at: 22 Oct 2023, 06:31 )

RE: Problem reading D1 bars in H4 chart (always late to update)

PanagiotisChar said: 

Hi there,

I don't see anything wrong. The code reads the value of the last closed bar, not the current bar. If you are looking for the current bar use Last(0)

Hi, thanks for the response

What confuses me is that when the current date (left side) is 18/09/2023, the last daily bar (Daily(1)) is14/09/2023 instead of 17/09/2023?

 

 

 


@MMII