back start next


[start] [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19] [20] [21] [22] [23] [24] [25] [26] [27] [28] [29] [30] [31] [32] [33] [34] [35] [36] [37] [38] [39] [40] [41] [42] [43] [44] [45] [46] [47] [48] [49] [50] [51] [52] [53] [54] [55] [56] [57] [58] [59] [60] [61] [62] [63] [64] [65] [66] [67] [68] [69] [70] [71] [72] [73] [74] [75] [76] [77] [78] [79] [80] [81] [82] [83] [84] [85] [86] [87] [88] [89] [90] [91] [92] [93] [94] [95] [96] [97] [98] [99] [100] [101] [102] [103] [104] [105] [106] [107] [108] [109] [110] [111] [112] [113] [ 114 ] [115] [116] [117] [118] [119] [120] [121] [122] [123] [124] [125] [126] [127] [128] [129] [130] [131] [132] [133] [134] [135] [136] [137] [138] [139] [140] [141] [142] [143] [144] [145] [146] [147] [148] [149] [150]


114

Subjective knowledge is brought into the equation and the networks are used to capture that knowledge in a computerized form. In this way, the trader is brought into the loop.

Our preliminary efforts using this approach provided much better results than those we obtained when applying neural networks in more traditional manners to the same type of problem. Nets trained a lot more reliably, faster, and better, and generalized well with respect to the particular patterns they were trained to detect. If the pattern that was subjectively thought useful is really useful, then the system may be quite effective. If the pattern is not a useful one after all, the net may still generalize (i.e., it will always detect that pattern since it has learned to do so, and it will continue to detect it reliably into the future); its detection of that pattern will not necessarily be pre-dictively useful, but that is through no fault of the net, and the net is still useful in that now the pattern can be put to an objective test.

WHAT CAN GO WRONG?

If the approach does not work, two factors may be responsible for failure. The factors involve the accuracy of our observations of the patterns, and their predictive value. We may simply be wrong about these things.

One of the questions we are trying to answer is whether a neural network can detect a subjectively identified pattern when an experienced researcher is developing the system. If we can get a net to recognize a subjective pattern, at least we have made some statement about the usefulness of Al technology and about how one can go about detecting patterns that are hard to define in rules. Knowing that, if some patterns prove to be useless, we can sift through them with objective tests to find those that really work and are useful in trading.

Even if the patterns themselves are not predictively useful, we will have shown that a neural network can be trained to accurately detect a visually or subjectively recognized pattern consistently, which makes that pattern objectively testable without such factors as hindsight, which make backtesting by eye less reliable. So, even if the patterns themselves are not predictively useful, there is still the advance of having mechanized the detection system successfully.

Now that we have discussed how we came upon this approach, why we believe it is a feasible one, and what can go wrong, we will outline the exact methodology, apply it, and examine the results.

STEPS INVOLVED IN TRAINING NETWORKS

The intention is to get a neural network to emulate a trader who marks a chart for each occurrence of some specific pattern. We are going to carry through this procedure for a number of different kinds of patterns, the terminations of which can be identified and marked on a chart. We are going to build what we call "pattern detection components"; in this case, the components are networks trained using the KCAT



Describing the Patterns to the network

How do you describe a pattern to a neural network? This is a simple process, assuming that the right tools are available. You need a tool that can. generate charts (bar charts, candlestick charts, whatever your preference), and that can plot as many variables as desired (and you will probably want to plot some intermarket variables as well as price and other indicators); TradeStation® works quite well for this job (this is what we are using). In addition, we needed a capability to record the exact date and time anywhere one indicates or "clicks" on the chart. This capability is crucial and is one we have had to custom program (we call it "TradeMarker™"). One of the functions of Trade-Marker™ is to allow a user to mark the pattern that he or she wants the neural network to learn to recognize. For example, if we want to train a network to recognize a double-bottom pattern (Pattern X), we would take the following five steps:

1. Pull up a chart.

