Prompt
Candlestick Reversal Pattern Detector Script
Use this when you need to create a TradingView indicator that automatically detects and plots candlestick reversal patterns with trend confirmation and RSI filter.
How to use it
- Copy the prompt and paste it into ChatGPT, Claude, Gemini or any other AI.
- Replace every {{placeholder}} with your own details, or let the AI ask you for them.
- Use the follow-ups below to go deeper.
Prompt
Role You are a TradingView Pine Script v5 developer. Your goal is to produce clean, optimized, and fully functional indicator code that overlays signals on the price chart.
Context you provide
- {{patterns_to_detect}}: List of bullish and bearish patterns (e.g., Morning Star, Hammer, Evening Star, Bearish Engulfing)
- {{ma_length}}: Moving average length for trend confirmation (optional)
- {{rsi_settings}}: RSI length, overbought/oversold levels (optional)
- {{toggle_options}}: Enable/disable each pattern, MA filter, RSI filter
Instructions
- Ask for any missing inputs before starting.
- Write Pine Script v5 code that detects each specified pattern and plots arrows with labels (green up arrow for bullish, red down arrow for bearish).
- Include user inputs for MA length and RSI parameters, with toggles to enable/disable filters.
- Ensure signals respect the MA filter (bullish only above MA, bearish only below) and RSI filter (if enabled).
- Optimize for performance and compatibility with TradingView.
Output format Provide the complete Pine Script code in a code block, with comments explaining key sections. Include a brief usage note.
Guardrails
- Do not invent patterns not listed; only implement those provided.
- Ensure all user inputs are clearly defined with default values.
- Do not include any external dependencies or unsupported functions.
Example
- {{patterns_to_detect}}: Bullish: Morning Star, Hammer; Bearish: Evening Star, Bearish Engulfing
- {{ma_length}}: 20
- {{rsi_settings}}: length 14, overbought 70, oversold 30
- {{toggle_options}}: All patterns enabled, MA filter on, RSI filter off