OPEN-SOURCE SCRIPT

Bauhaus Reversal Master

96
Welcome to the Bauhaus Reversal Master!

A Pine Script (v6) creation for TradingView that detects market reversals using classic candlestick patterns. Think of yourself as a chart detective—this script does the heavy lifting by spotting signals, labeling them, and running an automated trading strategy with built-in risk management.

🔍 What Does This Script Do?

Identifies Candlestick Patterns: Recognizes formations like Hammer Time, Falling Star, Bullish Munch, and more.

Confirms the Trend: Uses stochastic to ensure patterns appear in extreme zones (overbought/oversold), increasing reliability.

Automates Trading: Places buy/sell orders with predefined risk parameters.

Labels the Chart: Displays clear tags (e.g., "HAM" or "STAR") for instant visualization.

Manages Risk: Calculates risk and reward based on market volatility (ATR-based).

It’s like having a trading assistant with precision and style! 🎯

🛠 How It Works: Step by Step

1️⃣ Setup (Control Panel)

Capital Allocation: Bets 10% per trade (adjustable).

Commission: Default 0.1% per trade (modifiable for your broker).

Custom Options:

ATR Period: Measures volatility (default 14 bars).

Profit & Loss: Multipliers for Take Profit (1.5x ATR) & Stop Loss (1x ATR).

Trend Lookback: Number of candles analyzed (default 14).

Reversal Threshold: Overbought/Oversold levels (default 80).

Smoothing Factor: Helps reduce noise (default 20).

2️⃣ Candlestick Patterns (The Stars of the Show)

📈 Bullish Patterns (Buy Signals)

Hammer Time: Long lower wick in a downtrend.

Inverted Hammer: Long upper wick in a downtrend.

Bullish Munch: A big green candle swallowing a red one.

Tweezer Bottom: Two candles with identical lows, one red, one green.

📉 Bearish Patterns (Sell Signals)

Hanging Man: A hammer-like candle but in an uptrend.

Falling Star: Long upper wick in an uptrend.

Bearish Gobble: A big red candle engulfing a green one.

Tweezer Top: Two candles with identical highs, one green, one red.

✅ Each pattern can be toggled ON/OFF.

3️⃣ Trend Confirmation (The Filter)

Uses stochastic (kTrend) to detect extreme market conditions:

Overbought (>80) → Bearish Zone

Oversold (<20) → Bullish Zone

Averages it (smoothK) to filter out false signals.

Buys only in bearish zones, sells only in bullish zones.

4️⃣ Candlestick Math (For Nerds 🤓)

Breaks each candle into:

Body

Upper Wick

Lower Wick

Measures proportions of each to detect valid patterns.

5️⃣ Risk & Reward (Your Money’s Bodyguard)

Uses ATR (atrVal) to set dynamic profit & loss levels:

Buy Trade:

Take Profit = Price + (ATR × 1.5)

Stop Loss = Price - (ATR × 1)

Sell Trade:

Take Profit = Price - (ATR × 1.5)

Stop Loss = Price + (ATR × 1)

Ensures a Risk/Reward Ratio favoring larger wins over losses.

6️⃣ Execution (Let’s Trade!)

Spots a bullish pattern? Places a Buy Order (GoLong).

Detects a bearish pattern? Places a Sell Order (GoShort).

Exits automatically at Take Profit or Stop Loss.

7️⃣ Chart Labels (Visual Cues)

Displays clear signals:

Bullish: "HAM" (hammer), "INV" (inverted hammer), "BULL" (bullish engulfing), "TWZB" (tweezer bottom) → Green Labels

Bearish: "STAR" (shooting star), "HANG" (hanging man), "BEAR" (bearish engulfing), "TWZT" (tweezer top) → Red Labels

📊 Why Use This Script?

✅ Automated Trading – Execute trades on TradingView effortlessly.✅ Visual Insights – Labels help identify patterns instantly.✅ Backtesting – Simulate past performance (e.g., starting with $10,000).✅ Customizable – Modify settings for risk, market type (stocks, forex, crypto), and strategy.

💡 Pro Tips for Users

Test Before Trading – Run TradingView’s backtest to evaluate performance.

Adjust Risk Settings – Increase Stop Loss or lower Take Profit in volatile markets.

Choose the Right Timeframe – Works best on H1 (1-hour) and H4 (4-hour) charts.

Match Commissions – Set the commission rate to match your broker’s fees.

Use Additional Analysis – Patterns aren’t 100% reliable; combine this with your own insights.



Aviso legal

As informações e publicações não devem ser e não constituem conselhos ou recomendações financeiras, de investimento, de negociação ou de qualquer outro tipo, fornecidas ou endossadas pela TradingView. Leia mais em Termos de uso.