June 8, 2015
|
|
by Marge Sherald, President
|
There are times when a short spike in volatility can work against a reliable trading system. For example, if you have a Long Entry rule of MOMENTUM > 0, your trading system might be cranking out profit most of the time in a trending market, but a one or two bar downturn caused by someone selling a large amount of stock to pay for his/her new yacht might cause you to exit a trade when there is still an overall uptrend in place. You can prevent this by adding more rules using the Boolean AND conditions below to your original Long Entry rule: Momentum (close, 5 periods) > 0 AND Momentum (1 period lag of close, 5 periods) > 0 AND Momentum (2 period lag of close, 5 periods) > 0 etc. A technique you can use to get around this problem and to save time is to create a simple moving average of the entire rule. Since the output of a rule such as Momentum > 0 is either a 1 for true or a 0 for false, the average of three rules that produce a 1 is the value 1. If only one of the three rules is true, the output is 0.33. You can either select a threshold value or let the optimizer find it. By using a three period simple moving average, you are essentially creating the Boolean AND conditions stated above. Of course you can add more conditions by increasing the size of the moving average. In the Long Entry tab below, we also added a separate rule for the original condition to insure that the condition remains true on the current bar when a buy decision is being considered.
We created a chart that uses this technique and the results are shown below. For the Long Exit rule we used the condition of the number of periods since entry activated and we added a reverse of the original momentum rule. We let the optimizer decide whether to use either rule or a combination of the two. In addition to optimizing the number of periods to average the rule (thus adding lags to your logic), you can optimize the threshold value for the buy decision. The higher the value of the threshold, the stronger in agreement are the trading rules for the current period and any number of lagged copies of the rules found by the optimizer. If the trading systems you develop are not trading often enough, you can switch to a smaller bar size or a different type of bars such as range bars. You can download a copy of this chart by clicking here . |