How reliable are the targets?
Before going much further, we need to determine if our targets are sufficient at removing random chance from the equation. I will run 10,000 simulations targeting 500 trades and 10,000 simulations targeting 15,000 trades. If any random simulation is able to exceed our target percent or target profit, then the values are not reliable enough. However, if 10,000 simulations are not enough to produce a value exceeding our targets, then I am satisfied. With enough simulations any target could be achieved, but we have to have realistic goals.
Results for 10,000 Simulations targeting 500 trades (3 bars into future):
No simulations were able to exceed either target profit nor target percent. 51 simulations were able to exceed 60%, but the closest any came was 62%. This is well below the 64.04% that we target. Five simulations were able to surpass +$7,000 but none came close to the +$10,000 target.
Results for 10,000 Simulations targeting 15000 trades (3 bars into future):
No simulations were able to exceed either target profit nor target percent. Several simulations got close but were unable to exceed targets. Because the target percentage is a lot smaller for 15,000 trades than 500 trades the safety margin appears small. However, I feel confident enough in these targets to consider anything that exceeds them to not be due to random chance.
Concerns:
My Primary concern while evaluating both the long and short baselines stem from the fact that both long and short trades have > 50% winning percentages. I was unable to reconcile how this could be possible. However, after evaluating trade by trade, I finally realized that NinjaTrader counts profit zero as a win. What happens is both the long and short simulations contain several trades that end flat. This inflates the winning % of both directions.
While evaluating these indicators we are not including commission or slippage. If we had, those flat trades would actually be losses and the winning % of both directions would go down. Since neither the evaluation of the strategies or the original baselines contained slippage/commissions all results obtained should still be valid. Once we attempt to create an actual strategy using what we learn we will include commission/slippage and will need to recalculate baselines accordingly.
Related Posts:
Share
RSI Part 4 – Moving Average Strategy
Our next strategy will explore what happens when RSI crosses above/below a moving average. In RSI part 2 we discovered that the RSI is effective at predicting the future when below a threshold. Now we need to determine if we can eliminate the need for pre-set threshold values and just rely on being below a moving average instead.
Test 1: RSI above its moving average (long only)
This test will be conducted by optimizing on two variables. One variable representing the look-back period used in the RSI calculation, and one variable representing the bars used in calculating the moving average. The strategy will enter long when above its moving average. Based on prior results, we would expect this strategy to be sub-par.
Results:
As expected the strategy performed horrible. No variable pairs resulted in producing a profit.
Test 2: RSI below its moving average (long only)
This test will be conducted by optimizing on two variables. One variable representing the look-back period used in the RSI calculation, and one variable representing the bars used in calculating the moving average. The strategy will enter long when below its moving average.
Results:
Most variable combinations resulted in profit. However, neither profit nor percentage was high enough to meet our standards. Because nearly every combination resulted in profit, it appears there may be a slight edge here. We will need to look closer at how we can better exploit this edge to meet our requirements.
Test 3: RSI crosses below its moving average (long only)
This test will be conducted by optimizing on two variables. One variable representing the look-back period used in the RSI calculation, and one variable representing the bars used in calculating the moving average. The strategy will enter long when RSI crosses below its moving average.
Results:
The results were very similar to what was seen in (RSI Part 3). The percent profitable as well as profit factor remained fairly stable. Only thing that changed was the number of trades taken.
Source Code:
Download Source
Related Posts:
Share
RSI Part 3 – Threshold Cross
In this article we aim to discover the significance of actually crossing a threshold. Because RSI is a momentum based indicator it stands to reason that the actual act of crossing a threshold may signal a better trade.
(Comparison Results With RSI Part 2 – Long Only)
Method: RSI(3) < 10
Percent Profitable: 60.36%
Net Profit: +12,100
Trades: 1559
Conclusion:
Requiring an actual cross only seems to decrease the number of trades. Profit factor and percent profitable remain nearly unchanged. Therefore we can conclude that the act of being below a threshold as seen in “RSI Part 2″ is sufficient and that watching only the cross is not required.
Related Posts:
Share
RSI Part 2 – Oversold Strategy
In the last article, we looked at RSI when it is above a threshold. This time we will explore what happens when RSI is below a threshold. To test this, we will optimize on two variables. One variable representing the look-back period for RSI and one variable to represent the threshold to cross below.
(Example results looking 3 bars into future – Long Only)
Method: RSI(3) < 10
Percent Profitable: 60.15%
Net Profit: +36,550
Trades: 5069
Conclusions:
Dozens of parameter combinations surpassed our targets on both percent profitable and/or on net profit. Especially combinations that involved RSI being below 20. This was seen in both 3 and 5 bars into the future. These findings suggest that there may be a statistical advantage when RSI is below certain thresholds.
In a future article we can explore which threshold values are significant and if there are any values that remain significant across multiple markets. We will also explore if there is a difference when RSI crosses above/below a threshold instead of just being below that threshold.
Source Code:
Download Source
Related Posts:
Share
RSI Part 1 – Momentum Trading
RSI is a momentum based indicator which stands for (Relative Strength Index). Because it gauges momentum, people recommend using RSI when it crosses above a threshold. Hopefully the stock’s momentum will continue to carry it higher.
To test this we created a strategy with 2 inputs. One input for the RSI look back period, and one for the threshold. We then ran an optimization against our 5 minute ES data.
Results looking 5 bars into the future (Long Only):
(Best Percent)
Percent Profitable: 53.06%
Trades: 35,073
Profit: -$43,275
(Best Profit)
Percent Profitable: 51.09%
Trades: 9,594
Profit: +$3,900
Results looking 3 bars into the future (Long Only):
(Best Percent)
Percent Profitable: 54.44%
Trades: 59,890
Profit: -$16,525
(Best Profit)
Percent Profitable: 52.96%
Trades: 22,748
Profit: +$6,037
Conclusion:
Trading RSI based on being above a threshold does not provide any statistical advantage. Most of the results were actually below the results obtained through random testing. This indicates that being below a threshold may perform better. We will explore this option in our next segment.
Source Code:
Related Posts:
Share
5 Minute Testing Procedure (Short Only)
We have already established a baseline for Long trades. Now we need to do the same thing on the short side. When comparing methods, some may behave differently when shorting than when going long. The target will be any method that can predict market direction (5) standard deviations above the baseline average. We will establish baselines for both percent profitable and expected return per contract.
To establish a baseline we will run 100 random entry simulations against the target market. Because we do not know ahead of time the target trading frequency, we have to perform this test several times using various random rules. We will target 15,000 trades, 5,000 trades, 1,500 trades, and 500 trades over the sample period. The simulations aim to predict the market direction 3, and 5 bars into the future. We will be using a target market of ES Futures.
The strategies will not enter trades after 2:05 PM or before 8:30 AM. This ensures all exits are at the appropriate number of bars.
Baseline Results for 3 Bars into the future targeting 15,000 trades:
Percent Profitable: 53.96%
Expected Return: +$5,345
Target Percent: 55.88%
Target Return: +$68,377
Baseline Results for 5 Bars into the future targeting 15,000 trades:
Percent Profitable: 52.54%
Expected Return: +$8,939
Target Percent: 54.12%
Target Return: +$70,660
Baseline Results for 3 Bars into the future targeting 5,000 trades:
Percent Profitable: 53.85%
Expected Return: +$380
Target Percent: 57.07%
Target Return: +$32,217
Baseline Results for 5 Bars into the future targeting 5,000 trades:
Percent Profitable: 52.67%
Expected Return: +$2,403
Target Percent: 55.97%
Target Return: +$44,050
Baseline Results for 3 Bars into the future targeting 1,500 trades:
Percent Profitable: 54.01%
Expected Return: +3,32
Target Percent: 60.17%
Target Return: +$19,144
Baseline Results for 5 Bars into the future targeting 1,500 trades:
Percent Profitable: 52.65%
Expected Return: +1,380
Target Percent: 58.98%
Target Return: +$25,199
Baseline Results for 3 Bars into the future targeting 500 trades:
Percent Profitable: 53.93%
Expected Return: +$179
Target Percent: 64.24%
Target Return: +$9,766
Baseline Results for 5 Bars into the future targeting 500 trades:
Percent Profitable: 52.73%
Expected Return: +$573
Target Percent: 63.92%
Target Return: +$16,306
These results show a different pattern than the long trades showed. When going long the expected return in most simulations were negative. The expected return on the short side is positive. Since all trades are for a pre-set number of bars, you could conclude from these results that the market moves down faster than it moves up.
Source Code:
Download Source
Related Posts:
Share
5-Minute Testing Procedures (Long Only)
Our initial focus is not to discover a profitable strategy. Instead, we aim to discover methods that can reliability tilt the odds in our favor. The target will be any method that can predict market direction (5) standard deviations above the baseline average. We will establish baselines for both percent profitable and expected return per contract.
To establish a baseline we will run 100 random entry simulations against the target market. Because we do not know ahead of time the target trading frequency, we have to perform this test several times using various random rules. We will target 15,000 trades, 5,000 trades, 1,500 trades, and 500 trades over the sample period. The simulations aim to predict the market direction 3, and 5 bars into the future. We will be using a target market of ES Futures.
The strategies will not enter trades after 2:05 PM or before 8:30 AM. This ensures all exits are at the appropriate number of bars.
Baseline Results for 3 Bars into the future targeting 15,000 trades:
Percent Profitable: 54.21%
Expected Return: -$4,048
Target Percent: 56.1%
Target Return: +$47,248
Baseline Results for 5 Bars into the future targeting 15,000 trades:
Percent Profitable: 53.27%
Expected Return: -$6,435
Target Percent: 55.17%
Target Return: +$56,325
Baseline Results for 3 Bars into the future targeting 5,000 trades:
Percent Profitable: 54.18%
Expected Return: -$2,009
Target Percent: 56.52%
Target Return: +$23,900
Baseline Results for 5 Bars into the future targeting 5,000 trades:
Percent Profitable: 53.31%
Expected Return: -$2,900
Target Percent: 56.24%
Target Return: +$37,468
Baseline Results for 3 Bars into the future targeting 1,500 trades:
Percent Profitable: 54.32%
Expected Return: -$455
Target Percent: 59.2%
Target Return: +$17,490
Baseline Results for 5 Bars into the future targeting 1,500 trades:
Percent Profitable: 53.35%
Expected Return: -$1,080
Target Percent: 59.14%
Target Return: +$22,699
Baseline Results for 3 Bars into the future targeting 500 trades:
Percent Profitable: 53.91%
Expected Return: -$367
Target Percent: 64.04%
Target Return: +$10,081
Baseline Results for 5 Bars into the future targeting 500 trades:
Percent Profitable: 53.30%
Expected Return: -$173
Target Percent: 64.86%
Target Return: +$16,000
Based on these results, its evident that the sample period has a slight positive bias. Averaging around 54% profitable trades. However, the sample period has a negative profit expectancy of around -$.30 per trade. As you can see, the more trades we do the less variation and the lower threshold we need to cross to be considered “not random”. However, when targeting only 500 trades in the sample period a method will need to be nearly 65% profitable to rule out randomness.
Source Code:
Related Posts:
Share
The Testing Environment
Our research can only be as accurate as the data used. To help ensure accuracy, all testing will be performed on data provided by e-signal. We are looking to thoroughly test indicators and strategies, not re-invent the wheel. Therefore, we will be using NinjaTrader 7 for all backtesting.
Most published results will be based on ES futures. However, to increase sample size we will also utilize a basket of DOW stocks for optimization and to also test how robust a method actually is. A method that works great on the ES, but fails miserably when tried on other stocks is generally the product of curve fitting.
Share
Finding an edge
If you want to be a successful trader, you need an edge… but how do we find one? If your like most traders you start out by adding every indicator you can find to your chart. Before long your chart is nothing more than a squiggly mess, yet your still losing money. Next you jump on the “price action” bandwagon. Quickly you discover no two people can agree on what constitutes support and resistance. A monkey can draw a line across a chart and show an example of where price “reacts” to this line. After a while, if your still around, you may eventually dabble with the mysterious art known as artificial intelligence. After creating hundreds of neural networks attempting to “predict” market direction you finally give up. Like so many others, your search ends in frustration and utter defeat. Feeling defeated the trader simply declares the market random.
I have personally gone through all of these stages. However, I do not believe the market is random. Instead, I believe its “mostly” random, with fleeting moments of clarity. Our goal is to take a long hard look at everything we “think” we know about the market. Thoroughly test every indicator and method we can get our hands on to determine what really works. All results will be posted for the public to see and provide feedback. Using this research, we can determine which methods provide an edge and which are simply a waste of time.


