Forums  > Trading  > Strategy Bias  
     
Page 1 of 1
Display using:  

momop


Total Posts: 20
Joined: Mar 2011
 
Posted: 2018-07-09 20:05
I've been working on exploring a intraday momentum strategy (essentially, buy or sell at open and close EoD). The following is a typical report on the results (0 = short, 1 = long). The training uses CV to arrive at best parameters and the holdout data is not included in training. Similar results are presented with various stocks, where the holdout results look slightly better for either long or short (but never for both). To me, it looks like I may not have any real alpha source. I was wondering if this is still tradeable, if I trade only along the direction that provided better hold-out result. Appreciate if anyone has any pointers.


----------------------------------
precision recall f1-score support

0 0.61 0.56 0.58 1218
1 0.54 0.58 0.56 1061

avg 0.57 0.57 0.57 2279

Holdout Report
precision recall f1-score support
0 0.55 0.57 0.56 136
1 0.48 0.46 0.47 118

avg 0.51 0.52 0.51 254

ronin


Total Posts: 314
Joined: May 2006
 
Posted: 2018-07-11 16:45
If the question is "I was wondering if this is still tradeable", the answer is pretty much always no. Don't even bother to look - it's a no.

Things don't improve as you look deeper, they look worse. So you really only want to look at it if your first reaction is "OMFG this is unbelievable, this is a licence to print money, how did nobody ever find this?!?"


"There is a SIX am?" -- Arthur

ronin


Total Posts: 314
Joined: May 2006
 
Posted: 2018-07-11 17:22

If you seriously think you have something there, start looking at other holding periods. Open to close is not a meaningful holding period. It may be that you may have something, but it looks bad because you are holding it either too short or too long.


"There is a SIX am?" -- Arthur

sharpe_machine


Total Posts: 7
Joined: Feb 2018
 
Posted: 2018-07-11 17:52
@ronin
Could you please give some insight on how can market impact be calculated in the case of trading at the MOO for SP500 stocks?

goldorak


Total Posts: 1041
Joined: Nov 2004
 
Posted: 2018-07-12 06:42
Two important points.

1) "The training uses CV to arrive at best parameters". Fine, and how do you tune the parameters of the CV? oups...

2) what data are you using for the open and the close? Standard OHLC data you can find out there? You may be quickly disappointed discovering these are very often not the actual open and close prices. Even for S&P500 stocks these data are not fully reliable, even nowadays.

If you are not living on the edge you are taking up too much space.

ronin


Total Posts: 314
Joined: May 2006
 
Posted: 2018-07-12 10:56
> how can market impact be calculated in the case of trading at the MOO for SP500 stocks?

I don't regularly trade the opening auction, so I have never looked at the specifics.

The basic estimate of the instantaneous impact in any situation is the square root law, which says that if you are x % of the overall volume, you will generate (pretty much) that same x % of the overall variance. I.e. your contribution to volatility is the square root of your participation rate. Translate that to auction price and auction volume, and it's a first estimate. But I have no idea how useful it is - I never did a serious study.

CFM has published a lot of work on market impact, and a lot of it is quite useful. They actually did look at a lot of data. I know a couple of guys who just picked up their papers and directly coded the formulas from the papers. Not me, so I don't know how it worked out. And I don't think there is a paper specifically dealing with the opening auction for S&P stocks. Still, the papers are on their website: https://www.cfm.fr/insights/

But be careful - it's very easy to go down that rabbit hole, and never come back...

"There is a SIX am?" -- Arthur

momop


Total Posts: 20
Joined: Mar 2011
 
Posted: 2018-07-12 18:21
@goldorak - I use GridSearchCV to tune the parameters. I am using OLHC data from iqfeed. From what I know, they provide the best quality for retail traders. I did make some changes since I posted last, specifically around using a sliding window. Essentially, start with last 60 days of OHLC data, train a model (Just RandomForest for now) and arrive at best parameters via grid search and use it to predict next day movement. Now move the day by one and repeat (60-day is a random value I chose. Too small would be too much noise. I started with too large a value and it didn't yield any great result - so just trying a smaller window).


momop


Total Posts: 20
Joined: Mar 2011
 
Posted: 2018-07-12 18:34
@ronin - Thanks for reinforcing the fact that even my best numbers could be attributed to chance. Can you please clarify or point me to why you said "open to close is not a meaningful period". The way I am experimenting is to make a trade everyday, but close end of the day to avoid holding it overnight. Since I posted last, I am experimenting with modeling after the opening volatility dies as well as using a sliding window model. Don't know if the numbers would be worse or better.

goldorak


Total Posts: 1041
Joined: Nov 2004
 
Posted: 2018-07-13 03:34
> 60-day is a random value I chose. Too small would be too much noise. I started with too large a value and it didn't yield any great result - so just trying a smaller window

Parameter, chosen ex-post. Your backtest is worth nothing if you pick the parameters once you have already tested the data. Do you realize that it is extremely easy to get good results picking the right parameters... after the fact?

If you are not living on the edge you are taking up too much space.

sharpe_machine


Total Posts: 7
Joined: Feb 2018
 
Posted: 2018-07-13 04:00
> I am using OLHC data from iqfeed. From what I know, they provide the best quality for retail traders.

It is not about IQFeed quality, but rather the fact, that "O" in OHLC does not equal the official opening price. The same with "C". You should look at the Level 1 data and find the exact opening/closing trade and get a price from it.

ronin


Total Posts: 314
Joined: May 2006
 
Posted: 2018-07-13 10:48
> make a trade everyday, but close end of the day to avoid holding it overnight

Yes, that is my point. You are closing at the end of day because it is convenient for you, not because it is good for the strategy.

Let me give you two examples.

Example 1

E-mini S&P ticks up. Single stocks don't tick up (yet). You can get the same exposure for two different prices. So you buy single stocks, sell futures.

And then... you hold until close?

Example 2

Tesla and General Motors are valued roughly the same. GM has a lot more value, Tesla has a lot more growth. But you look at it, and there is no way Tesla can grow to be as big as GM within any reasonable time frame. So you buy GM, sell TSLA as a value against growth play.

And then... you hold until close?

You get the idea. They are both reasonable strategies, but not if you hold until close.

First work out how your strategy should work. What's the holding period, and why. Why is the most important thing of all. If you don't know why it works, don't trade it. Nothing good will come of it.

Once you know how and why it should work, then look at your constraints and see what is the best you can do within the constraints.


"There is a SIX am?" -- Arthur
Previous Thread :: Next Thread 
Page 1 of 1