Summary of the EMA Trend & Trigger Strategy (Pine Script) This Pine Script strategy is designed to trade based on Exponential Moving Averages (EMAs) on two different timeframes:
1D (Daily) → Identifies the overall trend. 1H (Hourly) → Generates trade signals based on shorter-term movements. How It Works 1. Define EMA Lengths Daily (1D) EMAs: Short EMA: 5-period Long EMA: 30-period Hourly (1H) EMAs: Short EMA: 12-period Long EMA: 26-period 2. Calculate EMA Values Uses request.security to fetch EMA values from both the daily (1D) and hourly (1H) timeframes. 3. Determine Trend Based on 1D EMAs Uptrend: Short EMA (5) > Long EMA (30). Downtrend: Short EMA (5) < Long EMA (30). 4. Generate Trade Signals (1H Crossover) Buy Signal: Short EMA (12) crosses above Long EMA (26) AND the daily trend is up. Sell Signal: Short EMA (12) crosses below Long EMA (26) AND the daily trend is down. 5. Volatility-Based Trade Triggers High Volatility Uptrend: If the price rises by more than 5%, enter a long trade. High Volatility Downtrend: If the price drops by more than 5%, enter a short trade. 6. Stop Loss Calculation Long Trades: Stop loss at the lowest price in the last 10 bars. Short Trades: Stop loss at the highest price in the last 10 bars. 7. Execute Trades Enter Long: When a buy signal or high volatility uptrend occurs. Exit Long: When the stop loss (localBottom) is hit. Enter Short: When a sell signal or high volatility downtrend occurs. Exit Short: When the stop loss (localPeak) is hit. 8. Plot EMAs on Chart Blue: 1D Short EMA (5). Red: 1D Long EMA (30). Green: 1H Short EMA (12). Orange: 1H Long EMA (26). Key Takeaways Combines trend-following and short-term crossovers for trade signals. Filters trades based on volatility (5% price moves). Uses stop-loss levels based on local highs/lows (last 10 bars). Can trade both long and short positions. This strategy is useful for momentum traders looking to follow trends while using a lower timeframe for precision entries. 🚀
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.
Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.
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.
Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.