Since the first article of this blog (Technical Analysis for intraday stocks trading? FORGET IT!), i’m pointing to the fact that there is a lot of cross correlation between stocks and between stocks and the future index. That’s not new to anyone and even those who are starting at the quantitative trading/analysis come to realize this on their own. But, is there some way we can explore that pattern and extract some alpha?
My last post Arbitrage on cross-section returns in Brazilian stock market presents an example about how can we profit from this. The intention of this article is to show another curious pattern that was born here in the brazilian future stock index that is derived from this interaction between those markets.
For those who doesn’t know what i’m taking about, i do strongly suggest that read the previous posts for a deep understanding.
Some basic concepts
Before explaining the curious pattern, let me explain the conditions that the future market and the stock markets have here in Brazil which led me to suppose why of such a pattern do exists. And when i said suppose is because i’m not 100% sure that the following explanation is the right one. It’s only the most plausible for me.
When we thinking in enter in the brazilian stock market, basically, we have 3 options:
- Buy stocks (obviously). They are traded at the BOVESPA stock market.
- Buy the IBOVESPA’S ETF. His ticker is BOVA11. Traded at BOVESPA also.
- Buy the stock index future. His ticker is IND. Traded at the BM&F.
As explained before, these assets are traded by different peoples, looking at different reports, with different opinions (That’s the main reason why trend-following in the stock market it’s not so profitable as in commodities: there must be a consensus in the market about the direction that the the whole stock market is taking).
The stock market and the future market opens and closes at different times: Stocks and ETFs opens at 10:00 AM and closes at 05:00 PM and the futures market opens at 09:00 AM and closes at 18:00 PM, as you can see in the picture down here:
The birth of a different pattern
Well, as they are the same thing, stocks, Index ETF and Future Stock Index have to trade at a same level. If they don’t, anyone can profit from a simple arbitrage stategy. But, the future stock index spend 2 hours more trading than the other. That mean that only the players that do trade at him will incorporate the newsflow to the price. If a very relevant company announces it results, the future stock will be the first proxy of how the market reacted to this. The key point here is: Do the Stocks traders agree with the overall change that future stocks had overnight?
That fact allow us to create at least three hypothetical scenarios:
- The Stock market will agree with the overnight change on the price and converge to the Future Stock Index when they open (10:00 AM). In this scenario the stocks tends to converge to the Future Index and it will stay wherever it is. So we can profit buying/selling any stock that open bellow/above the index variation.
- Half of the days they will agree, half they won’t. So, in 50% of the days the Index will converge to the stocks, 50% the stocks will converge to the index. In this scenario, we can’t make profit because we can’t suppose who is going where.
- The Stock market will not agree and will stay closer to where it closed on the last day then on the Future Index. So, the Future Index will be forced to converge to the Stocks prices. In this scenario, we sell/buy the Future Index if they go up/down at the open at the stock market and waits it goes down/up.
As the previous articles, to test those hypothesis, i’ll be using only the IND serie that can be found on the official FTP provided by the BM&F. I created a continuos series, adding the roll returns (same method used by Bloomberg). The data here vary from 22/12/2014 to 31/05/2016. All the data was stored in a local MongoDB server, acessed via Python by a excellent API called Arctic.
Statistical Testing and Results
To test which of those scenarios is was what prevailed in the dataset, i’ll try to fit the following linear model in the data i have:
Where Y will be today’s return of the stock index between 10:00 AM and 10:30 AM and X will be the return from yesterday’s close ’till today’s stock market open. That means we are trying to find some form of predictive power in the overnight’s change on the firsts minutes when both markets are open.
We begin collecting the data from our server and storing into a Pandas DataFrame called ind.
If we plot the index serie, we’ll see that it is perfect:
After that, we can create both X and Y DataFrames. By this, we begin slicing our data in the desired times:
With that done, we can create our X and Y vectors. I used the absolute returns insted of percentual changes.
We can then make a scatter plot:
A first glance tells us that there is a certain relationship between the data. We can mesure this using the linregress function from scipy library.
LinregressResult(slope=-0.12893318214562502, intercept=-3.7789479936766783, rvalue=-0.25846893596511661, pvalue=9.1634252170004753e-07, stderr=0.025794645132302303)
What this output is telling us is that the calculated value for slope in our model is negative and equals to -0.1289 and it is statistically different from zero (as we can see interpreting that pretty low pvalue).
How can we interpret this?
A negative slope means that there is a negative relation between the return of yesterday’s close and todays open (X) and the return of today’s 10:30 AM with today’s open. So, we can conclude that the hypothesis 3 is the correct and can create a trading system that sells/buy the index if they go up/down at the open at the stock market and rebuys/resells 10:30 AM.
But, is 10:30 AM the best hour to close our trade? Is there any kind of filter we can put in the strategy? There is some better form to operate this? This patterns cover the coasts? Obviously, all that questions need to be answered before trading this system, but, we got another alpha here. I intend to exploid more this results in the next articles.