Thursday 2 July 2015

Trading targets

There are many ways to approach trading as a machine learning problem. Most people start with the idea of a rolling forecast of the market. The simplest and perhaps most natural idea is to attempt to predict the move of the market over a specific time (or other defined interval). A variant of this, permitting the powerful range of classification tools, is to merely try to predict the direction of the market. A more sophisticated idea is to predict some linear transform of future prices (for example a moving average or exponential moving average. One advantage of linearity here is that it corresponds (at least in principle) to an exit strategy. A refinement to all of these ideas is to also predict the uncertainty on the predictions, which is very useful for making decisions.

While all of these are feasible (if non-trivial) and potentially profitable, they fail to take into account one aspect of trading, which is that we only really need occasional useful knowledge: being ignorant of what the market is likely to do next most of the time is not only the norm, it is ok.

With this in mind, the idea is to instead focus on ideal trading opportunities as the thing we try to predict, and to design a system to attempt to say how similar to an ideal opportunity a particular market is.

With hindsight, the idea trading opportunity is when price never turns against a trade and that trade achieves some target. Moreover, this can be refined further by noting that we can ignore entries which occur during an earlier trade.

Ignoring the subtle point of perfect tests of a price, this leaves us with the idea of identifying major extremes of a market, where price has moved up at least a certain amount before and moves down at least the same amount afterwards. Between such extremes we have our historical ideal trades. This is what we can use as our class of positive examples for training a machine learning tool for classification.

Such a view of historical price action - extremes associated with a specific price scale R - is closely related to the range charts used by some technical traders. It is also related to the idea of a trailing stop.

One important aspect is that the ratio of the sizes of the moves to R indicates the trend strength in a particular direction. Where the ratios are high in one direction, the trend is clearly in that direction. The ratio of the average moves in the two directions gives a measure of strength of a trend which has a similar interpretation on different scales R (although for a specific market, the ratios vary with R). Where the moves are a sizeable multiple of the scale R in both directions, the market is rangy in a way which is potentially profitable on the chosen scale. Where it is low in both directions, the scale is inappropriate for trading.

In the above, "high" can be defined as  "significantly above 2" for the simple reason that a trailing stop is profitable if the average move is at least twice the size of the trailing stop. In a trend, one direction can have ratios significantly above 2 and the other can have ratios significantly below 2, which is a time we ideally only want to be trading in one direction on that particular scale R.

It is possible for the situation to be quite different on different scales: for example a rangy market can be trending on lower or higher scales and vice versa. With this single concept, all these things can be methodically quantified.

No comments:

Post a Comment