Forums  > Trading  > Index trading strategy  
     
Page 1 of 5Goto to page: [1], 2, 3, 4, 5 Next
Display using:  

Energetic
Forum Captain

Total Posts: 1488
Joined: Jun 2004
 
Posted: 2018-03-25 20:06
As I mentioned before, I've been working on a volatility trading strategy. Although the results are very good (much better than what you will see below), I have a feeling that after XIV meltdown people will be very cautious about shorting vol for a very long time.

So I had a thought to apply the same or similar signals to trading equity indices. Using SPY as a benchmark, I worked out a strategy (calling it SP+ for now) that on any given day is either long or short SPY, or stays in cash. Leverage is not used at all.

In addition to overall statistics where in- and out of sample data are commingled, I am also providing a breakdown of annual strategy performance vs. the benchmark. Clearly, the strategy outperforms the benchmark by a lot during bear or flat markets and slightly lags otherwise.

Please let me know what you think.



For every complex problem there is an answer that is clear, simple and wrong. - H. L. Mencken

nikol


Total Posts: 520
Joined: Jun 2005
 
Posted: 2018-03-25 21:28
Lame question:
maxDD = -21%, while I dont see this number in SP+ series of maxDD. Why so?

Energetic
Forum Captain

Total Posts: 1488
Joined: Jun 2004
 
Posted: 2018-03-25 21:39
B/c the drawdown began in one calendar year and ended in the next.

For every complex problem there is an answer that is clear, simple and wrong. - H. L. Mencken

frolloos


Total Posts: 43
Joined: Dec 2007
 
Posted: 2018-03-26 03:58
>So I had a thought to apply the same or similar signals to trading equity indices. Using SPY as a benchmark, I worked out a strategy (calling it SP+ for now) that on any given day is either long or short SPY, or stays in cash. Leverage is not used at all.

So nbr of futures is +1,0,-1 on any given day? If the returns below are based on some kind of mean-reverting strat then that's quite interesting. I've looked at mean reverting strat on indices before, but nowhere near the returns you show below.

goldorak


Total Posts: 1046
Joined: Nov 2004
 
Posted: 2018-03-26 09:33
Performance over 1993-2003? SPY existed before. Are you trading at the close only?

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

nikol


Total Posts: 520
Joined: Jun 2005
 
Posted: 2018-03-26 12:10
> B/c the drawdown began in one calendar year and ended in the next.

I though so, but this means that your max(MDD) is around calendar year start/end and is badly formulated (to my taste). Your table does not demonstrate which year this (MDD=-21%) has happened.
Therefore, suggestion. Since MDD is calculated over sliding history window account your MDD(YY) = max(DD(1-Jan-YY-Window:1-Jan-YY)) or similar.

ronin


Total Posts: 341
Joined: May 2006
 
Posted: 2018-03-26 13:14
What sort of trading costs do you have in this? Funding costs? Short interest? At what price do you think you are getting in and out every day? How much are you actually trading? What limits on position sizes do you have?

What does it look like when you subtract the S&P beta?

As per @goldorak, what happens in the years before 2004?

As per @nikol, I don't understand the maxDD table. MaxDD can only increase, not decrease. Is this annual DD, rather than maxDD? DD from what then - first open of the year? Running max? Something else?

How much of your high returns in 2008 and 2011 happened on low liquidity? Would you really have been able to trade it? At what prices?

What's the return distribution actually like? What's it like when you remove obvious outliers?

I would say Sharpe 1.1 based on some idealised no-friction trading isn't great. Realistic Sharpe will probably end up around the 0.5 mark before fees.

I do like the fact that maxDD is roughly the same as annual return, but I am not sure that will survive more serious testing.

I like that it makes money consistently over 13 years. But the backtest should be as long as possible.

I am concerned that close to 100% of your outperformance over S&P happened in two years - 2008 and 2011. Take them out, and you are not outperforming.

