The "CustomStrategy" trading strategy is designed to operate on 1-hour timeframe data. This strategy uses technical indicators and pattern recognition to make buy and sell decisions in the market. Here's a breakdown of its key components:
Indicators Calculation:
MACD (Moving Average Convergence Divergence): Calculates MACD line, signal line, and histogram.
Bollinger Bands: Computes lower, middle, and upper Bollinger Bands.
RSI (Relative Strength Index): Calculates the RSI indicator.
Doji Candlestick Pattern: Detects the presence of a Doji candlestick pattern. Candlestick Metrics: Computes metrics related to candlestick shapes like upper wick, lower wick, and overall candle length. Sideways Market Detection: Identifies periods of sideways market movement based on specific conditions. Buy Signal Criteria:
Buys are triggered under certain conditions:
Sideways market condition is met. MACD is above 0. The upper wick of the candle is less than or equal to 40% of the candle length. The lower wick of the candle is less than or equal to 40% of the candle length. Sell Signal Criteria:
Two types of sell signals are considered:
Double Top Pattern: If two consecutive Doji candlesticks are detected, a sell signal is triggered. Price Below Sideways Range: If the price drops below the lowest point of the previous sideways market range, a sell signal is generated. Risk Management and Performance:
Stop loss: A fixed stop loss of -10% is applied. ROI: A predefined ROI of 10% is set. Trailing Stop: Trailing stop functionality is disabled. This strategy aims to capitalize on both trend-following and pattern-based trading. It identifies potential buy and sell signals based on the conditions mentioned above. Traders can use this strategy as a starting point for backtesting different trading scenarios to assess its effectiveness in various market conditions. Keep in mind that the performance of any trading strategy is subject to market dynamics and historical data.