Showing posts with label Quantitative Trading. Show all posts
Showing posts with label Quantitative Trading. Show all posts

Wednesday, February 27, 2013

MultiStage Exit Analysis… more…

In a past post I discussed the various profit exits and how they impact overall results.  We also use a 200 day simple moving average as an exit, which I wanted to look at this time.  As with the 5% profit exit, there is no magic in the specific MA200 number.  In fact, a good robust trading system should still work with slight variations to parameters like this.  Below is a table showing some basic results for a 200 day SMA, as well as a 100 and 50 day stop.

MA Exit

200

100

50

ROI

265%

237%

205%

Max Drawdown

30.71%

33.32%

35.32%

Sharpe

1.92

1.90

1.97

UPI

45.36

40.09

41.65

Worst Month

-18.6%

-16.7%

-12.5%

2nd Worst Mo.

-15.7%

-15.0%

-7.6%

3rd Worst Mo.

-9.0%

-13.4%

-5.6%

As you can see, there are clear trade-offs with these different parameters.  One is not necessarily better than another, as it depends on an individuals performance requirements or metrics.  For example, if pure ROI is the most important thing then the MA200 has performed the best historically.  But if the worst case losses in a given month are important (a way of measuring drawdown) then the MA50 has performed much better.  These sorts of trade-offs are typical in trading systems. 

Good Trading…

Friday, February 1, 2013

January Trading System Results

I hope everyone had a great trading month!  January was really a breakout month for the MultiStage Trading System.  The two newest modifications have worked out quite well. 

First, we are seeing a lot more trades.  To a certain extent, trading is a numbers game.  If we can identify trades with an “edge”, then more trades is better. And that’s what we are now seeing.

Second, using the 200SMA as a soft stop has also help control some runaway trades. Out of the 41 trades it was only triggered a very few times, but it contained a couple runaway losers, thereby reducing drawdowns.

It’s still very early with the modifications, but so far they seem to be working.  As you can see, 41 trades is a nice amount of exposure, and therefore it really improved the overall model results.  Not everyone will see 14% returns for the month, but I know of some that got very close.  I’m interested in hearing from any of you that care to share your real results. Below are a few of the key statistics:

 

Net profit for the month

14.70%

Total number of trades

41

Average return per trade

2.11%

Win ratio

78.05%
Exposure 20.27%
Total time invested

Less than 10 minutes a day!

Now might be a good time to comment on why our real trading results don’t match the model exactly.  I did an article a while back that is still accurate.  The one category I didn’t mention was “execution”.  Sometimes there are simply execution differences with brokers that cause us to get in and out of trades at different prices.  Aside from that, as the article says, Commissions, Sequencing, Liquidity, and Mistakes are the other biggest culprits.  That said, it’s been my experience that you can get pretty close.

Good Trading…

Wednesday, January 9, 2013

Exits for the MultiStage Trading System revisited

For subscribers and followers of the MultiStage Trading System (currently version 9 on CalculatedReturns.com), you will remember that one of our three exit types is a profit stop at 5%.  It’s worth noting that 5% is no magic number.  Take a look at the following short study:

study

As you can see, there are trade offs to moving this exit, and “better” is a function of what you are trying to accomplish.  If getting the highest percentage of winners is important a 3% stop has historically worked out “better”.  If Sharpe ratios are important to you, then higher exits work out better. 

I personally look closely at the Ulcer Performance Index.  This is a number which rewards bigger returns and penalizes drawdowns.  For this number a higher exit, like 6% or 7%, is better.  And for those of you bent on absolute optimization runs, the very best was 7% for short positions, and 6% for long positions.  I suspect that’s a little curve-fit, however, as there really is no “magic number”.

Good Trading…

Sunday, December 2, 2012

November Trading System Results

I hope everyone had a great Thanksgiving holiday!  The end of another year is rapidly approaching.

November started our by teasing us a little with some increasing volatility, but things rapidly settled down after the elections and the VIX fell back into the mid-teens.  If you follow the MultiStage Trading System, you know that this makes for some boring trading and very little activity.  Consquently, the majority of our trades (in fact, all but one) were initiated before mid-month. 