Try doing it on single stocks and/or other futures - maybe diversification helps.

"There is a SIX am?" -- Arthur

Energetic
Forum Captain

Total Posts: 1488
Joined: Jun 2004
 
Posted: 2018-03-26 18:18
@frolloos

No, it's not based on mean reversion. It's based on VIX and VIX futures.

@goldorak

I don't have VIX futures data pre-2004. Yes, at the close.

@nicol

I agree that you don't know from the table when -21% happened but you can easily conclude that it was between 2008-10. IMO, there is a value in looking at the distribution of annual returns, not just one CAGR number. Exactly the same should hold for DDs, no? It doesn't seem like anyone has a problem interpreting what it means that the strategy returns X% in year YYYY. I'm not sure why it's different with DDs. If I read you correctly, I'm doing exactly what you're suggesting with window size of 1 year.

@ronin

The simulation is completely idealized: no trading cost, no borrow cost, no size limits. To be fair, we're talking about trading extremely liquid underlying. I'm assuming that even during the worst times you can trade S&P futures in sufficient for all practical purposes size.

I can't meaningfully subtract beta b/c the strategy is long SPY about 70% of the time.

Yes, it is annual DD computed the usual way except all past and future history away from the reporting year is ignored. I thought it'd be a useful addition to the single MaxDD number.

The distribution of monthly returns is shown below.

Development set is 2011-16. The backtest set is 2004-2010. As of 2017, it's a holdout. I got 24% this quarter w/o even trying. I'll be happy to test it more seriously if you have suggestions. This is, in part, what I'm here for.

Since you scared me a bit, I put zeroes in the returns table between 2008 and 2011. Results: S&P returns 8.4%, my strategy returns 12%.


For every complex problem there is an answer that is clear, simple and wrong. - H. L. Mencken

kloc


Total Posts: 14
Joined: May 2017
 
Posted: 2018-03-26 18:52
When you say "long or short SPY" you are always either 100% long, 100% short ,or 0% (i.e. not invested)? Or do you allow "partial" amounts (e.g. 37.5%)?

How many parameters does your model have?

-kloc

More questions:

How sensitive is it if you delay your signal by one day (or more)?

What happens if you trade at the open?

How well does it perform in a long-only form? Some investors might not be able to go short; is it still valuable for this class of investors?

nikol


Total Posts: 520
Joined: Jun 2005
 
Posted: 2018-03-26 18:54
> why it's different with DDs. If I read you correctly, I'm doing exactly what you're suggesting with window size of 1 year.

Ah, I understand. My example MDD(YY) = max(DD(1-Jan-YY-Window:1-Jan-YY)) accidentally coincided with your definition.

The reason of our difference is that I visualize a 1-year window rolling with 1-day frequency, so, series of windows are overlapping. Therefore, more generically my example is MDD(t) = max(DD(t-1Y : t)).

From this, if you quote in your table MDD(YY)=max(MDD(t)) for t \in {1-Jan-YY-1Year:1-Jan-YY}, then somewhere in 2008-2010 you will get this -21%.

My only concern is that you will get same question from potential investors.

ronin


Total Posts: 341
Joined: May 2006
 
Posted: 2018-03-26 19:33
It's a tough one.

There is definitely value in knowing when to go short and returning high double digits when the market is crashing. Especially if you know when not to, so it's not too expensive when the times are good.

On the other hand, that's a tough sell.

The long-index-70%-of-time may be an easier sell, but there is less value in it. That's just beta.

To come back to trading costs, liquid doesn't mean zero trading costs. This thing could be trading a lot. Put in some sensible costs and slippage, and see what happens.

Also, you seem to be flipping between e-minis and SPY. You'll probably have to decide on one or the other, and factor in the goods and the bads of what ever you chose.

The thing with parameter fitting is also potentially a concern. Try to randomise it a bit and see how it holds up.

