Question regarding Live Trendbar

Created at 06 Oct 2020, 11:26
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!
CT

ctid2032775

Joined 03.05.2020

Question regarding Live Trendbar
06 Oct 2020, 11:26


Hi Panagiotis,

while diving deeper into Open API 2.0 I've seen one confusing thing:

  • When subscribing for live trendbar (CreateSubscribeLiveTrendbarReq) the server sends all trendbars with the corresponding periods as TrendbarList.
  • The timestamp (utcTimestampInMinutes) can be used to detect a new candle as it is equal to the timestamp of the open tick..
  • The calculation of Open (= Low + DeltaOpen), High (= Low + DeltaHigh) and Low is working as expected.
  • But, the value of DeltaClose is a little bit confusing for me as it is always 0; therefore Close = Low...

I guess it would be more logical - and even correct - when DeltaClose = Bid - Low; therefore Close would always be the current Bid price (as it is in cTrader)...

Are my considerations correct or did I misinterpret the logic behind the mentioned fields?

Many thanks for your reply and best regards,
Christian


@ctid2032775
Replies

PanagiotisCharalampous
06 Oct 2020, 11:53

Hi Christian,

DeltaClose is not populated for Live trendbars, only for historical ones, since the bar has not closed yet. You should be using the bid price instead. 

 Best Regards,

Panagiotis 

Join us on Telegram


@PanagiotisCharalampous

george.secillano
12 Oct 2020, 05:43

RE:

PanagiotisCharalampous said:

Hi Christian,

DeltaClose is not populated for Live trendbars, only for historical ones, since the bar has not closed yet. You should be using the bid price instead. 

 Best Regards,

Panagiotis 

Join us on Telegram

Hi Panagiotis,

Would you mind suggesting how the current bid price can be retrieved?  Should I be using tick data and calculate the current bid price?

Thanks,
George


@george.secillano

george.secillano
12 Oct 2020, 06:47

RE: RE:

george.secillano said:

PanagiotisCharalampous said:

Hi Christian,

DeltaClose is not populated for Live trendbars, only for historical ones, since the bar has not closed yet. You should be using the bid price instead. 

 Best Regards,

Panagiotis 

Join us on Telegram

Hi Panagiotis,

Would you mind suggesting how the current bid price can be retrieved?  Should I be using tick data and calculate the current bid price?

Thanks,
George

Nevermind.  You were referring to the ProtoOASpotEvent. Thanks.


@george.secillano