OPEN-SOURCE SCRIPT
Actualizado

AI Trading Alerts v6 — SL/TP + Confidence + Panel (Fixed)

132
Overview

This Pine Script is designed to identify high-probability trading opportunities in Forex, commodities, and crypto markets. It combines EMA trend filters, RSI, and Stochastic RSI, with automatic stop-loss (SL) & take-profit (TP) suggestions, and provides a confidence panel to quickly assess the trade setup strength.

It also includes TradingView alert conditions so you can set up notifications for Long/Short setups and EMA crosses.

⚙️ Features
EMA Trend Filter
  • Uses EMA 50, 100, 200 for trend confirmation.
  • Bull trend = EMA50 > EMA100 > EMA200
  • Bear trend = EMA50 < EMA100 < EMA200

RSI Filter
  • Bullish trades require RSI > 50
  • Bearish trades require RSI < 50

Stochastic RSI Filter
  • Prevents entries during overbought/oversold extremes.
  • Bullish entry only if %K and %D < 80
  • Bearish entry only if %K and %D > 20

EMA Proximity Check
  • Price must be near EMA50 (within ATR × adjustable multiplier).

Signals
Continuation Signals:
  • Long if all bullish conditions align.
  • Short if all bearish conditions align.

Cross Events:
  • Long Cross when price crosses above EMA50 in bull trend.
  • Short Cross when price crosses below EMA50 in bear trend.

Automatic SL/TP Suggestions
SL size adjusts depending on asset:
  • Gold/Silver (XAU/XAG): 5 pts
  • Bitcoin/Ethereum: 100 pts
  • FX pairs (default): 20 pts

TP = SL × Risk:Reward ratio (default 1:2).

Confidence Score (0–4)
Based on conditions met (trend, RSI, Stoch, EMA proximity).
Labels:
  • Strongest (4/4)
  • Strong (3/4)
  • Medium (2/4)
  • Low (1/4)

Visual Panel on Chart
  • Shows ✅/❌ for each condition (trend, RSI, Stoch, EMA proximity, signal now).
  • Confidence row with color-coded strength.

Alerts
  • Long Setup
  • Short Setup
  • Long Cross
  • Short Cross

🖥️ How to Use
1. Add the Script
  1. Open TradingView → Pine Editor.
  2. Paste the full script.
  3. Click Add to chart.
  4. Save as "AI Trading Alerts v6 — SL/TP + Confidence + Panel".

2. Configure Inputs
  1. EMA Lengths: Default 50/100/200 (works well for swing trading).
  2. RSI Length: 14 (standard).
  3. Stochastic Length/K/D: Default 14/3/3.
  4. Risk:Reward Ratio: Default 2.0 (can change to 1.5, 3.0, etc.).
  5. EMA Proximity Threshold: Default 0.20 × ATR (adjust to be stricter/looser).

3. Read the Panel
Top-right of chart, you’ll see ✅ or ❌ for:
  • Trend → Are EMAs aligned?
  • RSI → Above 50 (bull) or below 50 (bear)?
  • Stoch OK → Not extreme?
  • Near EMA50 → Close enough to EMA50?
  • Above/Below OK → Price position vs. EMA50 matches trend?
  • Signal Now → Entry triggered?

Confidence row:
  • 🟢 Green = Strongest
  • 🟩 Light green = Strong
  • 🟧 Orange = Medium
  • 🟨 Yellow = Low
  • ⬜ Gray = None

4. Alerts Setup
Go to TradingView Alerts (⏰ icon).
Choose the script under “Condition”.

Select alert type:
  • Long Setup
  • Short Setup
  • Long Cross
  • Short Cross

Set notification method (popup, sound, email, mobile).
Click Create.
Now TradingView will notify you automatically when signals appear.

5. Example Workflow
Wait for Confidence = Strong/Strongest.
Check if market session supports volatility (e.g., XAU in London/NY).
Review SL/TP suggestions:

  • Long → Entry: current price, SL: close - risk_pts, TP: close + risk_pts × RR.
  • Short → Entry: current price, SL: close + risk_pts, TP: close - risk_pts × RR.

Adjust based on your own price action analysis.

📊 Best Practices
  • Use on H1 + D1 combo → align higher timeframe bias with intraday entries.
  • Risk only 1–2% of account per trade (position sizing required).
  • Filter with market sessions (Asia, Europe, US).
  • Strongest signals work best with trending pairs (e.g., XAUUSD, USDJPY, BTCUSD).
Notas de prensa
Overview

This Pine Script is designed to identify high-probability trading opportunities in Forex, commodities, and crypto markets. It combines EMA trend filters, RSI, and Stochastic RSI, with automatic stop-loss (SL) & take-profit (TP) suggestions, and provides a confidence panel to quickly assess the trade setup strength.

It also includes TradingView alert conditions so you can set up notifications for Long/Short setups and EMA crosses.

Exención de responsabilidad

La información y las publicaciones que ofrecemos, no implican ni constituyen un asesoramiento financiero, ni de inversión, trading o cualquier otro tipo de consejo o recomendación emitida o respaldada por TradingView. Puede obtener información adicional en las Condiciones de uso.