The good news is that there is potentially something there. I didn't neessarily think so initially. I'm just not sure it is visible in this form.


"There is a SIX am?" -- Arthur

Energetic
Forum Captain

Total Posts: 1488
Joined: Jun 2004
 
Posted: 2018-03-26 19:51
@ kloc

Yes, exactly: there are no partial amounts at this time. So far I didn't come up with useful ideas to approach sizing.

There are 6 parameters.

Delaying by 1 day almost kills it, i.e. it's still much better than benchmark in terms of DDs but the returns are barely above.

I'm assuming that opening price is randomly above or below yesterday close so it should not matter much. I didn't test that.

Long only, you probably mean long or cash, right? If I simply replace short signal with neutral then it barely outperforms the benchmark, which is not a fair test, of course. I tested long-only versions briefly in the very beginning. I found them about as profitable overall as benchmark but much less risky, e.g. MaxDD was -11%. I didn't like that it was growing at about only 6% clip after 2010 (which is my sample set - and I still couldn't calibrate it to do better). It was compensated by a similar growth rate pre-2010 but I thought I could do better.

@nikol

I need to find those potential investors first ;)

For every complex problem there is an answer that is clear, simple and wrong. - H. L. Mencken

goldorak


Total Posts: 1046
Joined: Nov 2004
 
Posted: 2018-03-26 20:16
> I don't have VIX futures data pre-2004. Yes, at the close.

OK, VIX futures as a signal, I see. Pay attention as it is very (yes, very very) easy to overfit with those. I have seen that you mention 6 parameters further in your posts. It is a lot.

I probably do not have anything to teach you, but I will mention this here as may be you have not thought of it, and anyway this might be useful knowledge for others: information availability. SPY close was at 16:15 EST until the end of 2008, before moving to 16:00 EST. Close prices for VIX futures are as of 16:15 EST. We can have lengthy discussions on the opportunity of actually observing and trading the close at the same time, but we will not have any if by any chance you are using VIX futures close prices from 15 minutes in the future to take a position in SPY now!

Otherwise, just a comment on a comment by Ronin:
> There is definitely value in knowing when to go short and returning high double digits when the market is crashing.

It is one data point. At best two if you include summer of 2011.


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

Energetic
Forum Captain

Total Posts: 1488
Joined: Jun 2004
 
Posted: 2018-03-26 21:17
6 parameters is a lot, I agree. However, look at it this way. The parent model that had only 2 states (long and cash) had 3 parameters which I thought was OK. I found that I need another 3 to separate cash from short. So it's not really 6, it's two sequential calibrations using 3 parameters each.

Also, since I am a bit paranoid about overfitting, I'm not really calibrating. I just test a few "plausible" values for each parameter and select one.

