The Strategic Trader
Detailed Strategy Evaluation

Technical Indicators

Simple Profitable Strategy: Part 1 (Design)

In this article series we are going to take what we have learned from RSI, MACD, Bollinger Bands, and Aroon Oscillator to build a simple yet profitable strategy. For validation, the strategy testing period will exclude 1/1/2000-6/1/2001 and 1/1/2011 – present. This will allow us to perform sanity checks in later phases to avoid curve fitting.

The goal is to build a strategy that is still profitable after taking out both slippage and commissions. Since most of our articles to date have dealt with the 5 minute time frame on ES, we will continue using those parameters.

The Setup:

In order to build a strategy, we have to have a place to start. For this strategy, we will start by combining the best aspects of each of the trading methods we have tested thus far. Starting with the most recent Aroon Oscillator method.  We identified AroonOscillator(8) crossing below -80 as possessing a slight edge, so we will put a stick in the ground here.

Initial Results (Pre commission/Slippage):

Profit: +$54,987
PF: 1.20
Max DD: -$4,662
Sharp: .58
Trades: 6925
Win %: 58.51%
Average Trade: +$7.94

 

This is a good start, but far from profitable once commissions and slippage are applied.

Before we move on to filtering out trades or tweaking the exits we need to add more potential “entry conditions”. In this step we go back through all the indicators that showed a slight edge and see if an optimized parameter combination for it improves overall performance.

The main purpose of this phase is to get as many entries as possible while still remaining over our “statically significant” thresholds. Each individual entry criteria does not need to remain above the threshold, but as a whole when used in an if/or combination the strategy needs to at least exceed on percent profitable or pure profit.

  1. Additional Aroon Oscillator Parameter Combinations
    • No additional combinations improved results significantly. AroonOscillator(27) <-99 helped, but not enough to justify inclusion
  2. Cross below Bollinger Lower Band
    • Bollinger(2.5,7) was added to the strategy
  3. MACD cross below signal line
    • MACD(2,12,4) was added to the strategy
  4. RSI Hidden Divergence
    • RSI Hidden Divergence 29,10,4 was added to the strategy
  5. RSI Hidden Divergence
    • RSI Hidden Divergence 14,22,6 was added to the strategy
  6. RSI Hidden Divergence
    • RSI Hidden Divergence 18,6,2 was added to the strategy
  7. Aroon Hidden Divergence
    • Aroon Hidden Divergence 12,17,4 was added to the strategy

Results:

Profit: +$81,925
PF: 1.15
Max DD: -$4,700
Sharp: .59
Trades: 13600
Win %: 57.32%
Average Trade: +$6.02

trading strategy development

Summary:

Several key metrics decreased from the initial entry condition, but this is to be expected. Now we have a basic set of entry conditions providing over 13,000 trades. In the next several articles we will look at different ways of filtering out the non-performing trades, and implement an exit that makes more sense than a static 5 bar exit.

Eventually we will incorporate advanced concepts such as data mining and neural networks to improve the final product.

 


Share

Trading Methods Using Aroon Oscillator

The Aroon Oscillator is commonly used as a trend following indicator. Meaning buy when trending up, sale when trending down. In this article we will look at the following strategies for trading the Aroon Oscillator:

  1. Buy when aroon oscillator crosses above 0
  2. Buy when aroon oscillator crosses above some value x
  3. Buy when aroon oscillator crosses below 0
  4. Buy when aroon oscillator crosses below some value x

Strategy #1: Buy when aroon oscillator crosses above 0

Almost all parameters result in negative expectancy

Strategy #2: Buy when aroon crosses above some value x

This strategy performs fairly well, as long as x is < 0.  No parameter combination was able to exceed our target thresholds. However, a few came pretty close. The closest one would be AroonOscillator(40) crosses above -99

aroon oscillator strategy 1

 

Strategy #3: Buy when aroon oscillator crosses below 0

Performs better than when crossing above 0, but is not enough of an edge to use in a strategy.

Strategy #4: Buy when aroon oscillator crosses below x

There were several parameter combinations that exceeded both profit and winning % after 5 bars. The best combination was when aroonoscillator(8) crossed below -80

aroon oscillator strategy 2

 

Summary:

Using the aroon oscillator to trade “with the trend”, does not look like a viable strategy. However, buying when aroon oscillator crosses below certain values can yield a small edge. May be useful in filtering out bad trades as we start to build out a strategy.

Source Code:

Download Source



Share

Trading Methods Using Bollinger Bands