As boring as the second half of the month was, we still were able to get exposure up to 19% given the action in the first two weeks.  This enabled the system to turn in a respectable result.  Below are a few of the key statistics:

Net profit for the month 4.83%
Total number of trades 23
Average return per trade 1.47%
Win ratio 65.22%
Exposure 19.44%
Total time invested Less than 10 minutes a day!

Beginning immediately (first trading day of December… the 3rd) we have modified the system to a new version.  The selection criteria has been improved a bit, but the most important part of the approach is a new exit based on the 200-day simple moving average.  If you don’t follow this new exit your results will not match the back-tested results of the system, although they should be very close to the version 8 results. You can read more about that in the recent posts from last week.

Good Trading…

Tuesday, November 27, 2012

More MSv9 Trading System Data

In my last post I shared the launch of a significant update to the MultiStage Trading System.  The back-tested results from that post were actually my out-of-sample test, which was from 2012.  Results from the prior 11 years were even more impressive.

 

Version 8

Version 9

Max Drawdown%

36.82%

22.81%

Sharpe Ratio

2.95

3.30

Ulcer Perf. Index

66.13

103.97

Worst Month

-16.7%

-11.0%

Annual Return %

297.57%

315.51%

As mentioned last time, risk management is the primary benefit of the update, but overall reward is not penalized for the extra measure of caution.

Good Trading…

Monday, November 26, 2012

MultiStage Trading System Version 9 Coming Soon!

It’s time for an upgrade!  I’ve alluded a few times in this blog, and the SnapTrader blog, that I am working on improving the MultiStage Trading System.  That’s an ongoing effort and will likely continue.  The latest revision (version 9) is a substantial upgrade.  It incorporates some new criteria for the development of signals, as well as a slight change to the exit rules.
Before I go into the changes, let me first share some of the results.  There are a few reasons why I like this version better.  First and foremost is risk management.  Version 9 incorporates a simple dynamic stop that protects us from the extreme downside.  I haven’t been shy about my concern with stops.  For the most part stops have always hurt us, both in returns risk management… until now.
The results show the benefit of the new system by trimming drawdowns, and improving risk/reward measures immensely.  For example, for the 2012 trading year compare the numbers below:
Version 8
Version 9
Max Drawdown (trade)
35.14%
28.21%
Sharpe Ratio
2.19
2.62
Ulcer Perf. Index
27.67
32.97
It’s pretty clear that we’ve improved the risk management, but what about performance.  I’ve added another row to the table with the total return for this year, through 11/26.
Version 8
Version 9
Max Drawdown (trade)
35.14%
28.21%
Sharpe Ratio
2.19
2.62
Ulcer Perf. Index
27.67
32.97
Net Profit%
59.51%
58.74%
Now, please don’t get silly and expect you can duplicate these returns.  There are many reasons why it’s virtually impossible to match them exactly, but I’m sure it’s easy to see why I much prefer this latest version to the trading system. There is very little difference in return, yet measurable risk improvements.
The signals for this new version will go live on 12/1/2012.

New Exit

All of these improvements come with a price.  It’s not required, but without using this new exit back-tested results are much closer to the version 8 results.  It’s a simple exit, but does require a daily look.  Here is the rule:
If the stock’s closing price is below the 200 day simple moving average, enter an order to exit on the open for the next day.
That’s it. It’s simple, but it does require you to assess this each day.  I find that the easiest way is to just click through my positions with the 200-day MA line on the chart.  If you have been following the system you will know that there are rarely more than a few positions, so this isn’t really a big time sink.  And again, it’s not required, but without it the improved results don’t test out.
Good Trading…

Thursday, November 1, 2012

October Trading System Results

Happy Halloween! It’s time for an October wrap-up the day after the biggest candy eating day of the year. 

