Tuesday, January 29, 2013

Creating a trading System X -- Trend trading




As we have seen in prior posts, the quality of your trades are highly correlated with trend strength. The weaker the trend, the poorer your results. It should be fairly obvious that an average trader can make money in a strong trend by trading with-trend while only an extremely experienced and skilled trader can make money in a trendless or weakly trending market.

Every trader has his own volatility floor (requirement) below which trading is unprofitable for him personally. An advanced trader will have a lower volatility floor and newer traders will probably lose even in ideal volatility conditions. There is possibly also an upper limit to volatility beyond which trades with reasonable stops will stop being profitable.

Recognizing when the market is in a trend and only taking with-trend setups on clear signals is a viable trading plan. This requires that the trader needs to recognize trend starts and terminations and only place trades during the trend. Psychologically, he needs to be able to recognize trend terminations and then be able to step away.

For example, today a trend started with b4 and possibly with b1 itself. The trend broke with a sustained move beyond the trendline and ema down to b46. You would need to ignore both long and short signals from this point on.

Every long setup from b1 to b37 on any decent setup bar (b3,b19,b28,b34) was a success. b16 and b32 were dojis and are not setups. Purely from a bar perspective, b7 was a failed long signal. (In the coming posts, we discuss why those are not setups.)

So what happens if you only take setups with-trend and only when a trend is in force? Is this a sustainable trading plan? Preliminary results seem to suggest so. However, note that data needs to be collected for a full year before any claim is considered proven. Lucky streaks are fairly common and a three week period is usually insufficient. Note that on some of the days below, results contain trades not purely from trends.


Friday, January 25, 2013

Creating a trading system IX -- The best setups







One of the simplest ways to drastically improve your performance is to trade with-trend only. Your ability to identify a trend early and enter with it is far more important than your entry type, trade management or trading style. Why is this so? The ability to sit through a trade that quickly moves in your favor and stays in your favor is far higher than a trade that gives you heat.

That is to say, you are more likely to apply your trade and risk management rules when not under stress. A great setup therefore, is the one that you are most likely to execute well. Even skilled and experienced traders may be forced into errors of judgement when their trade takes heat.

How do you choose good setups? Good setups are primarily those that have a very small Maximum Adverse Excursion (MAE). In the chart above, the best trades had very small MAE. A pleasant side effect of setups with small MAE is that you only need a small stop. If it takes out your small stop, its unlikely to make a large move.

The setups do not have to be purely stop entries. For example, b6 was the first bull bar and the first bar to close against a strong down move and is an attractive fade entry. It gave 0t MAE, i.e. did not tick against the trade even by a single tick.

However, from a predictability point of view, most sustained and large moves usually take off from bars with a strong close and are appropriate for stop entries (b11,37,46). Naturally, a strong close does not guarantee a large move all on its own (b27, b31), so we would need to refine our criteria further.


Friday, January 18, 2013

Creating a trading system VIII - Fading overlaps in chop

Fading Overlaps


As we saw in a recent post, with-trend trades work a lot better than counter-trend trades or trades when there is no trend. If the counter-trend trades and trades in chop are likely to fail, can we just simply fade those trades? Instead of buying a breakout of a bull bar in a down move, can we not just sell its close?

Such a system would simply fade overlaps as illustrated in today's trading. The win-rate in fading overlaps is usually a lot worse than scalping bars with-trend. The reason is simple. You never know how far exactly the price will move before the overlap pulls back.

Lets survey the trades we took today and their results:

Trade 1: b4 is a bull bar in a down move and an overlap. Sell its close (loss -11t due to 1t slippage)

Trade 2: Sell the high of b1 since a move above it would overlap a range. (-10t)

Trade 3: Sell the high of the bar (b7) that overlapped the range (+20t)

Trade 4: Sell the close of b15 since it overlapped a range (and few bars) (+15t)

Trade 5: Buy the low of b15, the OL (-10t)

Trade 6: Sell the high of b20, a counter-trend OL (+13t)

Although we did end the day up, its simply because our wins were larger than our stop. If our targets were smaller than our stops, this would be a negative day. The first lesson is determining stops and targets is that your target should always be larger than your stop for you to be profitable even with a modest win rate.

The second lesson we learn is that a trend can breakout and foil your fades. A trend development may be subtle enough that you dont notice it. Note that at trade 5, there was no obvious trend down, and once a trend sets in, only with-trend trades are likely to succeed.

The most important point about fading overlaps is that you need to be an extremely highly skilled trader to consistently extract value from the market. This is because unlike a bar scalp, your expected profit is smaller and your win rate is lower.

In hindsight, it would seem obvious that you could easily fade every bar from b47 to b55 but in real time, there is no way of telling how long the overlapping pattern would last. The skill needed to correctly infer a fade of b54 but not b56 would take years to master.

Wednesday, January 16, 2013

Creating a trading system VII - Scalping





As we saw in a prior post, tick scalping can have a very high success rate, but is unsuitable to extract most of the value from the market. An alternative is to scalp a bar by entering on its breakout and exiting on the close. For simplicity, any potential signal bar with a close near one end of the bar suffices and we treat inside and outside bars as signal bars.

