Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
2019, 18*32
A few months ago, I discovered that Quantopian has data for the
earnings dates for stocks. I had been looking for a good reason to try out
Quantopian and this looked like a good project.
https://alvarezquanttrading.com/blog/avoiding-trades-before-earnings/ Strona 1 z 6
Avoiding Trades Before Earnings – Alvarez Quant Trading 24.04.2019, 18*32
Before I get into the details of the test, I must clarify one thing. I am not
an expert Python programmer, which is the programming language you
use in Quantopian. I have only been coding and using Quantopian for a
few months. I did as many checks as I could on my code. But there is a
larger than normal chance that there is a bug in my code. So as always
verify these results yourself before using them for trading. You have been
warned.
For you Quantopian experts out there. If I say anything wrong or could
have done something better, please correct in me the comments below.
Quantopian Information
Quantopian works very differently in some respects to how AmiBroker
does. Because of this, some rules and stats will differ greatly from what
you have normally seen in previous posts. Here are some differences.
Quantopian does not have S&P500 constituent data. They have data that
they call the Q500US which is the 500 most liquid stocks. To read more
go to The Q500US and Q1500US.
Entry and exit are done on a particular one-minute bar, starting with the
https://alvarezquanttrading.com/blog/avoiding-trades-before-earnings/ Strona 2 z 6
Avoiding Trades Before Earnings – Alvarez Quant Trading 24.04.2019, 18*32
Buy Rules
Stock is member of the Quantopian 500.
The 2 period RSI crosses under (1, 3, 8)
The close is above the 200-day moving average
Rank signals using 100-day Historical Volatility from high to low
Entry is on the next day on the 9Z32 bar
Sell Rules
The 2 period RSI is over 80
If in position above 15 days, exit.
Exit is on the next day on the 9Z32 bar
Base Results
I am not trying to create a great strategy but to have something to
compare against.
https://alvarezquanttrading.com/blog/avoiding-trades-before-earnings/ Strona 3 z 6
Avoiding Trades Before Earnings – Alvarez Quant Trading 24.04.2019, 18*32
Avoiding Earnings
Since a typical mean reversion trade is about 7-8 days. Here are the
additional rules
https://alvarezquanttrading.com/blog/avoiding-trades-before-earnings/ Strona 4 z 6
Avoiding Trades Before Earnings – Alvarez Quant Trading 24.04.2019, 18*32
More Data
I have said this before but I just love results when they surprise me. I was
expecting slightly worse CAR with a slightly better drawdown. In two of
three cases the CAR came down dramatically while in all cases the
drawdown and Sharpe Ratios got worse.
Spreadsheet
No spreadsheet with this post. Mostly because Quantopian does not
make it easy to get data out.
https://alvarezquanttrading.com/blog/avoiding-trades-before-earnings/ Strona 5 z 6
Avoiding Trades Before Earnings – Alvarez Quant Trading 24.04.2019, 18*32
Final Thoughts
Given these results, I will continue to trade my mean reversion strategies
through earnings releases. This is why I test. My guess on what the
results will be are often wrong.
One possible future test is also to avoid stocks shortly after earnings on
the theory that stocks selling off after poor results will continue to sell off.
https://alvarezquanttrading.com/blog/avoiding-trades-before-earnings/ Strona 6 z 6