Both statistical and implied volatility remained low, as it has been in the past few months. In fact, as I reported last month, volatility is about as low as it’s been in the past five years. This isn’t a bad thing, and in fact has been mostly good for that long buy-and-hold part of your portfolio, but it’s not the greatest for our trading system.

The MS8 system thrives on volatility, so when its slow, we don’t necessarily lose money, but it’s also not very active.  October had a nice little bump in volatility starting around the 19th, and in fact about 2/3 of our trades took place just after this.  Aside from that it was still pretty quiet.

Our overall exposure was about as low as I have seen, at just 9.35% (meaning that’s how much time we had cash in the market). Below are a few of the key statistics:

Net profit for the month 5.87%
Total number of trades 14
Average return per trade 2.54%
Win ratio 71.43%
Exposure 9.35%
Total time invested Less than 10 minutes a day!

Low volatility means fewer trades.  The average return per trade and win ration was just about typical for the system, so we just needed some more trips to the plate. As I said last month, we could really use some volatility! All in all, it’s hard to complain about a 5% month, however, and if I can do it with only 9% exposure it’s even better.

Good Trading…

Thursday, July 12, 2012

Out-of-sample Testing for the MultiStage Trading System

In the last post I talked about out-of-sample back-testing during trading system development.  As a follow-up I wanted to describe the different out-of-sample (OOS) tests I’ve used while developing the MultiStage Trading System.

I described basic OOS tests in my last post, which might consist of simply dividing test data into different date ranges.  In order to think about applying this to MSv8 (and other versions) it’s important to remember that this trading system has evolved over several years.  I’m currently on version 9, although v.8 is the current published version.

When I first started prototyping this idea I used a subset of the data I had, both by time, and by symbols.  Specifically, I started testing on the NAS100.  This symbol set seemed to reflect the volatility of the market better than the SP500, and it’s small size made it very quick to do optimizations. As far as time segmentation goes, much of the early development was done in 2007, and for a long time I used up to 2002 as my in-sample data. 

The early tests were straightforward out-of-sample tests.  I tested using data from 2003 to 2007, and used all of the symbols in the data base.  At that time I had only about 6000, but it’s since expanded to about 9000.  There was a little debugging to be done after this, so you have to be very careful not to change the way you are filtering data to remain bias-free.

Keeping in mind that OOS testing is really any testing that isn’t done on the original data set, that wasn’t the end of my OOS tests.  I wanted to trade real money, of course, but real money is, well… real money.  I’ve been developing trading systems for many years, and for many years prior to 2007, but I’m not about to part with my hard-earned money without some very cautious observation.  Consequently, my first use of the the MultiStage Trading System (version 1) was simply paper trading.  I traded in a sample account for a couple of months.  Then I started with VERY small position sizes.  In some cases just a few hundred dollars. 

Both paper trading, and these small “test” positions could both be viewed as further OOS testing.  But there’s more: This system has evolved over time.  Somewhere around mid-2008 v5 and then v6 were born.  In each case, I took the new versions and compared them with the old data.  Then I tested them on the OOS data, which was new since the publishing of the prior system.  Also, in each case I went back to the paper-trading model, and then the small position sizes before jumping in with both feet.  In 2009 v7 was developed, and in 2011 I began using v8.  In each case I followed this pattern.

At this point, there has been several forward-looking years of real-time, real-money trading activity, which pretty much puts to rest any concern of data-snooping or curve fitting.  The main point to see is that there are several different safeguards you can take during system development to be sure you are being objective with the data.

Good Trading…

Thursday, June 21, 2012

Evaluating Trading System Performance – Part 1

If you Google “Trading System”, or “Trading Signals” you will find an enormous number of websites with services allowing you to subscribe to the signals produced by their trading system.  I’m not opposed to that, of course, as it’s exactly what we do at CalculatedReturns.  And in fact, there are some of these services that are actually reputable and worthwhile.  A few (ahem…), even produce excellent real world returns. I have a pet peeve, however, around how some “less scrupulous” sites choose to demonstrate their performance.

