Tests Of Divergence Models

Fibo Quantum Scalper Magic

Forex Scalping Strategies

Get Instant Access

Tests 13 through 21 examine divergences with the Stochastic oscillator, the RSI, and the MACD. Divergence is a concept used by technical traders to describe something easily perceived on a chart but hard to precisely define and detect algo-rithmically. Figure 7-l shows examples of divergence. Divergence occurs when, e.g., the market forms a lower valley, while the oscillator forms a higher valley of a pair of valleys, indicating a buy condition; selling is the converse. Because wave forms may be irregular, quantifying divergence is tricky. Although our detection algorithm is elementary and imperfect, when examining charts it appears to work well enough to objectively evaluate the usefulness of divergence.

Only buy signals will be discussed; the sells are the exact opposite. The algorithm's logic is as follows: Over a look-back (in the code, len3), the lowest bar in the price series and the lowest bar produced by the oscillator are located. Several conditions are then checked. First, the lowest bar of the price series must have occurred at least one bar ago (there has to be a definable valley), but within the past six bars (this valley should be close to the current bar). The lowest bar in the price series has to occur at least four bars after the lowest bar in the look-back period for the oscillator line (the deepest valley produced by the oscillator must occur before the deepest valley produced by the price). Another condition is that the lowest bar produced by the oscillator line is not the first bar in the look-back period

(again, there has to be a definable bottom). Finally, the oscillator must have just turned upward (defining the second valley as the signal about to be issued). If all conditions are met, there is ostensibly a divergence and a buy is posted. If a buy has not been posted, a similar set of conditions looks for peaks (instead of valleys); the conditions are adjusted and a sell is posted if the market formed a higher high, while the oscillator formed a lower high. This logic does a reasonable job of detecting divergences seen on charts. Other than the entry orders, the only difference between Tests 13 through 21 is the oscillator being analyzed (in relation to prices) for the presence of divergence.

Tests 13 through 15: Stochastic Divergence Models. Fast %K was used with the standard entries. Optimization involved stepping the Stochastic length from 5 to 25 in increments of 1 and the divergence look-back from 15 to 25 by 5. The best parameters were length and look-back, respectively, 20 and 15 for open, 24 and 15 for limit, 25 and 15 for stop. This model was among the worst for all orders and in both samples. In-sample, the limit was marginally best; out-of-sample, the stop. In-Sample, across all orders, Unleaded Gasoline, Soybeans, and Soybean Meal were profitable; Gold and Pork Bellies were moderately profitable with a limit. Unleaded Gasoline held up out-of-sample across all orders. Soybeans were profitable out-of-sample for the open and stop. More markets were profitable out-of-sample than insample, with the stop yielding the most markets with profits. The pattern of more profitable trading out-of-sample than in-sample is prima facie evidence that optimization played no role in the outcome; instead, in recent years, some markets have become more tradeable using such models. This may be due to fewer trends and increased choppiness in many markets.

Tests 16 through 18: RSI Divergence Models. Optimization stepped the RSI period from 5 to 25 in increments of 1, and the divergence look-back from 15 to 25 by 5. Overall, the results were poor, h-sample, the stop was least bad, with the limit close behind. Out-of-sample, the stop was also best, closely followed by the open. Given that the RSI has been one of the indicators traditionally favored by traders using divergence, its poor showing in these tests is noteworthy. Heating Oil was profitable for all orders, Unleaded Gasoline was significantly profitable for the open and stop, Light Crude for the limit and stop. In-sample, Soybeans traded very profitably across orders; Orange Juice, Corn, Soybean Oil, and Pork Bellies traded well with the stop. Out-of-sample, the oils were not consistently profitable, while Soybeans remained profitable across orders; Orange Juice and Soybean Oil still traded profitably with the stop.

Tests 19 through 2\: MACD Divergence Models. The length of the shorter moving average was stepped from 3 to 15 in increments of 2; the length of the longer moving average from 10 to 40 by 5; and the divergence look-back from 15 to 25, also by 5. Only parameter sets where the longer moving average was actually longer than the shorter one were examined.

Finally, models that appear to work, producing positive returns in both samples! With entry at open, trades were profitable across samples. In-sample, the average trade made $1,393; 45% of the trades were winners; and there was only an 8.7% (uncorrected; 99.9% corrected) probability that the results were due to chance; both longs and shorts were profitable. Despite poor statistical significance in-sample, there was profitability out-of-sample: The model pulled $140 per trade (after commissions and slippage), with 38% winning trades; only shorts were profitable.

The limit performed slightly worse in-sample, but much better out-of-sam-ple. Figure 7-2 depicts the equity curve for entry on a limit. In-sample, the average profit per trade was $1,250 with 47% winning trades (the highest so far); longs and shorts were profitable; and the probability was 13.1% (uncorrected; 99.9% corrected) that the results were due to chance. Out-of-sample, the model made $985 per trade; won 44% of the time: was profitable in long and short positions; and was only 27.7% likely due to chance.

It-sample, the stop had the greatest dollars-per-trade return, but the smallest number of trades; only the shorts were profitable. Out-of-sample, the system lost $589 per trade; only short positions were profitable. Regardless of the order used, this model had relatively few trades.

The market-by-market analysis (see Tables 7-1 and 7-2) confirms the potential of these models to make money. The largest number of markets were profitable in-sample. Across samples, all three orders yielded profits for Light Crude and Coffee; many other markets had profitability that held up for two of the orders, but not for the third, e.g., Heating Oil, Live Cattle, Soybeans, Soybean Meal, and Lumber.

Was this article helpful?

0 0

Post a comment