I did think about possible issues with data being asynchronous. Not sure how significant it is in this case (I'm not winning be a few basis points), nor how to get synched data.

Not sure what you meant by your last comment.

For every complex problem there is an answer that is clear, simple and wrong. - H. L. Mencken

Energetic
Forum Captain

Total Posts: 1488
Joined: Jun 2004
 
Posted: 2018-03-27 00:35
@ronin

I added trading cost. Every basis point knocks off about 0.5% from CAGR. I'm not sure what would be the most sensible number in this context but it must be of the order 1 bp.

The results are, in a sense, robust wrt small parameter perturbations. That is, changing parameter values by 1% up or down doesn't materially change the performance; for 4 out of 6 even by 5%. Changing 2 other parameters by 5% would take away about 3% from CAGR.

Re last sentence, you probably mean the annual DDs, right? Please let me know how to make it better.

For every complex problem there is an answer that is clear, simple and wrong. - H. L. Mencken

goldorak


Total Posts: 1046
Joined: Nov 2004
 
Posted: 2018-03-27 10:07
> I did think about possible issues with data being asynchronous. Not sure how significant it is in this case

The impact is usually far from negligible unfortunately. Just be aware.



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

ronin


Total Posts: 341
Joined: May 2006
 
Posted: 2018-03-27 11:36
@energetic

> the strategy is long SPY about 70% of the time
> Every basis point knocks off about 0.5% from CAGR.

You are turning over the portfolio once per week, and you are long 70% of the time? How does that work?

> long-only versions (...) about as profitable overall as benchmark but much less risky

That's what I meant by two strategies, one long one short.
- Long is a poor man's low variance tracker.
- Short is long tails, or black swan, or what ever you want to call it.


> possible issues with data being asynchronous. Not sure how significant it is in this case

Could be quite significant. I thought you were looking at yesterday's close of the vix, not today's. You are looking into the future as things stand.

You'll have to re-run it, either:
- with some intraday futures data, and create the signal from futures at some fixed time before close. Half an hour, or 15 min or something like that. Or,
- generate the signal from the futures close, and trade on next days open.
Both can degrade your signal quite a lot.

@goldorak

> It is one data point. At best two if you include summer of 2011.

And 24% in q1 2018, on flat spx. I agree it needs some more testing, but I am happy to take it on face value at this point.



"There is a SIX am?" -- Arthur

EspressoLover


Total Posts: 333
Joined: Jan 2015
 
Posted: 2018-03-27 12:06
You should consider trying the same approach with VSTOXX futures. I'd assume the logic could pretty much ported directly. Might get some diversification and higher Sharpe for free.

> I don't have VIX futures data pre-2004.

Have you considered just using ATM implied vol? I.e. replace 1 month VX futures with the vol of a 1-month ATM straddle, 2 month with 2 month, and so on. Obviously the numbers don't line up perfectly. But in general if VX curve is in backwardated, then ATM vol curve is probably backwardated too.

This frees you from the constraint of needing an active vol future. All you need is a relatively liquid option surface. Not only can you backtest back to the 80s, but you can start touching all kinds of assets. Single-stocks, Nikkei, oil, treasuries, gold, ags, even vol-of-vol.

Good questions outrank easy answers. -Paul Samuelson

goldorak


Total Posts: 1046
Joined: Nov 2004
 
Posted: 2018-03-27 13:25
> It is one data point. At best two if you include summer of 2011.

> And 24% in q1 2018, on flat spx. I agree it needs some more testing, but I am happy to take it on face value at this point.

Yes, of course. However, my point is different. It is all about tracking error. When you say that having good performance when market goes crazy down is a good thing, you fix your benchmark: it is the market. Now we have may be 5 data points when things went all right: market down, strategy up. Now, what if market down, then back up with strategy down and more down? You get the tracking error in the opposite direction. Uncorrelated returns are nice, but "uncorrelated to the market" when you are just being long or short the market does not mean anything because at every single point you are long (correl=1) or short (correl=-1). While on average your correlation is zero, on every single time step it is not. You just need one extra unobserved data point with poor result to consider the strategy as bad.

If you can do +30% when the market is down -30% with that kind of timing strategy, this means you could very well do -90% (underperform by 60% rather than outperform by 60%).

Then you add to this that the strategy is having different parameters for long and short, which could mean bias with respect to historical performance of the market, and I would recommend not to bet the house on it.

Not saying the strategy is bad though. I am a return chaser and could not care less about volatility as a measure of risk. However, i would recommend for risk management purpose that you simulate what kind of worst result you could get by shuffling randomly the strategy's returns and the market's returns. The result is what you could expect should the informational content of your timing signal go down to zero. And remember: you can only use the ex-post performance of the strategy to judge the informational content of the timing signal, which means you will first lose, then only infer that the signal is dead.






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

Energetic
Forum Captain

Total Posts: 1488
Joined: Jun 2004
 
Posted: 2018-03-27 18:05
@ronin

>You are turning over the portfolio once per week, and you are long 70% of the time? How does that work?

Not sure what bothers you. Sometimes it flips from long position to short and then back tomorrow.

> I thought you were looking at yesterday's close of the vix, not today's.

You were correct, that's exactly the case. The problem, as goldorak describes, is that vol futures closing prices are not available at 4 pm so strictly speaking I can't execute at 4 pm prices. The reality is that the signal is usually (99% of the time) robust. I know it b/c I'm running the strategy in real time for my own portfolio. So, for most practical purposes, I can use the last VIX futures prices seen by 4 pm and get the same signal. And there is no reason to believe that the results will be better or worse in the sense that there shouldn't be a systematic drift of SPY between 4 and 4:15. The basis could be significant on any given day, I agree, but over time it should be a wash.

You guys need to let me in on your data points counting. The way I see it, there are 2007-08, 2011, 2015, 2018. Moreover these are all significant bear markets in the sample. Also, I'd like to modestly point out that I didn't intend to achieve that. I only targeted total return, the rest just happened.

@EspressoLover

Thanks for your suggestion about VSTOXX futures. I'll need to figure out where to get the data though. My esteemed employer is very stingy about subscriptions.

Great idea about using ATM implied vols, too! It won't be useful for my original vol trading strategy, the parent of this one, but for stocks I might be able to derive signals from vol curves. The downside is that the project could be too big for a hobby. My esteemed employer still expects me to do some mundane work 9-5.

@goldorak

> Now, what if market down, then back up with strategy down and more down? You get the tracking error in the opposite direction.

Yes - exactly. The strategy sends wrong signal (not being long when it was better to be long) about 15% of the time. Sometimes, randomly, you get a string of wrong signals. That's how you get years like 2009 or 2013. I don't know how it could be avoided.

> You just need one extra unobserved data point with poor result to consider the strategy as bad.

Sorry, I didn't get this one. Could you explain?

> Then you add to this that the strategy is having different parameters for long and short

It's more like this. First, decide whether we want to be long. If not decide whether be short. So, the long leg is "aware" of others only via the existence threshold. The short and neutral legs are fully aware of all parameters. Could you elaborate on your comment about bias? I'm not guaranteeing that there is no bias (how could I?), I'm just wondering what triggers your suspicions?

I appreciate the recommendation. I believe EspressoLover recommended something like that before for my vol trading strategy but I didn't quite understand. Let me make sure that I do now. So, if I represent my data as a sequence of monthly returns
{R1, R2, ..., Rn}, you suggest that I took a random shuffle of this set, simulate different paths of strategy performance and register worst outcomes. Yes/no?

For every complex problem there is an answer that is clear, simple and wrong. - H. L. Mencken

goldorak


Total Posts: 1046
Joined: Nov 2004
 
Posted: 2018-03-27 21:05
>You just need one extra unobserved data point with poor result to consider the strategy as bad.

I mean that the worst is still to come as it has not been observed yet.

> Bias

The market goes up on average over the period considered. By having different rules for longs and shorts, you may have integrated that important piece of information in your rules without really wanting it.

> What could happen in the future?

Let's assume your signal is a real one. Now you want to know what is the risk of using the strategy knowing that eternity is an exclusive affaire of the Vatican and that quality of signals is like humans: it only goes down with time.

The assumption would be that the "typical runs of long/short/cash signals" is fairly constant over time. You do not shuffle the signal as you want to keep its "structure". I mean if your typical signal looks like LLLLLLSLLLLLLSSLLLLLLLLLLLLLSSSSSSLLLLLLLLLLLSSLLLLLLLS and is stable over time, you do not want to ruin its persitence by shuffling L and S and get scenarios like for example LSLSLS. This would be unrealistic with respect to transaction costs and persistence of positions.

What you do is keep that signal as is, and apply it to randomly shuffled market returns (bootstraps). There are different bootstrap methodologies you may want to consider, but for a first try, pure shuffling is OK. This will give you an idea of what could happen would your signal become completely uninformative. By generating a fair number of scenarios, you could get a more complete opinion of what you may face in the future once your signal has become worthless, but you do not know it yet.

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

kloc


Total Posts: 14
Joined: May 2017
 
Posted: 2018-03-27 21:48
EspressoLover's suggestion regarding VSTOXX is really good - it's the low-hanging fruit kind of stuff. I would just add N225 (and possibly HSI ) to that list - they have futures for VIX-like indices (VNKY and VHSI) as well. Fewer tenors than SPX , though...

-kloc

kloc


Total Posts: 14
Joined: May 2017
 
Posted: 2018-03-27 22:36
Replying to your replies... :-)

