Tuesday, March 19, 2013

My experiment with Kelly money management

I've been experimenting with a Kelly-sized money management strategy for the last month. For most of my positions, I've been using 33% Kelly, which is ultra-aggressive. This meant that my position size ranged from 2.5% up to 10% per trade.
Most of my trades won and I made good, increasing my equity by 10% in a single month. However, one trade made me halt my experiment when I experienced a huge gap on Monday morning.

This was a trade made using pinbars on the weekly chart. The above chart shows a pinbar on the EURUSD that appeared a few weeks ago, and I went short on the break of the pinbar last week. The trade went against me by Friday's close, but it didn't hit my stop loss. I decided to keep the trade open over the weekend in the hope that price movement will "reset" itself on Monday and move downwards.
My hope was crystalised on Monday when price gapped significantly lower, hitting my profit target.
While my trade won, it raised a few critical issues:
1. My risk during this trade was around 10%. That's very high, but my Kelly formula suggested an optimal position size of over 30%. When I say that Kelly money management is ultra-aggressive, I really mean it. But as the trade initially went against me, I realised that trading even at 33% Kelly provides no scope for system failure.
Trading is all about risk management. The failure of a trading system is always a distinct possibility. If you don't account  for this, then this particular risk is unmanaged and you're not performing your duty as a trader. If I continually traded at 10% and lost five trades, half of my equity will be wiped before I begin to question my system.
However, even if you wipe out 50% of your equity, if you're trading a portfolio of systems using Kelly money management, you should regain your lost equity relatively quickly. That is the dilemma with Kelly, and why it is so tempting to use it.  
2. The gap over the weekend alerted me to another risk. While this particular gap favoured me, the opposite can also happen. Since this gap was huge, if it had went against me instead, I would've faced a 20% hit to my equity as price would've opened way beyond my stop loss.
Keeping trades open over the weekend is another form of unmanaged risk. Supposing you're long on the NZDUSD and a tsunami wipes out New Zealand during the weekend, you'll have no ability to escape your position until Monday, when price will most likely gap down significantly.
All this points to decreasing my position size. I really enjoyed trading at 33% Kelly. Even when I occasionally lost, I still felt good, because it seemed like I was heading somewhere quickly and decisively. My wins made a difference.
At this stage I'm reducing my position size back to a level 2% for all my systems. It's boring, but it'll allow me to detect failing systems and survive, as well as manage my risk over the weekend (losing 4% from a gap is much more managable than 20%) .

Sunday, March 17, 2013

Wednesday breakout - USDCAD

I've spent this week analysing a possible "Wednesday breakout" system on the USDCAD.
I've a suspicion that price generally moves cyclically throughout the five day week.
My logic is this - as Monday and Tuesday pass by, stops from intra-week traders accumulate outside the Monday-Tuesday range. Wednesday presents a good day to take out those stops.
This is quite a vague logic to begin with. I chose a random pair to backtest, the USDCAD, and analysed the break of the Tuesday high or low, in favour of the trend. We use RSI(14) to measure the trend. If it's above 50, we go long on the break of the Tuesday high. And similarly, if RSI is below 50, we go short on the break of Tuesday's low.

My stop loss was 0.75 * ATR(14).
The backtest involved 300 sample trades from 2001 to mid-2012. The optimal reward-to-risk was 0.67-to-1. This provided a profit factor 1.16, which is quite low, but compensated by the relatively high frequency of trades (2.5 trades per month).
The equity curve at 2% risk per trade is below...

The curve isn't bad. While experimenting with OpenOffice I figured out how to calculate and graph linear regression (R^2). Generally you'll want R^2 to be as close to 1 as possible. In this case, our linear regresson is 0.83. I don't know if this is good enough for an equity curve as I'm still doing research on this topic. From my current level of knowledge and experience, though, this looks tradable.

I will focus on the AUDUSD next.

It's interesting to see the different ways of determining entries. In this case, we're using time rather than price action or candlestick patterns.

Tuesday, March 12, 2013

Learnt a few lessons today

Today's been quite extraordinary. I could've made an enormous sum of money on four winning trades, but only walked away with one.
Lost Opportunity #1 and #2: USDJPY
This was completely my fault. When I decided to wake up and check the market at 6.45am (local time), I saw a beautiful low volatility candle on the USDJPY chart.

Unfortunatelly, the start of the new market day occured at 6am, and the top of the low volatility candle was broken within minutes. Therefore I missed out on a beautiful long entry (I normally trade these candles with with 0.5:1 reward:risk).
Dejected, I totally ignored the possibility of the market reversing, and neglected to put in a pending short just in case price broke the low of yesterday's candle. And guess what? It did, and again would've won with a 0.5:1 reward:risk.
Lost Opportunity #3: XAUUSD
This "lost opportunity" wasn't completely my fault. In fact, some news must've came out, causing gold to spike in a minute. At first I thought I must've entered an incorrect entry price for my pending long, since it was filled just before my take-profit target. This resulted in an absurd reward:risk of 1:100 or so. My trade closed in profit within a short time, and I tried to figure out why my order was filled so late. Did I commit a typo with my order? Looking at the 1M chart, I saw massive volatility.