Bollinger bands consist of 3 lines. A moving average in the middle, an upper band (avg + x standard deviations), and a lower band (avg – x standard deviations). Commonly the upper band is thought of as overbought territory and the lower band oversold. In this article we will explore several uses of Bollinger bands:

  1. Buying when the price crosses below the lower band
  2. Buying when the price crosses above the upper band
  3. Buying when the price crosses back above the lower band
  4. Buying when the price crosses back below the upper band

Test #1: Buy on cross below lower band

This method tested out well. There were a few parameter combinations that narrowly exceeded our profit and percent profitable targets set for 5 bar exits. The best parameter combination was 1.5 standard deviations and 4 for the lookback period. Here is the equity curve achieved:

Test 2: Buy on cross of upper band

This method did not yield a single profitable result.

Test 3: Buy when price crosses back above lower band

This method is similar to test #1 except we wait for confirmation of price turning around by crossing back above the lower band. Common sense would dictate this strategy should perform well. However, the actual results were closer to Test #2 than Test #1.

Test 4: Buy when price crosses back below the upper band

This strategy was unable to exceed our preset thresholds. Attached is the equity curve for the best parameter combination: 2.5 std, 24 period

Summary:

We discovered that buying on oversold bollinger band conditions can be a viable strategy. However, more work is needed to fully exploit this potential edge.

Source Code:

Download Source



Share

MACD Part 2: Signal Cross (Long Only)

In this article we will explore the viability of trading the 5 minute ES when the MACD crosses the signal line. The signal line is nothing more than a moving average of the MACD values. To start with, we will test a very common strategy (going long when the current MACD  value crosses above the signal line).


Strategy #1
For the first test, we will enter any trade when the MACD crosses above the signal line.

Results: Exit at 5 Bars
A common theme is starting to emerge. Buying on up moves is generally a losing strategy. Buying when MACD crosses above its signal line and then holding for 5 bars is a pretty bad idea. Not a single optimized parameter set was able to turn a profit in this scenario. Winning percentages were decent, but not above the threshold required to be meaningful.


Strategy #2
Buy when the MACD crosses above the signal line and MACD above the zero line

Results: Exit at 5 Bars
Although we are still buying on an up move, the fact that we are above the zero line appears to make a difference. Based on previous testing results related to the zero line, I did not expect the strategy to do well. However, there were quite a few combinations of parameters that were profitable.  The 4,2,2 parameter combination was even able to (slightly) exceed our percent profitable threshold, but fell short of the overall profit goal.


Strategy #3
Buy when the MACD crosses above the signal line and MACD below the zero line

Results: Exit at 5 Bars
Not surprisingly based on the results from Strategy #2 and Strategy #1, this strategy does not perform very well.


Strategy #4
Buy when the MACD crosses below the signal line

Results: Exit at 5 Bars
Some profitable combinations, but no where near significant.


Strategy #5
Buy when the MACD crosses below the signal line and MACD below zero

Results: Exit at 5 Bars
Once again, we come very close to passing our thresholds on percentage and profit, but fall short.


Strategy #6
Buy when the MACD crosses below the signal line and MACD above zero

Results: Exit at 5 Bars
As logic would dictate, because Test #5 performed well, Test#6 did not do so great.

Summary
MACD signal line crosses mostly reinforce the theme that buying after an up move is a losing strategy. However, strategy 2 had an unexpected result. If you buy on signal line crosses and the MACD is above zero, the strategy performs well. In future tests we will need to examine this behavior more closely.

Source Code:

Download Source

Related Posts:



Share

MACD Part 1: Zero Line (Long Only)

In this series we will test the MACD (Moving Average Convergence Divergence) indicator. Like our other indicator series we will test the results against our 5-minute base line results found here: Long Baseline, Short Baseline, and Risk/Reward Baseline

MACD is commonly used to enter trades based on its position relative to the Zero Line. Our first test will enter long whenever MACD is above the zero line.

Results: Exit at 5 Bars
These results turned out very similar to what we saw with RSI when above 50. Very few combinations were even positive with no results coming close to demonstrating a tradeable edge.

Results: Exit Using 1:2 Risk/Reward Ratio
Not a single combination resulted in a net profit. Clearly it is not wise to buy when MACD is above the Zero Line.

Now we will test the MACD below the Zero Line. Based on the above results, we expect being below the Zero Line to outperform.

Results: Exit at 5 Bars
No combination was able to surpass our targets for total profit. However, a large number of combinations surpassed our percent profitable threshold. This indicates a potential edge, however the edge is likely too small to surpass trading costs such as commission. May be useful as a filter to filter out losing trades.

