OPEN-SOURCE SCRIPT
Equal-Length EMA/SMA Crossover Momentum Strategy

Overview:
How it works:
Signal description:
Strategy entry and exit conditions:
- This momentum and trend-following strategy captures the majority of any trending move, and works well on high timeframes.
- It uses an equal-period EMA and SMA crossover to detect trend acceleration/deceleration, since an EMA places a greater weight and significance on the most recent data.
- This version is optimized for longs, and designed to cut your losses quickly and let your winners run.
- To reduce noise and optimize entries, we combined this with an overall trend bias for further confluence.
How it works:
- Signals are determined by the crossover of an EMA and SMA of the same length, e.g. EMA-50 and SMA-50.
- The overall trend bias is determined using a slower SMA golden/death cross, e.g. SMA-50 and SMA-100.
- The signal is stronger when it occurs in confluence with the overall trend bias, e.g. when EMA-50 crosses over SMA-50, while above the SMA-100. This is analogous to only opening long positions in a bull market.
Signal description:
- Trend Buy: EMA crosses above SMA, and overall trend bias is bullish. Buying is in confluence with the overall trend bias.
- Risky Buy: EMA crosses above SMA, and overall trend bias is bearish. Buying is early, more risky, and not in confluence with the overall trend bias.
- Late Buy: SMA crosses above BIAS_SLOW. This gives further confirmation of bullish trend, but signal comes later.
- Sell: EMA crosses under SMA.
Strategy entry and exit conditions:
- This version enters a Long when "TREND BUY" is signalled.
- This version has Sell/Shorts disabled because UP ONLY.
- Long entry: Strategy enters Long when EMA is above SMA, while overall trend bias is bullish.
- Long exit: Close long when EMA crosses under SMA.
Skrypt open-source
W duchu TradingView twórca tego skryptu udostępnił go jako open-source, aby traderzy mogli analizować i weryfikować jego funkcjonalność. Brawo dla autora! Możesz korzystać z niego za darmo, ale pamiętaj, że ponowna publikacja kodu podlega naszym Zasadom Społeczności.
Aby uzyskać szybki dostęp na wykresie, dodaj ten skrypt do ulubionych — więcej informacji tutaj.
Wyłączenie odpowiedzialności
Informacje i publikacje przygotowane przez TradingView lub jego użytkowników, prezentowane na tej stronie, nie stanowią rekomendacji ani porad handlowych, inwestycyjnych i finansowych i nie powinny być w ten sposób traktowane ani wykorzystywane. Więcej informacji na ten temat znajdziesz w naszym Regulaminie.
Skrypt open-source
W duchu TradingView twórca tego skryptu udostępnił go jako open-source, aby traderzy mogli analizować i weryfikować jego funkcjonalność. Brawo dla autora! Możesz korzystać z niego za darmo, ale pamiętaj, że ponowna publikacja kodu podlega naszym Zasadom Społeczności.
Aby uzyskać szybki dostęp na wykresie, dodaj ten skrypt do ulubionych — więcej informacji tutaj.
Wyłączenie odpowiedzialności
Informacje i publikacje przygotowane przez TradingView lub jego użytkowników, prezentowane na tej stronie, nie stanowią rekomendacji ani porad handlowych, inwestycyjnych i finansowych i nie powinny być w ten sposób traktowane ani wykorzystywane. Więcej informacji na ten temat znajdziesz w naszym Regulaminie.