I've suffered a bad case of "slippage", when there is a significant difference between desired price and executed price for an order. Some slippage can be positive. For example, I may sell a currency pair during a volatile bull run, and my executed price is higher than the sell price I entered (so basically I sold at a higher price than I intended). In normal trading, however, most forms of slippage are negative, and you'll normally encounter them during volatile or illiquid periods.
There wasn't much I could do. However, I did learn to take a screenshot of your order before it is triggered. That way you can be sure about your order's details. For awhile I thought I made a typo until I zoomed into the 1M chart and saw the spike. Screenshots will also help you with any future disputes with your broker. It's something to keep in mind.
So yeah. Lots of opportunities went begging today. I must keep to my trading schedule and dutifully check the market at the start of every new day, no matter how tired I may feel.

Friday, March 8, 2013

My results from trading six months live...

Wow, February, where did you go!?

I just realised that it's March, and it's been a little over six months since I (re-)started trading live.
My current broker is Pepperstone. Below you'll see screenshots of the two accounts that I've opened with Pepperstone and traded live for the last six months. (the only reason for opening the second account was to earn a small rebate from transaction fees via the Aslan Group. You'll find more details on the Pepperstone webite - pepperstone.com)

Account #1 (now closed)

Account #2 (current)

In terms of equity growth, I am up a little over 13% since ineption back in August 2012.
How do I think I'm going at the moment? For a first-year trader, I think I'm doing pretty good. My profit factor is actually a little above what I expected from my trading systems, but the sample size is also very small (41) so variance can be expected.
I would like to post my equity curve but unfortunatelly the one provided by MT4 mixes profits and losses with deposits and withdrawals, so it's not a true representation of my performance.
I hope the above results put my blog and thoughts into context.

Thursday, March 7, 2013

Venturing into the brave new world of limit orders...

So I've spent the last week designing a new system on the daily timeframe. I'm still focusing on the pinbar candle pattern. While most price action traders enter their trades on the break of the short-wick end, I've been testing entering limit orders on the break of the long wick. My belief is that the tip of the long wick represents short-term support / resistance. If price hits this area the next day, I believe that price will be smacked back again, and this will make an ideal place to trade against the market. (this builds on my previous post about my recent system design "failure". It gave me the idea of trading limit orders at the break of the long wick).

If you're a contrarian, you'll be familiar with limit orders. If price is moving up and your limit order is triggered, you're going short. And likewise, if price is moving down and your limit order is triggered, you're going long.
From my backtesting so far, it's very difficult to win enough trades with small reward-to-risk to be profitable. Short-term momentum will almost always be against you. However, it is looking very profitable with reward-to-risk ratios over 2:1, trading with the trend. I've tested the GBPUSD, AUDUSD and USDJPY from 2001-2012 so far and my profit factor is around 1.54 from a little over 100 trades. I still have eight currency pairs left to test, but at this stage I'm pretty confident that this system will work.

Friday, March 1, 2013

Autopsy of a rejected trading system

Today I decided to reject the trading system that I've been working on for the last few weeks.
These days I don't feel bad if a potential trading system hits a deadend. Even though it appears that you have nothing to show for your efforts, your understanding of the market only increases.
What made me hopeful for this particular system was the final profit factor that I had calculated, which was 1.16. The backtest and optimisation ultimately involved a little over 400 trades. Both the profit factor and sample size were low, but I was prepared to accept them. I intended to trade this system within a portfolio and let diversification minimise any weakness.
Anyway, the results looked good enough on paper. A profit factor of 1.16 suggested that this system was tradable, at least at first glance.
I then decided to graph the system's equity curve from 2001 to 2012. The result (at 2% risk per trade):


To me, that is one ugly equity "curve". Not only is there massive drawdown in the first five years, but the upside moves are sporadic and extreme. This suggests that the system is very sensitive to market conditions, and not really robust. The system flatlines in the last three to four years.
So while the system looks marginally tradable on paper with a positive profit factor, its equity curve demonstrates a lack of robustness and consistency, leading me to reject the system.

The lessons I learned...


The system is based on the pinbar candlestick pattern. Traditionally, the pinbar is traded on the break of the short wick. However, I wanted to test the break of the long wick to see what would happen.

While a positive profit factor suggests that you will make money, the results suggest strong sensitivity to market conditions. Quite often you'll find pinbar formations at support and resistance levels. If you trade the break of the long wick, you're trading INTO support and resistance. The overall result suggest that trading pinbars this way isn't recommended, at least with my skills.
Multiple signals on the same day
Interestingly, I also decided to examine how the system fared if I only traded pinbars that appeared on multiple pairs on the same day. If I only traded multiple same-day signals, my profit factor ended up being 1.3! A significant improvement. Trading solitary signals gave me a profit factor of 1.1.
This would make sense. If you're seeing the same entry signal on multiple pairs, each signal reinforces the other and you have a type of confluence. A solitary signal on a single pair, however, is less meaningful.
However, while there is a significant improvement in profit factor, the equity curve still looked ugly. Additionally the sample size became far too low to warrant trading (around 100).
I just wanted to share my thoughts on my findings. Failure isn't failure if you can salvage something from your efforts.