2. Go through the chart looking for the end of every instance of Pattern X and click on that end. Every time we click on an instance of Pattern X, TradeMarker™ will write to a file the date and time of the particular bar on which we clicked. We should point out that when you "click" to mark where the pattern ends on the chart, you should use some kind of objective determination of the patterns end (e.g., an end marker for the stochastic may be where it crosses its moving average); this will provide a standard end-point. Although the signal pattern that came before the mark will shift about a bit (e.g., some are longer, some are shorter), one part of the pattern will always be anchored in an objective way. After clicking on all instances of the pattern we could identify, we will have a "mark file," each line of which will contain a date and a time for a critical bar.

approach. The patterns are all based on subjective brain work, or outside analysis, so the person doing this needs to have some knowledge about the market being modeled, as well as some ability to recognize and mark specific patterns on charts. We are then going to use the components we develop to construct a full trading system. These are the basic steps of the KCAT approach:

1. Identify a number of potentially useful patterns.

2. Mark those patterns on a long chart to find as many instances of each pattern as possible.

3. Train a number of neural networks, each of which will be tasked to recognize one of the patterns identified.

4. Evaluate the networks to determine whether they can provide good pattern recognition capability.

5. If they can, then integrate those components (the networks) into a rule-based system that will use the information provided by the outputs of the networks to generate trading instructions.



3. Having prepared the mark file, it is now necessary to prepare what we call a "pseudo-fact file," which is the fact file that we are actually going to use. Rather than having real targets (consisting of whether or not there was a mark), it will have the date and time for each bar as two targets. To create this pseudo-fact file, TradeStation® code is set up so that it does all the input preprocessing and a file is written that contains the inputs, the date, and the time for each bar.

4. The next step is to locate on the pseudo-fact file the date and time of each pattern specified in the mark file. For every date and time successfully located, TradeMarker™ will insert a 1 as the new target (substituting that for the date and time); then, for every bar in the fact file where the pattern was not recognized (i.e., where there was no corresponding date and time in the mark file), it will insert a 0 as the new target. What we now have is a fact file with inputs and target, where the target is a 1 if the pattern was recognized (marked) at that bar, or 0 if the pattern was not recognized (not marked).

5. The neural network will then examine the inputs and determine whether there is a 1 or a 0 in the target, for example, whether it was judged as a pattern or not. It will attempt to learn to use the inputs to discriminate the presence or absence of the marked pattern. This is standard network training: We choose a training and testing sample, train on the training sample, then test the network on the out-of-sample testing data.

Assuming we have a network that accurately captures the subjectively detected and marked pattern, it is necessary to write some rules in TradeStation® which will make use of that network. If the network works fairly well, a typical rule for using the networks output to generate a trading signal might be written as follows:

If Value 1 > N threshold then Buy at Market.

Where Valuel is a value returned from the neural net. Here are some tips for using the KCAT approach:

• Make sure that you have indeed identified a recurrent market pattern.

• When marking the chart, be sure to mark the patterns in a consistent manner.

• The longer the data period over which you can generate the marks and the more marks you have, the better the results will be; too few marks provide less statistical stability.

• Keep the networks simple. Do not overoptimize.

APPLYING THE KCAT APPROACH

Our first step was to decide on a market. We wanted an end-of-day trading system for the S&P 500 that would hold trades for somewhere between 1 to 10 days, that would be highly profitable, and that would have a high percentage of winning trades.



[start] [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19] [20] [21] [22] [23] [24] [25] [26] [27] [28] [29] [30] [31] [32] [33] [34] [35] [36] [37] [38] [39] [40] [41] [42] [43] [44] [45] [46] [47] [48] [49] [50] [51] [52] [53] [54] [55] [56] [57] [58] [59] [60] [61] [62] [63] [64] [65] [66] [67] [68] [69] [70] [71] [72] [73] [74] [75] [76] [77] [78] [79] [80] [81] [82] [83] [84] [85] [86] [87] [88] [89] [90] [91] [92] [93] [94] [95] [96] [97] [98] [99] [100] [101] [102] [103] [104] [105] [106] [107] [108] [109] [110] [111] [112] [113] [ 114 ] [115] [116] [117] [118] [119] [120] [121] [122] [123] [124] [125] [126] [127] [128] [129] [130] [131] [132] [133] [134] [135] [136] [137] [138] [139] [140] [141] [142] [143] [144] [145] [146] [147] [148] [149] [150]