Showing posts with label optimisation. Show all posts
Showing posts with label optimisation. Show all posts

Monday, December 31, 2012

Presenting my brand spanking new "Daikoku" trading system

I've been quietly working on this trading system for a few weeks now. My first-round backtesting was finished today and the system is looking very profitable.
 
It's a low volatility breakout system, based on the weekly timeframe.
 
My backtest details:
 
Years tested: 2001 to mid 2012
Pairs tested: EURUSD, USDJPY, GBPUSD, AUDUSD, USDCAD, USDCHF, EURJPY, NZDUSD, GBPJPY, AUDJPY, NZDJPY
Timeframe: 1W
 
Sample trades collected: 403
Profit factor: 2.49
 
There are no indicators involved. I initially backtested using ATR to measure volatility, but didn't find it useful in this timeframe. I then merely measured changes in volatility by comparing the current week's range with the previous week. If it's less than 50%, we have an entry signal.
 
We look for entry signals over the weekend after the trading week is over. We then place pending orders that will last for all of next week.
 
Entry signal: At the close of the week, the week's range must be less than 50% of last week's range. On Monday morning when the markets open, we place a pending long at the high of the week + 1 pip, and a pending short on the low of the week - 1 pip. The orders should be set to expire at the end of next week.
 
Stop loss: If going long, the low of the week - 1 pip. If going short, the high of the week + 1 pip.
 
Take profit: 25% of your stop loss
 
Some people may raise their eye brows at the level of the take-profit. At this level, our reward-to-risk is 0.25:1, which is a little unconventional. But I cannot deny my backtest results. This is one of the best R:R ratios to use. All R:R ratios are profitable, but 0.25:1 R:R almost maximises my profit factor, up to 2.49, which I think is very good for a mechanical system with little optimisation.
 
Here's a graphical example of a trade:

 
 
Everything about this system is preliminary at the moment. I would like to further optimise but even at this stage, the system is tradable. My main concern is the relatively small sample size of 400 trades, although it has been tested 10+ years across all the majors and Yen crosses. The high profit factor makes this alluring.

Thursday, December 6, 2012

Optimisation and simultaneous entry signals

One thing I noticed in my optimisation is the occurence of simultaneous entry signals.
 
Depending on your system, trading simultaneous entry signals may improve or detract the profitability of your system. If it does improve profitability, it can be problematic if you don't adjust your % risk per trade.
 
For example, suppose the current day ends and you see five juicy entry signals on different pairs eg. EURUSD, USDJPY, AUDUSD, NZDUSD, XAUUSD. Your backtest shows that it is favourable to trade every entry signal on the market. If we risk 2% of our equity per trade, we will end up risking 10% altogether if we take all five entry signals. Because we can expect some moderate correlation between all pairs, trading simultaneous signals usually ends up as an "either or" affair. We usually either win or lose all trades.
 
10% risk is high. Is there a way of being to trade all entry signals without excessive risk?
 
Here are our options...
 
Option 1 - Continue with the status quo and stack on the risk
 
We typically risk 2% equity per trade. If we see five entry signals, we trade all five and risk a total of 10% equity. If we see ten entry signals, we risk a total of 20% equity etc.
 
Option 2 - Split the risk among the trades
 
If we typically risk 2% per trade and see five entry signals, we may split that 2% among the five trades. In this case, we will risk 0.4% equity per trade.
 
Option 3 - Reduce our risk in general, stack on the risk when multiple entry signals appear
 
This is much more system-specific. If your backtest shows significant improvement in profitability when trading multiple simultaneous signals, wouldn't it make more sense to reduce your risk when you have a solitary entry signal? That way, should multiple signals appear, we can stack on the risk without it being too excessive.
 
Suppose we reduce our risk per trade to 1% when trading a solitary entry signal. Should five entry signals appear simultaneously, we can stack on this reduced level of risk. In this case, we will risk a total of 5% equity for these trades. While 5% risk is high, it isn't insanely high.
 
Option 4 - only trade the pair with the highest expectancy
 
Of the five pairs signalling an entry (EURUSD, USDJPY, AUDUSD, NZDUSD, XAUUSD), your backtest shows that the EURUSD has the highest expectancy. We may decide to trade the EURUSD only and ignore the rest.
 
My thoughts
 
There is obviously no "right" answer, although there are wrong answers. Blindly stacking on risk is a sure-fire way of busting your account when the stars align and the gods conspire against you in the perfect nightmare trade.
 
However, if there is a significant improvement in profitability from simultaneous entry signals, we want to make the most of this. Another way of looking at it is that we may see a decrease in profitability with solitary signals, hence we should risk smaller during these situations. When multiple signals appear, we ramp up the risk, but not too much. Some variant of Option 3 may be ideal, with perhaps a total risk limit of 5% or some other value.
 
Option 4 is straightforward. We trade as normal, but when multiple signals appear, we cherry-pick the best pair to trade from our backtest results. The danger stems from curve-fitting, although if our system is robust, this shouldn't be a real problem and we'll approach a result similar to our backtest.
 

Wednesday, December 5, 2012

Optimisation of Hermes

My optimisation of my "Hermes" low-volatility breakout system is proving to be very messy.
 
The trouble with optimisation is that you can take it in any direction. At the moment I added an RSI filter to check how the sytem performs when going with and against the trend.
 
There is a noticable improvement in profit factor when trading with the trend. I have also noticed that the system performs best against the trend if I use a Reward:Risk ratio greater than 2, while trading with the trend performs best with a Reward:risk ratio of less than 2.
 
I suppose this makes sense. If you are trading with the trend, the likelihood of running into the end of the trend is relatively high. On the otherhand, if you trade against the trend and the trend-reversal is strong, it can turn into a new trend and you succeeded in catching the beginning of this trend. This would explain the bigger pay-off if trading with a larger reward:risk ratio.
 
With that in mind, I have also noticed other behaviour that can be used to "optimise" my system further. For example, I have noticed that trades perform better when you have a multitude of entry signals on the same day. I guess the entry signals on different pairs reinforce each other. Trading only on days with multiple signals may improve my profit factor, but at what point does it end being an exercise in optimisation, and the start of curve-fitting?
 
To be safe, I may stick with one level of filtering only. I also feel that I'm getting sidetracked. Mechanical systems are not intended to be perfect. They should be "rough but ready", and ideally deployed as part of a portfolio of independent trading systems. To win mechanically, you should trade with a low risk per trade, and let high frequency and exponential growth do the heavy lifting. To do this, though, you'll need more systems to trade with. I'll return my attention to system development.