Skip to content
All library documents

Long-Only EMA Crossover Strategy with a 200-EMA Trend Filter

Article TradingView scripts

Summary

This simple long-only strategy uses the 200-period EMA to define an uptrend and the 50-period EMA to time entries and exits. It buys when the closing price crosses above the 50 EMA while also trading above the 200 EMA. It closes the long position when price crosses below the 50 EMA. The script plots both averages and sizes each entry as 100 percent of strategy equity in its backtest settings.

The accompanying description outlines a possible automation path: TradingView alerts can pass signals to a Python webhook server, which can submit orders to Interactive Brokers. It mentions stocks and ETFs as intended applications and says paper or live execution is possible. However, the document supplies no backtest results, tested instruments, transaction cost analysis, or details about alert handling and order safeguards. It also gives no stop loss or short-selling rules, so the simple crossover logic should not be read as evidence of profitability or a complete execution system.

Key ideas

  • The strategy permits long entries only when price is above the 200 EMA.
  • A close crossing above the 50 EMA triggers an entry, while a cross below it closes the position.
  • The script specifies full-equity position sizing for strategy entries.
  • The description proposes routing alerts through a Python webhook to a broker, but provides no performance evidence or execution safeguards.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.