Triple Moving Average Crossover and Williams Indicator Strategy
Overview
This strategy identifies the price trend direction by combining three smoothed moving averages, relative strength index (RSI) and Williams indicator, and seeks trading opportunities when the trend reverses. It goes long (short) when the fast, medium and slow moving averages align upward (downward), RSI is above (below) 50 and a down (up) Williams signal appears. The stop loss is set at a certain percentage of the entry price, and take profit at a certain percentage move in the favorable direction from the entry price.
Strategy Logic
The strategy uses three moving averages with different periods, including fast, medium and slow MAs. When the fast MA crosses over the medium MA, it signals an upward price trend. When the fast MA crosses below the medium MA, it signals a downward price trend. After identifying the uptrend or downtrend, the strategy waits for the first trading opportunity.
Specifically, after the price enters an uptrend, the strategy waits until the following five conditions are met before going long:
-
The fast, medium and slow MAs are all pointing up;
-
RSI is above 50;
-
A downside Williams pattern appears;
-
The price crosses over the slow MA;
-
There is no current position.
After the price enters a downtrend, the strategy waits until the following five conditions are met before going short:
-
The fast, medium and slow MAs are all pointing down;
-
RSI is below 50;
-
An upside Williams pattern appears;
-
The price crosses below the slow MA;
-
There is no current position.
After going long or short, the strategy sets a stop loss at a certain percentage below the entry price, and a take profit target at a certain percentage above the entry price.
Advantages
-
Combining multiple indicators to confirm entries can effectively avoid false breakouts. The triple MAs identify the trend direction, Williams catches reversal signals, and RSI filters out range-bound price action, jointly improving the accuracy of entries.
-
Setting stop loss and take profit can well control the risk/reward of each trade, ensuring winning trades exceed losing trades.
-
The strategy logic is clear and easy to understand. The parameters are reasonably set. It suits traders at different levels.
Risks
-
Indicators may generate incorrect signals during range-bound markets, causing unnecessary entries. Optimizing RSI parameters can filter out some whipsaws.
-
The fast and medium MA crossover may have false breakouts. Using other indicators in combination, e.g. volume, is recommended.
-
If the stop loss is too close to the entry price, it may get stopped out prematurely. The stop loss should be adjusted to a proper position.
-
If the take profit is too far from the entry price, it may not get hit. The take profit also needs proper adjustment.
Optimization Directions
-
Test different parameter combinations for the three MAs and RSI.
-
Add other indicators, like volume, to check if volume surges on breakouts.
-
Test parameters respectively based on different products.
-
Draw profit curves based on backtest results to optimize stop loss and take profit.
-
Try paper trading before enabling it to optimize parameters.
Conclusion
The strategy has clear logic overall, entering and exiting positions with a combination of indicators, which effectively controls risk. There is large room for parameter optimization. By testing different parameter settings, this strategy can become a steady profitable quantitative trading strategy. However, no strategy can completely avoid losses. Traders need to follow trading disciplines - taking profits when winning and cutting losses when losing.
/*backtest
start: 2023-08-28 00:00:00
end: 2023-09-27 00:00:00
period: 3h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//This script is a combination of 3 smoothed moving averages, and RSI. When moving averages are aligned upward (downward) and RSI is above (below) 50 and a down (up) William fractal appears, it enters long (short) position. Exiting from long and short entries are defined by StopLoss and TargetProfit.
//@version=5
- 1