6 parameters, as other pointed out, might be a lot; I'm guessing they might be linked in some way to first 5 or six futures in a linear model or something like a perceptron. I would try too see how much of the performance is lost if the model is simplified and fewer parameters are used (if it is a linear model; maybe slope and average level of the futures would be enough and you would need only 2 parameters - something like that).

Trying open instead of close tests how much you are sensitive to execution price - if you have to execute *exactly* at close to reproduce the performance, and this performance is almost entirely lost if you use open instead, maybe there is something suspicious there...

Regarding long only: yes, i meant replacing short positions with cash. It is a shame that you lose that mush by going long-only. Does this mean that most of your performance comes from short positions? If that is the case, should you be trading VIX futures diirectly instead?

goldorak


Total Posts: 1046
Joined: Nov 2004
 
Posted: 2018-03-28 07:35
> Are you suggesting is to keep {LS} sequence as is but shuffle {UD} set?
> Let's make it shorter. Suppose, for a given week, my signals are {LLSSL} and since my signals are so good the actual returns are {1%, 2%, 0, -1%, -1%} so that I made about 3% that week. If the shuffled sequence is {-1%, 1%, 2%, 0, -1%} and I lost about 1% on the week b/c my signals are no longer aligned with the market and all skill is lost. You probably meant something else...