The idea is that a strong close is likely to give a large entry bar and we try to capture most of the move of the entry bar and exit on its close. Sometimes the entry bar is weak but is followed by another signal bar (b3 followed by b4) or is followed by a breakout bar (b24 followed by b25), therefore it makes sense to hold for a follow through bar after the entry bar and exit on its close.

When the follow through bar is another signal in the same direction, we do not need to exit and re-enter. Therefore, b15 long would not be exited on b17 close since you would have to buy b17 right after.

As you can see from the results, long trades worked very well and short trades failed. At this point, we see the concept of trend. The strength of a trade is tied to the strength of the trend. With the trend, almost any trade works and counter to the trend, almost any trend fails.

Using this technique, we can extract a lot more value from the market. We can develop this style to improve win-rate and value extracted from the market.

Wednesday, January 9, 2013

Creating a trading system VI - Stops, targets and winrate

Tick Scalping


The above shows results of a 10t stop vs 1t profit. Entry is above any bar thats a potential signal bar regardless of color. If the bar triggers very quickly after signal bar closes and before a stop limit entry can be placed, we can place a limit order at the trigger price.

Profit target is +1t, risk is 10t. A 3t move beyond signal bar is sufficient to fill the target unless there is slippage, in which it takes a few more (trade #7; below b13).

Clearly, its very simple to get a high win rate. The larger your stop in comparison to your target, the higher your chances of a successful trade. However, such an approach has a few drawbacks


  1. Your theoretical maximum profit is limited to bars per day minus one ticks. Practically speaking, your maximum profit is probably around half the number of bars per day.
  2. Although your win rate is high, a 1tf or 2tf usually means your 10 prior wins will be wiped out. This gives a very severe drawdown potential, one you may not be able to stomach.
  3. Results may be inconsistent. You may have a day with 30t profit on a choppy day or a 30t loss.
  4. A large portion of your winnings go towards commissions.
  5. This is a very inefficient system to squeeze profit out of the markets. By taking only a tick profit out of a 70t+ move (trade #7), you give up the biggest moves in a chart.
However, this is a great way to experimentally determine the desired stop for large moves in a new instrument. For example, the large move triggered off b17 (trade #7) had a maximum adverse move of 2t. By collecting the adverse move against a large set of trades, you can determine a reasonable stop for large moves, i.e. if 80% of large moves have a MAE of less than 5t, then you could use 5t as a stop size.

But why can't you simply use 10t since its never been violated today? The reason is simple. Today, we only had 1t target. If we every plan to take a large profit target, our stop may have been hit on at least the first two trades today. A 10t stop would set us back twice the amount of a 5t stop. Until we can accurately pick out the large moves successfully, a smaller stop will protect our account better. 

One day's MAE is insufficient data to determine a reasonable stop. We would need to trade in all kinds of markets, fast and slow, news, large and small bars, choppy and sharp trends and so on. A one year data is probably good enough. However, after 40 samples, the chances of a dramatic result shift are unlikely and we can start using our provisional MAE +1t as a stop. 



Monday, January 7, 2013

Creating a trading system V - A mathematical model



Random walk theory considers all of market action as random movement, bereft of any tradable patterns. All apparent patterns are mere illusions and are unusable.

Traders over the decades have rejected random walk simply by empirical evidence, since recognizable patterns do show up on every chart and every time frame. 

A set of related patterns that composed of themselves on a smaller scale are called fractals and the individual patterns are called self-affine functions. Fractals are extensively used to model mountains, trees and other entities in nature (for example in animations and video games). 

It is my hypothesis that human behavior, specially crowd behavior causes market effects that are fractal in nature. Each move however, is weighted randomly just like every branch of a tree is of random length (In fact, this is how trees are modeled). 

A trading model therefore consists of three parts. 
  1. A pattern recognition model that recognizes and predicts the next likely set of patterns 
  2. A risk management part that evaluates if the predicted patterns are worth trading.
  3. Trade management: Exiting at target, scratching or stop out

For example:
Pattern recognition: at b29, we had a possible 2L pb to the trendline and ema with a weak signal bar. The possible patterns were a strong continuation of the prior up move or a failure of a second attempt to go up, which would result in a move down. Its important to note that even if the pattern plays out, it may never reach your profit target. i.e. correctly predicting the next pattern is not a guarantee of successful trade, esp when the bars are small.

Risk management: An inside bar setup with an entry side tail is a weak setup. Chances are the move up will fail and give another push down. However, since the move so far has been strong, we may want to take a reduced size (1 contract) in order to get part of a potential large move up. At b31, we have a weak follow-through and arrest of the move at the bear trendline. The best option is to scratch out and take a reverse position. Risk in general needs to be arrived at before placing the trade. Once the trade is placed, the risk should not be changed. This is important for achieving consistency.

Trade Management: An immediate profit of 10t and a second profit at 20t lets us place the last contract at breakeven vs possibly getting 100t if the market takes us beyond LOD. 

Today we netted 31t overall with arbitrary entries (not setups). I have extensively detailed patterns on ES. CL is no different. In the coming days, we shall see how to optimize stops and other risk management and also work on trade management. Due to the nature of experimentation, many failed trades are needed to gather sufficient data to arrive at the optimal stop size.