Over the next several posts, I intend to expose the “sum of the trades” approach to performance results.  It just ain’t right! I promise not to be too harsh, as it’s not my objective to be defensive, or sling mud.  My real goal is just to educate those who might not be looking, about how to evaluate system performance for themselves.  Consequently, the names have been changed to protect the innocent.

Stay tuned for Part 2, and the “Sum of the trades SMACKDOWN”!

Good Trading…

Saturday, June 2, 2012

May 2012 Trading Results Wrap-up

As I write this, the market has just finished it’s biggest downturn in recent weeks.  Many investors are wondering where things will go, and the global economy, eclipsed by recent events in Greece and the broader Eurozone, is throwing up question marks right and left.  Investors don’t like question marks.

Regarding my own model, May was another average-ish month for the MS8 Trading System… in fact slightly below average.  Our overall exposure was just over 15% (meaning that’s how much time we were invested), and we ended the month mainly in cash.  That being said, a profit is a profit and this is still an excellent one.  Below are a few of the key statistics:

Net profit for the month 4.72%
Total number of trades 22
Average return per trade 1.45%
Win ratio 72.73%
Exposure 15.70%
Total time invested Less than 10 minutes a day!

There was one massively stinky trade in BVSN, which lost nearly 35% of it’s value.  Those are painful, but a trading system is a strategy that relies on the averages working out over the long haul.  Even with that ugly trade we still pulled out a nice profit. 

Below is a picture of the profit distribution of the individual trades.  This is a pretty typical distribution… well… except for that ugly one on the left.

ProfitDistMay2012

Good Trading…

Wednesday, May 2, 2012

Sample Trade from CalculatedReturns.com

+7.9% in one day!

Here's a short video showing a trade on POZN.  This trade triggered yesterday and was exited this morning.  It's not trying to communicate that all trades work out this way - they don't.  It's here to show  you what a winning trade looks like and how the price pattern often develops.  I mentally prepare myself for this, because it nearly always gets worse before it gets better.

Thursday, September 15, 2011

Incredible Day Trading System Results!!!

Over the past few weeks I’ve been playing around with the robotic trading system from Think Or Swim called Prodigio.  It’s actually a very cool system and promises to bring just about anyone into the inner circle of system trading.  It allows trading systems to be developed without any scripting or coding and then allows those same systems to be deployed on the Think Or Swim platform, making them fully automated… yes, it’s that cool.

It took me a little while to get familiar, but once I did I decided to tackle a trading system on a different time frame than my normal swing trading style.  High frequency day trading seemed logical, and it wasn’t too long before I had something that looked interesting… or so I thought.  The platform allows you to develop your system and then backtest it, even on intraday data. 

And now the results of the backtest…

What you see below is the equity curve for a simple mean-reversion system which trades on 5-minute bars.  It’s not a lot different than what I do on daily bars, but it’s done much more quickly.  Consequently, profits are smaller on each trade, but I can get MANY more trades.

equitycurve

As usual, this doesn’t account for commissions or slippage, yet at first glance looked really promising.  Just as I was about to start browsing www.YachtWorld.com, I saw something fishy.

And now the other shoe drops…

stats

Take a quick look at these statistics and see if you spot anything that doesn’t look right.  Get it?  Right, 11,264 profit dollars for more than 12,000 trades.  Average profit is less than $1 per trade.  And remember I didn’t include commissions or slippage.  At this point, that feeling of deep disappointment, and “I just wasted a lot of time”, came over me.  Doh! 

I entered 0.005 per share of commission (my rate), and ran the backtest… LOSER!  I tried a few fixes, but at this point I just don’t see how a retail trader can scalp stocks and make it work.  Anyone have any ideas?

Good Trading…

Thursday, September 1, 2011

Trading System Performance in September

September is upon us, and for many investors that means, “Put on your flack jacket!'”  September has been the most consistently poor performing months of all time.  I’m not here to write specifically about that, but I can point you to a number of great posts that have already done so:

Woodshedder’s blog on iBankCoin

Michael Stokes’ MarketSci blog

Rob Hanna at Quantifiable Edges