Best Combination: Fast = 2, Slow =4 Smooth =4

Results: Exit Using 1:2 Risk/Reward Ratio
No combination came close to our thresholds. This combined with the failure to reach profit thresholds using 5 bar exit, further underscores this strategy as containing a very weak if any edge.

Summary
There may be a slight edge when entering trades while below the Zero Line. However, by itself it is not tradeable. In future articles we will look at ways of using this filter to improve our overall edge.

Source Code:

Download Source

Related Posts:



Share

RSI Part 9: Risk/Reward

Before temporarily moving away from RSI, I want to evaluate each method one more time using the risk/reward test discussed in this article: Risk/Reward Testing

Crossing Above a Threshold:
Surprisingly many parameter combinations performed very well. Unfortunately, no combinations were able to exceed our desired targets.

Crossing Below a Threshold:
This method performed horrible based on this metric. This is what I thought might happen, and the reason I wanted to perform this test. Buying when oversold is a high percentage play if your nimble. But from a risk/reward standpoint its a hard strategy to trade.

Normal Divergence:
This method still did not contain any tradeable edge. Performs very poorly.

Hidden Divergence:
No combination was able to exceed our lofty targets, however several combinations missed by only fractions of a percent. This further underscores the fact that RSI Hidden Divergence contains a tradeable edge.

Related Posts:



Share

RSI Part 8 – Short Strategies

In previous articles we have identified two methods that provide an edge on the long side (Bullish Hidden Divergence and Buying on oversold conditions). Before reading this article, its recommended you read the following two articles:

1. Buying on “Bullish Hidden Divergence
2. Buying when oversold

For this article we tested the same two concepts to see if they also had an edge when traded from the short side. The first method we looked at was “Bearish Hidden Divergence”. The testing strategy was very similar to the one used in “Bullish Hidden Divergence”. It was immediately apparent that this strategy had a significant edge just like its bullish counterpart.

Several combinations easily exceeded our target values when predicting 3 bars into the future. However, when predicting 5 bars into the future the results were not quite as clear. Several strategies came extremely close, but failed to exceed our targets. In some cases missing by fractions. Because this strategy easily blew past our targets for 3 bars into the future, we know the general concept has an edge. Its likely the edge degrades fast when trading short though. When we explore exit strategies in a future article we will need to take this into account. Here is a screenshot from one of the 3 bar combinations:

Next we tested selling short when RSI crosses above a given threshold (overbought). This strategy also clearly contains a statistical edge. Many combinations for both 3 and 5 bars into the future were profitable. Here is an example of one such combination:

The next step will be to create a “combination” strategy using several parameter combinations each exhibiting a statistical edge to see if the combined edge is maintained.

Source Code:

Download Divergence Source


Related Posts:



Share

RSI Part 7 – Bullish Regular Divergence

In this article we will be testing Bullish Regular Divergence using RSI.

Bullish Regular Divergence
Price: Lower Low
RSI: Higher Low

Using Bullish Hidden Divergence we were able to significantly exceed our targets and prove that there exists a statistical edge when using that method. However, the same can not be said for regular divergence. The strategy produced several combinations which were profitable, but all of the returns were well below our targets. Therefore we can not rule out random chance accounting for those results. Here is a P/L chart from the best combination:

Notice how “random” and volatile the results appear? When compared to the chart produced from the Hidden Divergence article, you can clearly see the difference.  Here is a P&L chart from the Hidden Divergence article.

Related Posts:



Share

RSI Part 6 – Bullish Hidden Divergence

A common technique for trading oscillators such as RSI is to use divergence. There are two types of divergence, regular and hidden. Regular divergence is commonly used to signal trend changes, and hidden divergence is used to signal trend continuation.

Bullish Regular Divergence
Price: Lower Low
RSI: Higher Low

Bearish Regular Divergence
Price: Higher High
RSI: Lower High

Bullish Hidden Divergence
Price: Higher Low
RSI: Lower Low

Bearish Hidden Divergence
Price: Lower High
RSI: Higher High

In this article we will be testing Bullish Hidden Divergence. This method is commonly used when a stock is in an uptrend and pulls back to test support. To find divergence we need to look at the lows of both RSI and price. Since RSI moves smoother than price, I used it as a way of finding lows. Once a low has been identified in RSI, I start looking for another potential low. If one is found I compare the price of the stock at the time of the first RSI low to the value of the stock now. I then compare the first RSI low with the new potential low. If RSI has made a lower low and price has made  a higher low I continue. Next, I check to see how many bars have passed since the first RSI low. This is to help ensure that enough distance has been created between the two valleys.

