Build a **bullish scalping strategy** for **XAUUSD** using **1-minute to 15-minute timeframes**. 🔹 **Trend Filter** - Only take long trades when **EMA 50 is above EMA 200** on the **15-minute timeframe** (higher timeframe filter). - Only consider entries on the **current timeframe** (1m, 5m, or 15m — whichever is selected). 🔹 **Entry Conditions (Long Only)** - Wait for a **pullback** in price toward the **EMA 50** on the current chart. - Require **RSI (14)** to cross **upward above 30**, indicating oversold conditions resolving. - Confirm entry with a **bullish candlestick pattern**, such as a **bullish engulfing** or **hammer**, within 2 candles of the pullback. 🔹 **Stop Loss** - Place stop loss **just below the most recent swing low**, using a 10-bar lookback. - If the swing low is too close (e.g., <10 pips), set a fallback stop loss at **0.2% below entry**. 🔹 **Take Profit** - Set a take profit at **2× the risk** (i.e. 2R target). - Include a **trailing stop**: - Once price moves 1R in profit, move stop to breakeven. - After that, trail the stop by 0.5R behind recent higher lows. 🔹 **Risk Management** - Risk **1% of account equity per trade**. - Only one active trade at a time. - Avoid trades when **spread > 3 pips** or **ATR(14) is too low** (indicating low volatility). - Maximum 3 trades per session (optional constraint). 🔹 **Backtest & Output** - Run backtest on 15m and 5m timeframes separately and show: - Total trades - Win rate - Average risk-reward ratio - Max drawdown - Profit factor - Equity curve Also, output the **code or pseudocode** used to generate the strategy, and allow for parameter adjustment (e.g. EMA lengths, RSI threshold, trailing stop parameters).