All of these guys have provided great data and evidence about the past stinky results of September, but I wanted to provide a view of what the past results of the MultiStage Trading System has done:

september

As you can see, the September MS results are nothing to write home about.  Some years September is worse, sometimes better than average; and overall, it’s about a typical month.  Naturally I don’t have any idea about what this year will produce, but in the past the increased volatility (as noted by Rob Hanna) has made up for the declining market.

Good Trading…

Friday, July 29, 2011

Updated MSv8 Backtest Results:

Yesterday I published some ridiculous and bogus numbers from what I thought was a valid backtest.  I mentioned at the time that I still had some validation, and I probably should not have posted them until I had done some more homework, but… well… I did.

In any case, they are not accurate.  Once I perform backtests I then validate results by performing walk-forward trade-by-trade testing.  After that I then trade them live in small sizes.  In my walk-forward testing I discovered something called “look-ahead bias”.  It was only in one small parameter, but it was enough to radically skew the results.  Look-ahead bias simply means that you are using data from the future… that which can’t be known at the time of the trade. 

I was using a volatility factor that was reading the data on the day of the trade.  Since the trade is done at the open, I can’t know any of the data for that day until after the day is over, and therefore after the trade is already on.  This is an easy thing to discover during validation, and it is now corrected.

The corrected results are still quite good, but not quite as ridiculous as before.

MS8

As you can see, there is still a lot of green, which means relatively consistent profits.  I like that. 

Just to be clear, testing and validation is still not complete.  I just felt like I needed to say something since I published the wrong results prior.  More to come on this.

Good Trading…

Thursday, July 28, 2011

MSv8 Backtest Results

A few days ago I mentioned that I was working on an update to the MultiStage Trading System that would provide more market exposure.  The current version is typically in the market only about 25% of the time, which means I spend a lot of time sitting on the sidelines when the market is moving.

This more recent enhancement provides looser tolerances under special circumstances and gives me far more market exposure… nearly 75%.  One of the fantastic developments, however, is that it also works in a very complimentary way to the old system. 

This is not unusual when you attack the criteria from a different perspective, but I have rarely seen it work out this nicely.

MS8

These are preliminary results and I still have a fair amount of validation to do, but I like it so far.  In the spirit of full disclosure, be aware that this contains no commissions or slippage.  Generally, I believe these numbers are unattainable for many reasons, but it’s the plethora of green that I’m enjoying at the moment. Consistency is one of the most sought after characteristics of any trading system, and this one delivers.

Good Trading…

Friday, July 15, 2011

In Search of Volatility

One the frustrations that I have voiced regarding the MultiStage Trading System is that I don’t have enough “exposure”.  I often go through long stretches without exposure to the market, and in all cash.  The good part about this is that I avoid some of the nasty reversals and market drops.  Cash can be a safe place at times.  At the same time, however, I miss out on many profitable moves.  In a system like this profits just trickle in. 

Don’t get me wrong, I’ve been trading this system (or some previous form of it) for years and I’m quite satisfied with the results.  But with average exposure at about 25% I always feel like I’m missing something.

As I’ve commented many times, my trading system thrives on volatility.  Some of the most profitable years are also the most volatile.  For example 2008, while awful for trend traders and most fundamental investors, was a banner year for this system.  The question I’ve been solving is, “What shall I do in less volatile times?” 

I have gone in search of volatility, thinking I might find volatile markets outside of equities that could replace typical equity trades.  The problem is I can’t predict volatility very well, and often by the time I get in, the move is over.  What to do?

Enter: MultiStage Trading System v8

I’ve been busily working away on a modification to the MultiStage Trading System that moves me in the right direction.  I am integrating a measure of volatility into the system and it will then modify candidate trades dynamically to take advantage of lower volatility conditions. 

This is a work in progress, but it looks promising and should increase market exposure.  Increasing exposure simply means more trades.  If you have a positive edge in the strategy, more trades = more profit.  Stay tuned for more details on the MSv8.

Good Trading…

Monday, July 11, 2011

Covering My Shorts…