I optimized the strategy on 3 parameters:

1. RSI Period
2. Number of bars to look back when calculating a low
3. Number of bars to pass between lows

Initial (5 bar) results were decent. Most optimized pairs performed very well. However, only one combination was able to exceed our target value on both percent and profit. The strategy used a 9 bar RSI, 3 bar look-back, and required at least 9 bars between low points.

The (3 bar) results also did well. The same combination that exceeded our targets for 5 bars also exceeded for 3 bars. Here it the PL screenshot.

Further Enhancements:
Commonly Bullish Hidden Divergence is used to continue an uptrend. Therefore, I tried to only take trades when the stock was in a confirmed uptrend such as above a moving average etc. This method did not result in any performance gain. As we explore more indicators and determine which are ideal for identifying trend we can revisit this strategy.

Source Code:

Download Source


Related Posts:



Share

RSI Part 5 – Optimized Thresholds

In this article I want to explore which threshold values are the most significant (long only) and also see what happens when applied to other markets. To test this, I optimized the strategy on both threshold and RSI period while counting the number of times the resulting combination exceeded our statistically significant levels for both percent profitable and net profit.

Results for 5 Bars Into Future:

First I looked at the various threshold values and how often when using the threshold I was able to surpass either our target percent profitable or target profit levels. Threshold values of 25 and 30 seemed to be the most robust.

Threshold Count Beat Percent Count Beat Profit
10 0 0
15 1 0
20 3 1
25 3 2
30 2 3
35 2 0
40 4 0
45 6 0

Each of the above threshold values were used against various RSI periods ranging from 2-30. Below is a table outlining which periods resulted in surpassing our targets. Interestingly the lower periods 2-5 performed the best. I believe this may have something to do with our target holding time. Since we are only looking 5 bars into the future, the smaller RSI periods reflect the upcoming moves more accurately.

RSI Period Count Percent Count Profit
2 2 2
3 4 1
4 3 2
5 1 2
6 1 2
7 0 1
8 0 1
9 0 1
10 0 1
19 0 2
30 0 1

The combination of RSI(3) < 30 was the only pair to result in both a beat on percent profitable as well as target profit level. I wanted to see how robust this pair actually was, so I ran it against all 30 of the DOW stocks. The method was profitable on 25 of the 30 stocks. With PG performing the best, and CAT performing the worst. Over 436 thousand trades were recorded during this test, resulting in 54.2% profitable trades.

The strategy was able to beat the target percent in 17 of the 30 stocks, and beat the target profit in 7 of the 30 stocks. Considering the period/threshold combination was optimized on a different market, I believe these results are very promising.

Next I wanted to see what happens if I flip the combination and entered long when RSI(3) > 70. The results were horrible as expected. Further lending support to their being an edge when below a threshold as opposed to above a threshold. Only 6 of the DOW 30 was profitable in this test. With a combined 50.06% profitable trades.

Results for 3 Bars Into Future:

The same methods used for 5 bars into the future were used for 3 bars. Here are the two resulting tables:

Threshold Count Beat Percent Count Beat Profit
10 3 1
15 7 2
20 7 1
25 11 0
30 12 3
35 24 4
40 23 0
45 12 0

The results stayed similar to what we saw with 5 bars. Thresholds between 25-35 do very well. One thing to note is using 3 bars into the future we are having a lot more values beat our targets. This may indicate predicting 3 bars into the future is easier than 5 when using RSI.

RSI Period Count Percent Count Profit
2 11 1
3 11 1
4 9 1
5 6 1
6 5 0
7 2 1

I had way too many RSI periods beat our targets. Therefore, I am displaying only the top performers. The lower periods seem to predict better than the higher periods for this time frame.

Summary:

It looks like any threshold between 25-35 is ideal with a period less than 5. I would like to point out that while I am only showing the count that beat our targets that this does not mean the other combinations did not fare well. In fact, combinations in the ranges I outline were uniformly great. We have  strict requirements in the targets we are after. This is to ensure the results produced are not due to random chance. Its hard to go wrong when predicting either 3 or 5 bars into the future using a threshold of < 40.

The RSI(3) < 30 combination performing as well as it did against the DOW 30 stocks is very reassuring.


Related Posts:



Share

Archives

Designed by Get Paid Online and coded by Australian Survey Sites and Cashcrate.