Liquid US stocks and ETFs
Daily20 EMA entry reference with 50 SMA trend filter
Test for pullback entries that last several days to a few weeks. Define the actual entry and exit instead of treating a touch as a trade.
Swing trading settings
Short answer
A 20-period EMA is one research baseline to test for swing entries, while a 50-period SMA can serve as a separate trend filter. A 200-period SMA can be tested as a long-term regime filter. None is universally best. The right choice depends on the holding period, symbol, timeframe, entry rule, exit rule, and trading costs, so compare them with the same complete strategy.
Treat each value as a starting point. A setting only becomes useful after you test it on the same market, timeframe, costs, and date range you plan to study.
| Parameter | Starting point | What it changes | Caution |
|---|---|---|---|
| Average type | EMA for entries, SMA for regime filters | EMA gives recent prices more weight. SMA gives each value in the lookback equal weight. | EMA usually follows price more closely, but Fidelity notes that this sensitivity can also create more short-term changes. |
| Fast length | 20 bars | A 20-bar average can track pullbacks and shorter trend changes within a swing horizon. | The number means bars, not always days. A 20-bar average on a four-hour chart differs from a 20-day average. |
| Intermediate length | 50 bars | A 50-bar SMA smooths more price movement and is commonly used as an intermediate trend gauge. | More smoothing adds lag, so entries and exits may occur well after price turns. |
| Long-term length | 200 bars | A 200-bar SMA is a common long-term trend proxy and can act as a regime filter. | It needs enough history to initialize and can be too slow to serve as a swing entry trigger. |
| Price source | Close | The source determines which price from each bar enters the average. | Keep the source fixed while comparing types or lengths so the result has one clear cause. |
| Signal confirmation | Confirmed bar close | The rule accepts a cross only after the chart candle has completed. | Intrabar alerts can fire earlier and may not match close-confirmed historical results. |
20 EMA entry reference with 50 SMA trend filter
Test for pullback entries that last several days to a few weeks. Define the actual entry and exit instead of treating a touch as a trade.
50 SMA intermediate trend with 200 SMA long-term regime filter
Test slower trend rules where fewer signals and a broad market filter are intentional.
20 EMA fast average with 50 EMA slow average
Test only with market-specific session, spread, commission, and slippage assumptions. The lengths refer to four-hour bars.
These templates define a research process. They are not trade calls or evidence that a setup will make money.
Rule to test
Enter long when price closes back above the 20 EMA while the 50 SMA is rising. Exit on a close below the 20 EMA or an ATR-based stop.
Compare the 20 EMA with a 20 SMA while every other rule stays fixed. Include costs and reserve recent history for out-of-sample testing.
Rule to test
Enter long when the 20 SMA closes above the 50 SMA and price is above the 200 SMA. Exit when the 20 SMA closes below the 50 SMA.
Compare against buy and hold. Review drawdown, average trade, exposure, and trade count across bullish, bearish, and sideways periods.
Rule to test
Enter after a completed close above the 20 EMA when the 50 EMA slope is positive. Use the same ATR stop and fixed risk per trade in every run.
Walk the setup forward and model commission and slippage. Reject a parameter if small length changes cause the result to collapse.
Use the 20-period EMA as a research baseline for daily SPY pullbacks and the 50-period SMA as a separate trend filter. Test both rather than treating either value as a recommendation.
When comparing SMA and EMA on AAPL, hold the length and every trade rule constant. Otherwise weighting and a second change cannot be separated.
Wait for the bar to close before accepting a price cross. AAPL can move above and below a moving average several times before the daily candle is final.
Inspect the number of trades as well as return. A fast EMA may look responsive on QQQ, but extra turnover can erase an apparent advantage once costs and slippage are included.
Pineify can turn a moving-average idea into an editable Pine Script strategy with selectable SMA or EMA type, lengths, bar-close confirmation, risk rules, commission, and slippage. This makes side-by-side tests repeatable instead of relying on chart impressions.
Build and test a moving-average strategySources checked 2026-07-18
This page is an information and strategy-testing tool, not investment advice. Moving-average parameters are test starting points, not trade recommendations or promises of profit. Backtests and paper trades are hypothetical, can omit real execution effects, and do not predict future performance. Trading can result in loss.