Type/to search

Multi-model Candlestick Pattern Combination Strategy

Cryptocurrency
Created: 2023-10-17 15:53:06
Last modified: 3 years ago
1
Follow
1781
Followers

img

Overview

This strategy combines multiple candlestick pattern models to trade stocks. It incorporates engulfing pattern, harami pattern and harami cross pattern to capture trading opportunities in different market conditions.

Principle

The core logic of this strategy is to build several candlestick pattern recognition rules and then generate trading signals by combining these rules.

Firstly, it defines some basic variables to describe candlestick properties like the candle body size, open price, close price etc.

Then based on the relationship between the closing price and opening price, it defines 3 types of trading bar: 1 for rising, -1 for falling and 0 for no change.

On this basis, 3 candlestick pattern recognition rules are constructed:

  1. Engulfing Pattern: current candle engulfs the previous one, generating buy or sell signals.

  2. Harami Pattern: previous candle engulfs the current one, generating buy or sell signals.

  3. Harami Cross Pattern: combination of Harami and Doji, generating buy or sell signals.

According to these candlestick patterns, the timing of buy and sell can be determined. Some additional conditions are combined to filter out invalid signals, like trading time range limit.

The trading logic checks existing position first. If contradicting with signal direction, it will close current position first, then open new position according to signal.

Advantages

  • Combination enhances stability. Single pattern is prone to specific market conditions. Combination can improve reliability.

  • Confirmation improves accuracy. Different patterns verify each other. False signals can be avoided.

  • Flexibility. Users can freely combine models and adjust parameters for different market dynamics.

  • Risk control. Stop loss and position handling logic manages risks effectively.

Risks

  • Complexity. More parameters means more complexity. Improper combination may undermine performance.

  • Parameter tuning requires expertise. How to set proper pattern parameters needs experience.

  • One-side holding risk. Long or short only limits profit potential. Allow both long and short can help.

  • Missing reversal points. Focusing on patterns loses sight of trend reversal signals. Adding other indicators can help identify potential reversal points.

Enhancement

  • Add stop loss to reduce holding risk.

  • Incorporate other technical indicators to determine overall trend, avoiding trading against major trend. E.g. MACD, Bollinger Band etc.

  • Test model parameters across different products, establish optimal parameter sets fitting each product.

  • Introduce machine learning to help optimize parameters and pattern recognition using AI.

Conclusion

This strategy constructs a relatively stable short-term trading system by combining multiple candlestick patterns. But parameter tuning and risk control still need improvement to adapt more complex markets. Overall it has solid logic and has great potential after accumulating enough data and experience, and leveraging machine learning for intelligent optimization.

Source
Pine
/*backtest
start: 2022-10-10 00:00:00
end: 2023-10-16 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//Noro
//2018

//@version=3
Strategy parameters
Strategy parameters
Long
Short
Model Engulfing
Model Harami
Model Harami Cross
From Year
To Year
From Month
To Month
From day
To day
Reversive trading
Comment
All comments (0)
No data
No data
  • 1
iPhone Download
Forums
PINE Language
© 2015 - ∞ INVENTOR PTE LTD (SG)