I guess so...if you're into that more efficient, easy to follow, less error prone style of coding. thanks slowBear, was thinking there must be a better way as i was doing it...
As a thought experiment, have you simply tried to standardize the data over some period (maybe 4-5 yrs)? Then observe the optimal threshold to short? I.e. if filter is >= 3 - 4 std short (or reverse prevailing direction) and cover when filter -> 0 std. First thought is you would have few trades, although given it is 5 min data that may not be the case. Take that optimal standardized threshold value and test it forward OOS for a few years. BTW, using the 12 period filtering would greatly truncate the outliers, which you would want in this case. I suggest also trying with raw 1 or 5 min changes (as shown on my earlier graph) to capture the majority of outliers. Sort of like a P/Call ratio extreme system on a shorter time scale.
We may be getting a bit ahead of ourselves here. Lets step back and get back to the basics. If it isn't clear already, we're going after a mean reversion characteristic. First lets set some standards for testing first: 1. Use 5min ES continuous contract data for the last 10 years or more. If you need it, I can post some data, but, it won't be filtered and may be inaccurate. One can also use index data. The idea is to validate the hypothesis on an index product. Once we validate on the index we can work on transfering the concepts to other products as well as a portfolio level application. 2. General system rules. Trading time between 6am and 12am PST and bar volume must be over 500 contracts. Close all trades at the end of day (1255 pm PST). We can start this analysis as an intraday swing system. Based on our choosen time scale we will be looking to hold most of the day. Of course all this can be altered as we progress. Let us analyze some very basic rules. Lets try the following with SSR being our volatility indicator: Rule 1: ssr < (high of 1 day ago - high 2 days ago). Rule 2: close > high of 1 day ago. Rule 3: yesterday's close > yesterday's open. If 1 AND 2 AND 3 then sell short next bar. Close at end of day. Rule Explanations: Rule 1: Vola contraction at a new high. The market is testing new highs by a certain amount, i.e. positive change in high from the prior day. Rule 2: We are currently trading at new highs. Rule 3: Another measure of possibly being overbought. Alright, thats me spoon feeding. Lets see the simulations for the ES. How do we tell of these rules work? Does this validate our assumptions? Lets brainstorm some better rules as well! Mike P.S. Remember to use intraday, regular trading hours (6am-1pm PST) data only....
This sounds like a good idea. I was going to hint at some normalization issues next, but I like what you're getting at instead. Can you pseudo-code (or whatever environment you work in) this for us? Mike
Here's a first cut at some results for the baseline rules. I've included both ES and SPY (look very close based on a quick glance). Results are based on 1/1/2000 - 10/1/2009.
Great! I see you're using fixed cash size at $1000 per trade for each market, correct? Do you have the proper contract settings for ES? Minimum move, tick size, etc? What conclusions can we make from this backtest? Also, can someone do a distribution analysis on the trade returns?
This is a very crude system that is based on the idea I mentioned. It is daily data, and only holds 1 day and exits. You can add to generate exit on std = 0. The idea is to give someone an idea on how something like this is built in excel. P.S. It is obviously not a holy grail at the moment, but the idea is to take this to intra-day if you want. This is the seeds. for whatever reason, ET choked on the excel file, so it is zipped. P.S.S. I see bs2167 did a much more sophisticated job. Might want to look at that.
One thought is that the system tends to have majority of trades during hig vol regimes (as expected). So you might consider this type of system during periods when VIX exceeds certain threshold and maintains positive momentum. 2nd thought is that I'm not sure how it is implemented, but taking the raw returns and trading opposite direction (as I mentioned) might flip those negative returns into positive ones.
Yes. No, but I don't think it will impact results (apologize if thats idiotic to say - i never look at futures). I have it set with 0 allowable margin and in AB tick size only comes into play if your using stops (it assumes your price data already reflects the correct tick increments). Thats my superficial understanding anyway - that said, my lack of confidence in the ES test is why I put SPY in there as well...a hedge of sorts.
Looking for a bit of help here. Im just testing the first system of the thread and trying to get the lists of Additions and Deletions. I have found the announcement page where each one is listed, but judging by the google results there is actually a page that lists them on the S&P site. However clicking on the link simply takes me to the S&P main page. Including the link that Talon kindly pasted. Ive tried looking through the site but unable to find the page. If anyone has a working link or knows where abouts to find it, it would be much appreciated. Thanks,