How to get current Bid-Ask for the pair. spread?

Created at 04 Jul 2020, 08:42
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!
MZ

MZen

Joined 29.12.2014

How to get current Bid-Ask for the pair. spread?
04 Jul 2020, 08:42


I have read through Open API doc, yet could not see how I can get current Bid-Ask for the given pair. Without it we can not know spread. Do I miss something?

Also, it would be great to have Bid-Ask information in historical data, probably together with tick data. Is it possible?


@MZen
Replies

PanagiotisCharalampous
06 Jul 2020, 09:09

Hi MZen,

You need to subscribe to spot prices using ProtoOASubscribeSpotsReq. Then current bid and ask prices will be streamed to you.

Best Regards,

Panagiotis 

Join us on Telegram

 


@PanagiotisCharalampous

MZen
06 Jul 2020, 13:44

RE:

PanagiotisCharalampous said:

Hi MZen,

You need to subscribe to spot prices using ProtoOASubscribeSpotsReq. Then current bid and ask prices will be streamed to you.

Best Regards,

Panagiotis 

Join us on Telegram

 

Hi,

the spot stream looks like:

Send: ProtoMessage{SubscribeForSpotsRequest{}}
Received: ProtoMessage{SpotEvent{symbolId:1, bidPrice:112961, askPrice:112966}}
Received: ProtoMessage{SubscribeForSpotsResponse{}}
Received: ProtoMessage{SpotEvent{symbolId:1, bidPrice:112962, askPrice:       }}
Received: ProtoMessage{SpotEvent{symbolId:1, bidPrice:       , askPrice:112967}}
Received: ProtoMessage{SpotEvent{symbolId:1, bidPrice:112961, askPrice:       }}
Received: ProtoMessage{SpotEvent{symbolId:1, bidPrice:112962, askPrice:       }}
Received: ProtoMessage{SpotEvent{symbolId:1, bidPrice:       , askPrice:112968}}
Received: ProtoMessage{SpotEvent{symbolId:1, bidPrice:       , askPrice:112967}}
Send: ProtoMessage{UnsubscribeFromSpotsRequest{}}
Received: ProtoMessage{UnsubscribeFromSpotsResponse{}}

in every spot event message there is only one price: Bid or Ask. As I understand, those are spot prices, a.k.a ticks.

Let me clarify: Yes, transactions occur on bid or ask side, yet, current bid and ask - offers from buyers and sellers, can change, sometimes quickly, without  transactions and without spot event generated. So, spot price/tick in API spot event message is NOT current BID nor ASK.

So. the question is not how to get spot price, as you see I got it, but how to get current offers, sitting on bid and ask sides of the current spread.

Thank you


@MZen

PanagiotisCharalampous
06 Jul 2020, 14:05

Hi MZen,

Spot prices streamed through spot events represent exactly what you have described, the latest offers from buyers and sellers. So this is what you are looking for.

Best Regards,

Panagiotis 

Join us on Telegram


@PanagiotisCharalampous

MZen
06 Jul 2020, 14:22

RE:

PanagiotisCharalampous said:

Hi MZen,

Spot prices streamed through spot events represent exactly what you have described, the latest offers from buyers and sellers. So this is what you are looking for.

Best Regards,

Panagiotis 

Join us on Telegram

Sorry to bother you, but were are ticks? The prices at which transactions occurred?

Thank you


@MZen

PanagiotisCharalampous
06 Jul 2020, 14:26

Hi MZen,

You are misundestanding ticks. Ticks represent current offers to buy and sell. In OTC markets executed trades are not available since trading takes place over the counter between two counterparties rather than on a centralized exchange.

Best Regards,

Panagiotis 

Join us on Telegram


@PanagiotisCharalampous

MZen
06 Jul 2020, 14:39

RE:

PanagiotisCharalampous said:

Hi MZen,

You are misundestanding ticks. Ticks represent current offers to buy and sell. In OTC markets executed trades are not available since trading takes place over the counter between two counterparties rather than on a centralized exchange.

Best Regards,

Panagiotis 

Join us on Telegram

Got it.

In CTrader there is last price and volume in tick charts along with current bid-ask. That is why I got confused.

Thank you.


@MZen