This Pine Script strategy calculates the combined length of upper and lower wicks of candlesticks and uses a customizable moving average (MA) to identify potential long entry points. The strategy compares the total wick length to the MA with an added offset. If the wick length exceeds the offset-adjusted MA, the strategy enters a long position. The position is automatically closed after a user-defined holding period.
Key Features:
1. Calculates the sum of upper and lower wicks for each candlestick. 2. Offers four types of moving averages (SMA, EMA, WMA, VWMA) for analysis. 3. Allows the user to set a customizable MA length and an offset to shift the MA. 4. Automatically exits positions after a specified number of bars. 5. Visualizes the wick length as a histogram and the offset-adjusted MA as a line.
References:
• Candlestick wick analysis: Nison, S. (1991). Japanese Candlestick Charting Techniques. • Moving averages: Brock, W., Lakonishok, J., & LeBaron, B. (1992). “Simple Technical Trading Rules and the Stochastic Properties of Stock Returns”. Journal of Finance.
This strategy is suitable for identifying candlesticks with significant volatility and long wicks, which can indicate potential trend reversals or continuations.