Aroon Buy & Sell (Custom TFs)

🧠 Strategy Overview:
This script generates buy and sell signals using the Aroon indicator across two different timeframes:
* One for detecting the primary trend (Trend Timeframe)
* One for confirming precise entry signals (Signal Confirmation Timeframe)
📊 Key Components:
1. User Inputs
* trendTF: The timeframe used to determine overall trend direction (e.g., 5-minute).
* signalTF: The faster timeframe for confirming trade signals (e.g., 1-minute).
* aroonLength: Lookback period for the Aroon calculation (default 14).
* cooldownPeriod: Number of bars to wait before allowing a new signal.
2. Aroon Calculation Function
Calculates Aroon Up and Aroon Down values using the number of bars since the highest high and lowest low.
3. Multi-Timeframe Aroon Values
Uses request.security to compute Aroon values on both trendTF and signalTF.
4. Trend Detection
* A bullish trend is defined when Aroon Up crosses above Aroon Down on the trend timeframe.
* A bearish trend is defined when Aroon Down crosses above Aroon Up.
5. Signal Logic
* Buy Signal: When the overall trend is bullish and Aroon Down = 100 on the signal timeframe.
* Sell Signal: When the trend is bearish and Aroon Up = 100 on the signal timeframe.
6. Cooldown Mechanism
Prevents back-to-back signals by enforcing a cooldown (e.g., 20 bars) after each buy/sell.
7. Signal Plotting & Alerts
Plots buy/sell signals directly on the chart and supports alerts for automation.
📈 Visual Output:
* BUY label below the bar when buy conditions are met.
* SELL label above the bar when sell conditions are met.
🔔 Alerts:
Two alertconditions are defined to trigger alerts whenever a buy or sell signal occurs.
Script open-source
In pieno spirito TradingView, il creatore di questo script lo ha reso open-source, in modo che i trader possano esaminarlo e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricorda che la ripubblicazione del codice è soggetta al nostro Regolamento.
Per un accesso rapido a un grafico, aggiungi questo script ai tuoi preferiti: per saperne di più clicca qui.
Declinazione di responsabilità
Script open-source
In pieno spirito TradingView, il creatore di questo script lo ha reso open-source, in modo che i trader possano esaminarlo e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricorda che la ripubblicazione del codice è soggetta al nostro Regolamento.
Per un accesso rapido a un grafico, aggiungi questo script ai tuoi preferiti: per saperne di più clicca qui.