Automated backtesting: avoiding trading around news

The past few months I have been coding some automatic back-testing in Python (and using BackTrader). I have found some of my strategies are ***nearly*** very profitable, but get tripped up by news. I have looked for historical economic calendars, and/or routines to check them, but I came up empty.

So I manually scraped a bunch of calendar data from here:

[ economic calendar](

Then I wrote it to a CSV file, and coded a Python class to handle it and check for news ‘collisions’.

Right now it’s pretty quick and dirty, and reflects only high impact news.

If anyone is interested in this data and code let me know, I will clean it up and share it.

Also, if anyone has access to better historical calendar data (perhaps an API subscription to []( I would love to get my hands on it, I could really improve this.


İlgili Makaleler

Bir cevap yazın

E-posta hesabınız yayımlanmayacak.

Başa dön tuşu