Complete AI Training

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

  1. Copy the prompt and paste it into ChatGPT, Claude, Gemini or any other AI.
  2. Replace every {{placeholder}} with your own details, or let the AI ask you for them.
  3. 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

  1. Ask for any missing inputs before starting.
  2. 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).
  3. Include user inputs for MA length and RSI parameters, with toggles to enable/disable filters.
  4. Ensure signals respect the MA filter (bullish only above MA, bearish only below) and RSI filter (if enabled).
  5. 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