Combining Signals with Trade

The Trade documentation is rather sketchy. Most of the following is from Bruce Robinson at the Ft-Talk board, and my own observations.

What is a signal file?

A signal file is just a text file listing buys and sells. You can see what one looks like by clicking here. In order for Fasttrack and related programs to recognize a signal file, it must be stored in /FT/SIG.

What is a Signal in Trade?

A signal is considered an event, and produces a state until there is another event.

Consider a signal that says to buy when RSI >50, and sell when RSI <= 50. Whenever RSI goes above 50, this will trigger a buy event, and the signal will go into a buy state. When RSI goes to 50 or below, a sell event happens, and the signal goes into a sell state. This signal is unambiguous

Now consider a signal that says to buy when RSI>50, and sell when RSI< 55. When RSI goes above 50, a buy event occurs, and the buy state will continue until RSI goes below 55, at which time a sell event occurs. Now let us suppose that we have the improbable case where the RSI of a fund goes above 50, then up to 75, and then drops to 52. This will generate a sell event. Suppose that the RSI stays between 50 and 55 for the next year (well, I said it was improbable). Given the nature of the RSI indicator, this would be a very nice thing, and the fund would be generating good profits. But there has been nothing to trigger another buy event - RSI would have to go below 50 and then come back up to generate a buy. Such a signal would be locked out. Not a good thing, and such a signal should be viewed as ambiguous.

Multiple ambiguity can be generated when signals are combined in Trade. On the other hand, powerful results can be achieved. You just have to pay attention.

There are two ways to combine signals using Trade: Using the And and Or functions, and using the Vector function.

Using the And and Or Functions

We tend to think of And and Or as Boolean functions, but Trade does something different. Again, a Signal generates an event.

The And of Two Signals

If X is Y And Z, you are asking for X to go into a buy state when Y and Z have each gone into a buy state. X will not go into a sell state until both Y and Z go into a sell state. This means that once X goes on a buy, Y can go on a sell but X will not go on a sell until Z goes on a sell.

The Or of Two Signals

If X is Y Or Z, then the most recent state of X is the most recent state to which Y or Z have changed. So as soon as Y goes on a buy, X will go on a buy even if Z is on a sell. If Z then goes on a buy, X stays on a buy. But whenever Y or Z then goes on a sell, then X goes on a sell. This really amounts to taking the most recent state change of Y or Z and applying to to X.

Using the Vector Function

Trace produces a Vector function which converts a Signal into a Vector. For each day when the Signal is on a buy, the value of the vector for that day is .5. When the signal is on a sell, the value is -.5. You can take the Vector of two or more signals and add them together. If you add the Vectors of two signals, the possible values of the result are 1 when both are on a buy, 0 when one is on a buy but the other is on a sell, and -1 when they are both on a sell.

This particular vector provides numerical representation of a 3-state situation: both on buy, both on sell, and the signals in disagreement. You might decide that the best course of action would be to be in the market when both are on a buy, short when both are on a sell, and in cash when the signals disagree. Unfortunately, neither FastBreak nor Trade support a 3-state timing model. I may be working on such a model in the future, but backtesting such a thing with the current tools is not easy.

[ Top ] [ Introduction ] [ Trading Systems ] [ Timing ] [Selection ] [Examples ] [ Common Sense ] [ Statistical Noise ] [ Mechanical Hibernation ] [Best Ever ] [ LTBH Results ] [ Beat Market ]

[ Technical Voodoo? ] [ Charts Do Not Lie ] [ Bad Advice ] [ Analysts ] [ Gamblers, etc. ] [ Relax ] [Fund List ] [ Links ]