Bearish Harami Reversal Backtest Strategy
Overview
The Bearish Harami Reversal Backtest Strategy identifies bearish Harami reversal patterns in candlestick charts and automatically trades them. It goes short when detecting a bearish Harami pattern and closes the position when the stop loss or take profit is triggered.
Strategy Logic
The core pattern recognition indicator of this strategy is: the close of the first candle is a long bullish candle and the second candle's close is inside the first candle's body, forming a bearish candle. This indicates a potential Bearish Harami reversal pattern. When this pattern forms, the strategy goes short.
The specific logic is:
- Calculate if the body size of the first candle ABS(Close1 - Open1) is greater than the set minimum body size
- Check if the first candle is bullish Close1 > Open1
- Check if the current candle is bearish Open > Close
- Check if current candle's open is less than or equal to previous close Open <= Close1
- Check if previous candle's open is less than or equal to current candle's close Open1 <= Close
- Check if current candle's body is less than previous body Open - Close < Close1 - Open1
- If all conditions pass, a Bearish Harami has formed and the strategy goes short.
Advantage Analysis
The advantages of this strategy are:
- Utilizes the strong bearish reversal signal of Harami for higher profit probability
- Extensive backtest data results are positive
- Simple clear logic that is easy to understand and optimize
- Customizable stop loss and take profit for risk control
Risk Analysis
There are also some risks:
- Market may have false breakouts leading to losing positions. Can widen stop loss or add filters.
- High volatility may trigger stop loss prematurely. Should choose lower volatility products.
- Insufficient backtest data may not reflect real market conditions. Should increase test data size and verify in live trading.
Optimization Directions
The strategy can be further optimized in the following areas:
- Add Volume, MACD and other filters to improve signal quality
- Optimize stop loss and take profit strategies, adjust levels dynamically
- Increase position holding efficiency, combine with trend and other factors to reduce ineffective trades
- Test different trading products to find lower volatility alternatives
Conclusion
The Bearish Harami Reversal Backtest Strategy has clear, easy to understand logic, good backtest results and controllable risks. It has room for live trading adjustments and optimizations. Overall the trading signals are reliable and worth further optimizations and verification in live trading.
/*backtest
start: 2023-11-15 00:00:00
end: 2023-11-19 23:00:00
period: 15m
basePeriod: 5m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=3
////////////////////////////////////////////////////////////
// Copyright by HPotter v1.0 16/01/2019
// This is a bearish reversal pattern formed by two candlesticks in which a short - 1

