Is there any advantage to having synthetic bars in your data?
Author: Panache
Creation Date: 2/28/2020 9:28 PM
profile picture

Panache

#1
Many data providers create synthetic bars for days on which no trades took place. I can see lots of reasons why this produces inaccurate back testing results. For example, trading in UDFI was halted for 8 months from February 19, 2016 to October 18, 2016. If your strategy was programmed to BuyAtMarket or BuyAtClose on Feburary 18, and SellAtMarket or SellAtClose on bar + 1, the "sell" on "February 19" would really have been a sale on October 19.

Moreover, many providers use the last real close (or the OHLC from the last real bar) for the synthetic data. If your strategy was programmed to BuyAtClose on February 18, the SellAtClose on bar + 1 would not have been a zero profit trade. In real trading, you would have received the lower price on October 19.

Finally, if the strategy used the capital from a sale during that period to open another position, that couldn't have happened in real trading either, so any profit from that position shouldn't be included in the back test results.

So, since there are lots of disadvantages to having synthetic bars in your data, is there any advantage to having synthetic bars? The only one I can think of is that I assume many of the performance metrics are calculated using the number of bars held to represent the time a position was held.
profile picture

Eugene

#2
For my record, what providers are this?

On a related note, the just updated Data Tool is now equipped with a new option to remove bad bars like weekends. If there's consensus on that synthetic bars only bring disadvantages and you have a sound logic to detect them, why not consider adding it to the Data Tool.

P.S. I remember having included a logic for merging the Saturday/Sunday data (mainly Forex as there's occasional valid Saturday trading in Russian markets or cryptos, of course) with Friday/Monday (respectively) in Finam/MFD providers. In some providers I may just filter out weekend trading.
profile picture

Panache

#3
QUOTE:
For my record, what providers are this?


I think all the providers do it. Please see the January 28, 2020 entry at https://finance.yahoo.com/quote/ACHN/history?p=ACHN

Here's a quick way to check for them:
CODE:
Please log in to see this code.


In case you're thinking about trying to catch them, I think there are 3 different kinds of synthetic bars:

1. OHLC are all the same as the previous close and the volume is 0
2. OHLC are the same as the previous bar and the volume is 0
3. OHLCV are all the same as the previous bar (less certain, but when you see several in a row it becomes suspicious, ie. Fidelity XOXG from August 6, 2007 to August 20, 2007)
profile picture

Eugene

#4
Thank you, I will look into it.
profile picture

Eugene

#5
Will add an option in Data Tool v2020.04 to detect and/or remove synthetic bars as per your #1 and #2 definitions. Indeed #3 is less certain so we may get back to it later.
profile picture

Panache

#6
QUOTE:
Will add an option in Data Tool
Be careful if it automatically removes them. I am not positive, but I think I have seen the adjusted volume (ie. the raw data from Fidelity, Wealth-Data, Yahoo, etc.) be 0 for some relatively low volume stocks that have had significant splits. However, when looking at providers which do not adjust their data (like Tiingo), there was some trading on those dates.
profile picture

Eugene

#7
It will be optional for both Data Checker and Data Cleaner.
profile picture

Eugene

#8
@Panache

Check out the Data Tool 2020.04. The option I talked about in my 3/4/2020 post is added.
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).