The strategy "Maximum deviation from the average", part 2
In the previous issue we investigated the first method of working on the strategy "Maximum deviation from the moving averageWe will continue to study the strategy in this issue. In this issue we will continue to investigate the proposed strategy, namely we will test the second method of determining the maximum deviation from the moving average. Let's remember a little bit about the essence of the tactic.
"The idea of the trading strategy proposed for consideration is based on the notion of market cyclicality: we know that the price cannot rise or fall forever, there is always a tipping point, especially if we are talking about volatile pairs and low timeframes. We will take the historical data for a certain period of time, for example a month, and look at how many points the price deviated from the moving average. The obtained figure should be memorized, and if the price deviates by the same number of pips again, we will enter into a trade".
The hardest part of this exercise is to find the optimal deviation, and that's what we'll do.
Method description
We will select the optimal value of the deviation of the average based on the time range set in advance. For example, we will search for the parameter we want for the last 100 bars, while the strategy tester will search for the number of bars.
Optimizing the method
After optimization, we have chosen the following parameters for our Expert Advisor: moving average period - 110, number of bars to search for deviations - 490, TakeProfit is 30 points, StopLoss size is limited to 105 pips. The testing in Figure 1 was carried out on EURUSD, M15, from 2009 to October 8, 2010.
Figure 1. Testing 2 methods to find the maximum deviation from the moving average.
Download the report
Conclusion
From the results of the optimization of the second variant of the search for the maximum deviation from the average, we were able to identify only one set of parameters, which showed a profit outside the optimization area. This indicates the instability of this method of operation, but as always we discount the use of a mechanical approach.
It is also worth noting that the optimization method we used had a serious error, because we used the method "at the bar opening". Perhaps the picture would have been different if tested using all ticks. However, resource consumption does not allow us to check this hypothesis, so we leave this possibility to you.
Description of the parameters of the obtained advisor
— InpStopLoss – размер СтопЛосса;
— InpTakeProfit – размер ТейкПрофита;
— InpLots – объем совершаемых сделок;
— InpMaDevPeriod – период индикатора скользящей средней;
— Maxdevbuy, maxdevsell – размер максимальных отклонений от средней в пунктах для покупки и продажи соответственно.
— NumBarsSerach – диапазон в bars, by which the maximum deviation is searched for.