No, that is the goal: to see what happens when all information is lost in the signal. Come back a few posts. That was an answer to ronin who was comparing to S&P 500 returns, and hence considered the S&P 500 as a benchmark of your strategy (as you do too). Now, your risk is the tracking error with respect to the S&P 500. It is very large. As long as your signal is informative, you can produce a bias in this tracking error. The consequence is that your performance is far away from the S&P 500, but mostly on the right side. Now, what could happen if all informative content in the signal is lost? With your tracking error, performance could be devastating.

When someone makes +37% while S&P 500 is down -34%, there are 3 possibilities: pure luck, overfitting (my bet, but not a critics of your work), or the extraction of a piece of information no one ever saw before. You bet on the third one. That is fine. However you need to know what could happen if this informational content disappears and how you could react to avoid losing all your previous gains. The shuffling will partly help you with that.

Having well in advance a criterion to know when to exit a strategy is the most important thing. A lot more than trying to detect if the strategy proposed to you or invented by you is good or not. Got my point now?

As an aside, I would be very worried about a 1995-200 period: market up with high volatility. As long as you have not at least backtested such a period, I think you will never sleep peacefully.

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

kloc


Total Posts: 14
Joined: May 2017
 
Posted: 2018-03-28 07:38
Well, the community is only skeptical and it's trying to help in its (as usual, direct) way. :-) There are too many systematic ideas that fail in real life. Everyone trying to shoot your ideas down is a good thing - it will spare you from losing money later or going through the same pain in front of potential investors...

So - embrace the "tough love"!

Being able to get some alpha (say 5% or more) in the long-only form over the benchmark can be very useful, actually. You could use this as an overlay or a signal for another long-only strategy (say, a stock picking one) and market it that way. Just an idea. But first you should drill down if what you have passes all the usual smell tests...



-kloc
Previous Thread :: Next Thread 
Page 1 of 5Goto to page: [1], 2, 3, 4, 5 Next