This simple strategy leverages the crossover of two moving averages — the 50-period and 200-period Simple Moving Averages (SMA) — to identify trend reversals and generate buy and sell signals.
Features: Moving Average Calculation:
MA 50: Represents the short-term trend. MA 200: Represents the long-term trend. Crossover Logic:
Bullish Crossover: When MA 50 crosses above MA 200, indicating a potential upward trend. Bearish Crossover: When MA 50 crosses below MA 200, indicating a potential downward trend. Entry and Exit Logic: Long Condition:
Triggered when MA 50 crosses above MA 200. Closes any short position before opening (or adding to) a long position. Short Condition:
Triggered when MA 50 crosses below MA 200. Closes any long position before opening (or adding to) a short position. Visualization: MA 50 (Short-Term): Plotted on the chart as a dynamic line for short-term trend analysis. MA 200 (Long-Term): Plotted on the chart to reflect the long-term trend. Crossover points are visually indicated by the trade entry/exit markers on the chart. This strategy is ideal for traders who prefer a simple and effective trend-following approach based on moving averages. Use it for backtesting and adaptation to your trading style.
Visit my website for more tools and strategies: bybitindicators.com
In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in publication is governed by House rules. You can favorite it to use it on a chart.
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.