Whats wrong with the built-in Symbol.Spread?

Created at 11 Dec 2021, 13:43
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!
CA

caglar_G

Joined 20.09.2020

Whats wrong with the built-in Symbol.Spread?
11 Dec 2021, 13:43


You would think that once you want to know the spread at any given time/ per tick, you'd simply do Symbol.Spread as per the API-wiki: 

 

However, once you try to print the spread per tick, you don't exactly get what you want:

The spread never changes! :( Is this intended? 

 


@caglar_G
Replies

amusleh
13 Dec 2021, 09:35

Hi,

The Symbol.Spread does change based on live difference between symbol bid and ask price levels.

Are you using Symbol.Spread on back tester? if you are back testing and you want to use Symbol.Spread then you must use tick data for your back test not bars data.


@amusleh

caglar_G
13 Dec 2021, 10:37

RE:

amusleh said:

Hi,

The Symbol.Spread does change based on live difference between symbol bid and ask price levels.

Are you using Symbol.Spread on back tester? if you are back testing and you want to use Symbol.Spread then you must use tick data for your back test not bars data.

I see! That makes sense and yes, this was during a backtest without real tick data


@caglar_G