aalto1 untyped-item.component.html
From candles to ticks – Improving financial backtesting accuracy
Loading...
URL
Journal Title
Journal ISSN
Volume Title
Perustieteiden korkeakoulu |
Master's thesis
Unless otherwise stated, all rights belong to the author. You may download, display and print this publication for Your own personal use. Commercial use is prohibited.
Authors
Date
Department
Major/Subject
Mcode
SCI3042
Language
en
Pages
52
Series
Abstract
Backtesting is a widely used method when developing new financial trading algorithms. The current standard in backtesting software is to use candle data as a source for market information. However, even though candle data is the de facto standard, previous literature has identified issues with the approach. Candle data is a compressed data format, and it loses price movement information that happens inside the candle period. This leads to possible incapability of candle-based backtests to provide accurate results, especially in high-frequency contexts.
This thesis proposes that switching from candle to tick data could significantly improve backtest accuracy in a high-frequency context. To test the hypothesis, a comparative study is done between tick- and candle-based backtests. A test algorithm is deployed to live markets to gather baseline data, after which backtests are run against the exact same data. By measuring errors between real world results and both the candle-based and tick-based backtests, we can determine if and how much tick data improves the accuracy compared to the standard method of using candle data.
The results indicate that the hypothesis is correct. Switching to tick data results in significantly smaller errors in backtesting when compared against actual live performance. In addition to overall results, a more in-depth analysis is presented to identify the underlying reasons for lower accuracy in candle-based backtests. Finally, several tests are run which indicate that improvements in accuracy diminish when moving to lower frequency algorithms.
Historiatestaus on yleisesti käytetty menetelmä uusien kaupankäyntialgortimien kehittämisessä. Tyypillinen tapa historiatestauksessa on käyttää datalähteenä kynttilädataa. Laajasta käytöstään huolimatta kynttilädataan pohjautuvassa historiatestauksessa on ilmennyt merkittäviä ongelmia. Ongelmat juontavat juurensa siihen, että kynttilädata on ns. pakattu dataformaatti, joka hukkaa tietoa hintaliikkeestä kynttilän sisällä. Näin ollen kynttilädataan pohjautuva historiatestaus ei välttämättä tuota oikeita tuloksia, erityisesti jos kyse on nopeasti kauppaa käyvistä algoritmeista.
Tämä työ tutkii, pystytäänkö historiatestauksen tarkkuutta parantamaan siirtymällä kynttilädatan käytöstä transaktiodatan käyttöön. Tämän hypoteesin testaamiseksi tehdään vertaileva tutkimus kynttiläpohjaisen ja transakatiopohjaisen historiatestauksen välillä. Vertailukohdaksi on tehty noin viikon testiajo oikeilla markkinoilla. Historiatestit ajetaan samaa ajankohtaa ja samoja valuuttoja vasten, jonka jälkeen pystytään mittaamaan historiatestien virhettä oikeaan ajoon verrattuna.
Tulokset viittaavat siihen, että kynttilädatan vaihto transaktiodataksi parantaa historiatestauksen tarkkuutta merkittävästi. Pääasiallisten testien lisäksi työ tarkastelee tarkemmin yksittäisiä tilanteita, jotka selventävät juurisyitä siihen, miksi ja millaisten tilanteiden takia kynttiläpohjainen testaus ei tuota täysin oikeita tuloksia. Lopuksi työ osoittaa, että transaktiodatasta saatu tarkkuuden parannus pienenee, kun nopeista algoritmeista siirrytään hitaampiin.