No, this has nothing to do with my attire. 

The market made the expected downdraft and at this point I’ve covered just about all of my short positions. Since the Big Short post the S&P has pulled back about 20 points (about 1.5%), and taken most of the market with it.

As discussed in my last post, I only wish I had taken larger positions.  I had some nice short positions, but never got more than about 20% of my cash deployed.  Oh well, still a decent collection of profits for the amount at work… and in only two days.  I can’t complain.

Good Trading…

Saturday, July 2, 2011

The Big Short…

I don’t care how long you’ve been around watching the markets, this is getting unusual.

spx

The long green bars – five in a row – are a strange and welcome sight.  Definitely not something you see everyday.  Why so welcome?  Let me answer that question with a question (I know, I’m clever like that).  Do you really think we’ll see six in a row?  Seven?  How often does that happen?

There’s lots of research being done by a lot of smart people in QuantWorld that says we are due for a pullback.  Woodshedder, Rob at Quantifiable Edges, and Chris at My Simple Quant, to name just a few, have all published studies indicating we might expect a little downdraft. 

I don’t do a lot of one-off studies, simply because I don’t have time.  But I will say that my regular systems have me “shorter than a mouse hole”, as they say.  I’ve been accumulating shorts and will likely have more on Monday if that market trends up at all.  My only regret is that I don’t have enough invested and have too much in cash. 

This is NOT a recommendation of course… just an observation.

Good Trading…

Tuesday, June 14, 2011

Coming Soon: Leveraged ETFs

I recognize I’ve been a little more quiet than usual on the blog.  I’ve been spending some of my “blog time” on developing a new trading system, which I will soon be sharing some details about. Specifically, it’s designed for trading Leveraged ETFs.

Leveraged ETFs are a relatively new idea. They came on the scene about 4 years ago, and have expanded ever since.  These funds allow investors to have some of the benefits of ETFs, like broad diversification, while also achieving a magnified return.  Most of the high volume Leveraged ETFs seek to return double or triple the underlying ETF index.  For example, while SPY seeks to equal the returns of the SP500, SSO attempts to double that return.

I have liked the idea of a trading system based on ETFs for a long time.  But every system I’ve worked on indicates very stodgy returns compared to systems based on individual stocks.   The logical solution was to work with options, but that also seemed challenging, mainly because of the difficulty in placing limit orders, and the results were poor.

About two years ago I started playing around with systems based on Leveraged ETFs.  At the time it looked promising, but they were still relatively new, and many traded extremely low volume.  I’m convinced they are here to stay and now trade huge volumes in the most popular vehicles.  I’ve dusted off the system, given it a substantial tune up, and am ready to incorporate it into some trading models.  In upcoming posts I will share some of the backtested results.

Good Trading…

Tuesday, May 17, 2011

Drawdowns in Context

The MultiStage Trading System that informs my trading is currently in a state of drawdown. When this happens I always have to ask whether this is temporary, or if the system is failing. In order to do that I monitor several metrics to see if this drawdown looks like others that have occurred in the past, or if it is abnormal to some degree.

The other day Woodshedder posted a great note on one of the ways he monitors the health of his “Power Dip” system. I like the way he presented it, so I’ve replicated it here for the MultiStage system. It’s a fairly simple measure, looking at the 20-trade moving average of the system over time. I have been tracking this metric for a long time, as you can see on the far right column of the Daily Trade Log, but the chart makes it a little more clear.

WhatIsNormal

In this case I tested for about 12 years. As you can see, the 20-trade moving average fluctuates between 0 and +5.0% most of the time; but the extremes have reached –6.0% and +10% a few times. The current level is at about –3%, which is stretched, but well within extremes set during previous years.

I also track a longer term view, which shows the moving average of the past 50 trades. In this case the extremes are from about –2% to about +7%, with the current level (average of the last 50 trades) being about +1%.

50-day

One final note… The average return per trade over this period (when backtested) is about 3%. That is what makes the average return of –3% rather alarming, so putting this in context helps me rest a little easier.

Good Trading…