Candlestick Patterns Based Strategy
Overview
This strategy is based on candlestick patterns to identify different candlestick signals and trade along the trend. With proper risk management methods like stop loss, take profit, and trailing stop, it aims to reduce the impact of market fluctuations.
Strategy Logic
The strategy mainly identifies the following candlestick patterns for trading signals:
-
Engulfing: bullish engulfing and bearish engulfing patterns
-
Piercing Line/Dark Cloud Cover: bullish piercing line and bearish dark cloud cover patterns
-
Morning Star/Evening Star: bullish morning star and bearish evening star patterns
-
Belt Hold: bullish belt hold and bearish belt hold patterns
-
Three White Soldiers/Three Black Crows: three white soldiers and three black crows patterns
-
Three Stars in the South: three stars in the south pattern
-
Stick Sandwich: stick sandwich pattern
-
Meeting Line: bullish meeting line and bearish meeting line patterns
-
Kicking: bullish kicking and bearish kicking patterns
-
Ladder Bottom: ladder bottom pattern
When detecting these candlestick signals, it will place pending orders near the open price of the next bar, with pre-defined stop loss and take profit for trend following. It also uses trailing stop and breakeven stop to manage risks.
It also adds a moving average filter to avoid taking signals when price is on the wrong side of MA.
Advantages
-
Based on classical candlestick patterns, it has some universal applicability.
-
Trading mechanically based on pattern rules, not affected by subjective factors.
-
Reasonable stop loss and take profit settings to control single trade risks.
-
Trailing stop mechanism adjusts stop loss dynamically along with the market.
-
MA filter adds more logic to avoid being trapped in wrong trades.
Risks and Solutions
-
Candlestick patterns have some misidentification issues, which can lead to false signals. Can optimize parameters or filter out invalid patterns.
-
Static stop loss cannot fully avoid risks from market events. Can use wider stop or trailing stop.
-
Sensitive to trading sessions, cannot run 24x7. Can adjust trading times or add auction filters.
-
MA filter may miss some opportunities. Can lower MA period or remove the filter.
-
Hard to profit from both long and short sides together due to conflicts. Can separate strategies for long and short.
Optimization Directions
-
Optimize parameters of candlestick patterns to improve identification.
-
Test different trailing stop methods to find the optimal one.
-
Try more advanced risk management techniques like money management or volatility stop loss.
-
Add more filters to improve the filtering logic.
-
Build candlestick pattern recognition models using machine learning.
-
Develop strategy logic that can identify both long and short signals.
Summary
This strategy uses classical candlestick patterns for trend detection and trades mechanically based on the signals. It manages risks by strict stop loss and trailing stop, and improves logic by adding MA filter. The strategy is easy to understand and implement, but also has some issues like misidentification and difficulties in parameter tuning. Future optimizations can be done by introducing more technical indicators and machine learning models to achieve better performance.
/*backtest
start: 2022-09-15 00:00:00
end: 2023-02-17 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=2
strategy("Candle Patterns Strategy - 2", shorttitle="CPS - 2", overlay=true)
// New risk management system: order entry, moving stop loss to breakeven + moving average filter (SMA)
- 1
