“MACD SAR Trend Filter: 200 EMA Strategy” only fires when three classic indicators agree on the same bar
The 200 EMA, MACD and Parabolic SAR. If you have spent any time on TradingView, you have probably loaded all three at some point. “MACD SAR Trend Filter: 200 EMA Strategy” puts them on a single chart and prints a BUY or SELL label only on the confirmed bar where all three readings point the same way. On the chart it shows up under the short name “MSTF [fob]”.

Despite the word “Strategy” in the name, it is published on TradingView as an indicator, not a strategy. What it does instead is draw a stop-loss box and a target box for every signal, follow each trade bar by bar until it wins or loses, and summarize the recent results in a table in the top-right corner. Being able to check, right on the chart, whether this combo actually worked on your symbol and timeframe is what makes “MSTF” worth a look.
First, let’s see everything it draws in a single figure.
Where the BUY prints, plus the stop-loss and target boxes
A BUY prints on the confirmed bar where all three conditions line up, and the stop-loss and target boxes extend to the right from there.
Vowars DE ver.3.12.36
There are only three things to watch. The BUY in Figure 1 prints at the close of the bar where all three readings line up. That bar’s SAR dot becomes the stop, drawn as the bottom edge of the red box in Figure 2. The green box is the target, placed the same distance above entry. Once price reaches it, as in Figure 3, a “+1R” label is added to that bar.
“R” measures profit and loss in units of your stop distance. By default the stop and target are the same distance away, so a win is +1R and a loss is -1R.
What each of the three indicators does
“MSTF” gives each indicator a separate job. Once you understand this split, you will not be left wondering why a label did not show up.
| Role | Indicator | BUY condition | SELL condition |
|---|---|---|---|
| Higher-level trend | 200 EMA | Close above the 200 EMA | Close below the 200 EMA |
| Momentum | MACD (12, 26, 9) | MACD line above the signal line | MACD line below the signal line |
| Confirmation | Parabolic SAR (0.02, 0.02, 0.2) | Dot below the candle | Dot above the candle |
The 200 EMA is the directional filter that decides which side you are allowed to trade, and it is always shown through the background color. With the close above the 200 EMA, the background turns a faint green and only longs are allowed. Below it, the background turns red and only shorts are allowed. The other two, MACD and SAR, decide when to get in.
The MACD and SAR lines themselves are not plotted. All you see on the chart is the 200 EMA (a light blue line) and the SAR dots, and the MACD state is shown as text in the top-right table. If you want MACD in a lower pane, just add TradingView’s built-in MACD and you will see the same values side by side.
A closer look at the bars that print BUY and SELL
A label prints on “the first confirmed bar where both MACD and SAR line up”, as long as the 200 EMA condition is also met at that moment. In other words, the signal bar is the bar where the second of the two conditions falls into place. There are two ways this can happen.
SAR flips first, and the MACD cross completes the setup
Setup completed by a MACD crossover
The SAR dots flip below price first, and the BUY prints on the bar where MACD later crosses above its signal line.
Vowars DE ver.3.12.36
In Figure 1, the SAR dots flip below the candles first, while MACD is still below its signal line. A little later, MACD crosses above the signal line in Figure 2, both conditions line up on that bar, and the BUY in Figure 3 prints. It is essentially a MACD bullish crossover filtered by trend and SAR, and for convenience we will call it Pattern 1.
MACD turns up first, and the SAR flip completes the setup
Setup completed by a SAR flip
With MACD already above its signal line, the BUY prints on the bar where the SAR dot flips back below price.
Vowars DE ver.3.12.36
This one works in the opposite order. As shown in Figure 1, MACD is already above its signal line, and the SAR dot happens to jump above the candle for just one bar in Figure 2. When the dot flips back below on the next bar, both conditions line up again and you get the BUY in Figure 3. This is Pattern 2. It catches the moment SAR briefly flips on a pullback and then snaps right back, so it tends to show up several times in the middle of a trend.
You can see which pattern triggered a label by hovering over the BUY or SELL label and reading the tooltip (for example, “MACD cross with the SAR dot already below”).
If the MACD cross and the SAR flip happen on the same bar, it is treated as a MACD cross (Pattern 1). This matters when you use the settings to limit entries to just one of the two patterns.
Crossing the 200 EMA alone does not print a label
One thing I noticed right after I started using MSTF: price could break above the 200 EMA and turn the background green, and still no BUY would show up.
A 200 EMA breakout alone does not trigger a BUY
Even when MACD and SAR are already bullish, no BUY prints on the bar that breaks above the 200 EMA.
Vowars DE ver.3.12.36
The reason is that a BUY requires “the first bar where MACD and SAR line up”. At the point marked Figure 1, MACD and SAR were both already bullish. Since they had simply stayed aligned, crossing the 200 EMA did not create a new signal. The BUY only appears after MACD dips below its signal line in Figure 2 and crosses back above it in Figure 3.
If you want to enter on the 200 EMA breakout itself, this may feel too slow. But if you think of it as a design that avoids chasing the breakout and instead waits for the first pullback and the next leg up, it makes sense.
Reading the stop-loss and target boxes and the result labels
When a signal prints, the entry is that bar’s close and the stop is placed at that bar’s SAR dot. The target is placed on the other side, at the stop distance multiplied by Reward ratio (target = stop × this). The default is 1.0, so the stop and target are the same distance away.
- The red box spans from entry to the stop, and the green box spans from entry to the target
- While a trade is open, the boxes keep extending to the right by the number of bars set in Extend open trade boxes (bars) (30 bars by default)
- The boxes stop on the bar that hits the stop or the target, and a “+1R” or “-1R” label is added
- Even if the SAR dot sits extremely close to price, the stop distance is never smaller than 5 ticks
Wins and losses are judged on the high and low of confirmed bars. For a long, the trade loses if the low reaches the stop and wins if the high reaches the target. The signal bar itself is not checked; counting starts from the next bar.
Setups that appear during an open trade are skipped as “not taken”
By default, only one trade can be open at a time. If the conditions line up again before the current trade is resolved, no new trade is opened.
Signals during an open trade are skipped as not taken
By default, only one trade can be open at a time. If the conditions line up before the current trade resolves, no new trade is opened.
Vowars DE ver.3.12.36
While the trade in Figure 1 is still running, the conditions line up again in Figure 2. All you get there is a small, faded “buy · not taken” label; no boxes are drawn and it is not added to the stats table. Once the first trade closes at -1R in Figure 3, the next BUY is counted as a fresh trade.
These small labels are easy to miss, but they record that a valid setup was there too. Counting how many were skipped gives you a good sense of how often the indicator actually fires.
When a single bar hits both the stop and the target
On a wide-range bar, price can run through both the stop and the target within the same bar. Confirmed bar data alone cannot tell you which one was touched first.
When one bar hits both the stop and the target
If the same bar runs through both the stop and the target, MSTF books the trade as a loss (-1R).
Vowars DE ver.3.12.36
In this case, “MSTF” always counts the trade as a loss (-1R). The bar in Figure 1 has a high above the target and a low below the stop, yet the result is -1R, as shown in Figure 2. This skews the stats toward the worse side, so it works as a conservative rule that keeps the numbers from looking too rosy. Keep in mind that a tighter stop produces more of these bars that hit both levels, which tends to drag the win rate down.
The top-right stats table tells you how it did on this symbol and timeframe
Honestly, this table is half the reason to add “MSTF” to a chart. It tallies the most recent trades within the loaded chart history and displays the results.
How to read the stats table in the top right
The table shows recent trade results along with the current state of all three conditions.
Vowars DE ver.3.12.36
From the top, you get the number of trades counted, wins, losses, win rate, total R, the longest winning and losing streaks, and the number of days covered. The four rows below show the state on the current bar: position relative to the 200 EMA, MACD position, SAR dot position, and the stop and target of any open trade.
1 Start with the win rate and total R
At the default 1:1, the line you care about is whether the win rate is above 50%. Check the win rate in Figure 1 and the total R in Figure 2 first.
2 Then check the losing streak
“Worst loss streak” is the most practical number for sizing your risk. On a symbol that has gone through six straight losses, risking 5% of your account per trade would take a serious bite out of it.
3 Finally, look at the three current conditions
When all three rows in Figure 3 turn the same color, you are looking at a potential signal. As long as green and red are mixed, no label will print.
This table applies the indicator’s own rules to confirmed bars. Spread, commissions and slippage are not included at all. It also only counts the historical bars currently loaded on the chart. Even on the same symbol, the numbers change if you change the visible range or the timeframe.
A small detail: the number next to “Last 100 signals” in the first row is not the number of signals but the number of closed trades. Skipped “not taken” setups and trades that are still open are not included. Raising Log size (last N signals) lets you count more trades.
Testing it on Bitcoin across eight timeframes, from 1m to weekly
I loaded it on a Bitcoin (BTCUSDT) chart with default settings and compared the stats table across eight timeframes, from the 1-minute to the weekly.
| Timeframe | Trades counted | Wins / Losses | Win rate | Total R | Best win / Worst loss streak | Days covered |
|---|---|---|---|---|---|---|
| 1m | 100 | 47 / 53 | 47% | -6R | 6 / 6 | 4 days |
| 5m | 100 | 50 / 50 | 50% | +0R | 6 / 6 | 15 days |
| 15m | 100 | 50 / 50 | 50% | +0R | 5 / 5 | 56 days |
| 30m | 100 | 53 / 47 | 53% | +6R | 6 / 6 | 88 days |
| 1H | 100 | 54 / 46 | 54% | +8R | 6 / 5 | 194 days |
| 4H | 100 | 50 / 50 | 50% | +0R | 8 / 5 | 654 days |
| Daily | 77 | 37 / 40 | 48.1% | -3R | 6 / 4 | 3089 days |
| Weekly | 8 | 3 / 5 | 37.5% | -2R | 3 / 4 | 1569 days |
Only two timeframes finished net positive: the 30-minute (+6R) and the 1-hour (+8R). The 5-minute, 15-minute and 4-hour went exactly 50-50 for ±0R, and the 1-minute came in at a 47% win rate and -6R. Even the +6R and +8R took 100 trades to build up. Once you subtract fees and spread, there may be very little left. Rather than a “winning indicator”, it behaved the way trend-following combos usually do: it works reasonably well while a trend is running, then gives it back in the chop.
The lower the timeframe, the shorter the window those 100 trades are packed into. On the 1-minute, 100 trades covered just 4 days, and the long trade that was open at the time of the screenshot had its stop at 82,089.58 and its target at 82,442.44, only about $176 (USDT) from entry. With such small moves per trade, costs eat into the results much more. I would think twice before using it for 1-minute or 5-minute scalping based on the table numbers alone.

On the flip side, the stop distance gets wider on higher timeframes. The long trade open on the 4-hour had its stop at 79,910.41 and its target at 84,669.59, roughly $2,380 (USDT) away. The daily only produced 77 trades, with a 48.1% win rate and -3R. The long trade open on the daily had its stop at 75,633.99 and its target at 97,606.01, each more than $10,000 (USDT) from entry. Because the SAR dot can sit far away from price, the higher the timeframe, the bigger a single loss tends to be.

The weekly only had 8 trades over 1569 days, going 3-5 for -2R. With a sample that small, luck plays a big role, so I found it hard to judge from the table whether it suits the weekly.
If you plan to use it on the 4-hour or daily, it is probably best to either cap the stop distance with Max stop, % of price (0 = off), covered below, or size your position down to match the wider stop.
Settings and what happens when you change them
The settings are split into six groups: “Indicators”, “Setup”, “Trade”, “Log”, “Visual” and “Alerts”. The first four directly affect the results.
| Setting | Default | Suggested | Effect |
|---|---|---|---|
| Trend EMA length | 200 | 200 (start with the default) | Length of the EMA that sets the higher-level trend. Lower values make the background flip more often, which means more signals but also more countertrend-ish trades |
| MACD fast length | 12 | 12 | Fast EMA length for MACD. Same default as TradingView’s built-in MACD |
| MACD slow length | 26 | 26 | Slow EMA length for MACD |
| MACD signal length | 9 | 9 | Signal line length. Lower values make crosses happen sooner and more often |
| SAR start | 0.02 | 0.02 | Starting acceleration factor for Parabolic SAR. Higher values pull the dots toward price faster and cause more flips |
| SAR increment | 0.02 | 0.02 | Amount added to the acceleration factor each time a new high or low is made |
| SAR maximum | 0.2 | 0.2 | Cap on the acceleration factor. Lower values make the dots trail more slowly, which tends to widen the stop |
| Allow overlapping trades | Off | Off | When on, new trades are opened even while one is already open. Read up on how it behaves first (explained below) |
| Entry type | Both | Both / switch when comparing | Choose from Both, MACD cross only or SAR flip only. Decides which pattern’s signals are used |
| Take longs | On | Your call | When off, no buy signals are generated |
| Take shorts | On | Off if you mainly trade spot | When off, no sell signals are generated |
| Reward ratio (target = stop × this) | 1.0 | 1.0–2.0 | Target distance as a multiple of the stop distance, in 0.5 steps. A win also adds this many R to the stats |
| Max stop, % of price (0 = off) | 0.0 | Worth trying on higher timeframes | Caps the stop distance as a percentage of price. 0 means no cap. Capped trades are labeled stop capped |
| Extend open trade boxes (bars) | 30 | 30 | How many bars to the right the open trade’s boxes are extended. Does not affect the results |
| Log size (last N signals) | 100 | 100–200 | Number of recent trades counted in the stats table |
| Show log table | On | On | Shows or hides the stats table |
| Table position | Top Right | Your call | Position of the stats table |
| Table text size | Normal | Your call | Text size of the stats table |
The “Visual” group covers the long, short and 200 EMA colors, show/hide toggles for the 200 EMA, SAR dots, background tint, BUY/SELL labels and result labels, the number of trades kept on the chart, and box transparency. These are display-only settings, so they do not change the results.
| Setting | Default | Suggested | Effect |
|---|---|---|---|
| Long colour | Mint green | Default | Color for the long side. Used for labels, SAR dots, background and the target box |
| Short colour | Red (slightly pinkish) | Default | Color for the short side. Also used for the stop box |
| 200 EMA colour | Light blue | Default | Color of the 200 EMA line |
| Trades kept on chart | 120 | As needed | Number of boxes and labels kept on the chart. The oldest ones are removed first |
| Box fill transparency | 78 | 78–90 | Transparency of the box fill. Higher values make the boxes lighter and the candles easier to see |
| Send JSON alert() messages | On | Can be off if you do not use webhooks | Sends a JSON-formatted alert on every signal |
By the way, boxes and labels beyond Trades kept on chart are removed as new ones come in, but the stats table keeps its own tally separately, so the numbers are not affected.
Comparing the two patterns with Entry type
Entry type is the setting that really sets this indicator apart. “MACD cross only” limits signals to Pattern 1, “SAR flip only” limits them to Pattern 2, and the stats table is tallied using only those signals.
Just by switching between the three on the same chart, you can compare whether MACD-cross entries or SAR-flip entries perform better on a given symbol. Doing that comparison by hand would mean scrolling back through dozens of trades, so I found this genuinely handy.
Shaping the stop and target with Reward ratio and Max stop
At the default 1:1, you need a win rate above 50% to end up positive. Setting Reward ratio (target = stop × this) to 2.0 makes each win worth +2R, but the target gets hit less often. Which works better depends on the symbol, so the reliable way is to switch between 1.0, 1.5 and 2.0 and compare the stats table.
If you want to cap the stop distance itself, use Max stop, % of price (0 = off).
Capping the stop distance with Max stop
With Max stop, % of price set to 3, the stop is capped at 3% from price whenever the SAR dot sits too far away.
Vowars DE ver.3.12.36
Here the cap is set to 3%. When the SAR dot is far from price, the stop is held at 3% from price instead of at its original location in Figure 2. Capped trades get a “stop capped” tag on their label, as in Figure 1. The target shrinks along with the stop, so the boxes get smaller and trades resolve faster, as shown in Figure 3.
If the cap is too small, the stop ends up narrower than a single candle’s range, and you get more bars that hit both the stop and the target. Those count as losses, so the win rate in the table drops more than you would expect. Look at the typical bar range on your timeframe and start testing from a value a bit wider than that.
Know how “Allow overlapping trades” behaves before turning it on
The setting is described as “when on, every valid setup opens its own trade”, but the actual behavior is a little different.
What actually happens with Allow overlapping trades on
Same price action as the not taken figure, with overlapping trades enabled. The second BUY becomes a trade too, but the first trade is no longer tracked.
Vowars DE ver.3.12.36
With it on, the BUY in Figure 1, which appears while a trade is already open, also gets drawn as a trade with its own boxes. However, “MSTF” can only track one trade at a time, so tracking switches to the newer one. The first trade’s boxes are left stretched out as in Figure 2, with no result label, and it never makes it into the stats table. The -1R in Figure 3 is the result of the second trade.
When trades overlap, the older trade’s result is dropped from the tally. You do not end up with stats that count every signal, so if your goal is to compare performance, it is safer to leave it off.
How to approach the settings by goal
| If you want to | Setting to change | How to think about it |
|---|---|---|
| Cut down on losing streaks in choppy markets | Increase Trend EMA length, or pair it with ADX | The 200 EMA filter reacts more slowly and flips less often. You also get fewer signals |
| Keep stops tighter on higher timeframes like the daily | Set Max stop, % of price (0 = off) | Caps the stop only when the SAR dot is far away. Avoid values that are too small |
| Ride extended trends | Set Reward ratio (target = stop × this) to 1.5–2.0 | The win rate drops, but each win counts for more |
| Test long-only for spot trading | Turn off Take shorts | Removes short signals and their stats |
| Compare entry styles | Switch Entry type | Compare the three stats tables and pick the entry style that suits each symbol |
Steady in a trend, prone to losing streaks in the chop
MACD and Parabolic SAR are both trend-following indicators. Combining them does not change the fact that they struggle in sideways markets.
Choppy markets tend to stack up -1R losses
When price chops around the 200 EMA, the background color keeps flipping and BUY and SELL signals alternate.
Vowars DE ver.3.12.36
When price chops around the 200 EMA, as in Figure 1, the background color keeps flipping and the buy and sell readings swap every time. In this example, that led to four -1R losses in a row, as shown in Figure 2. On the 1-hour chart shown earlier, too, the stretch where price drifted sideways along the 200 EMA had a mix of +1R and -1R results.
On the other hand, when price pulls away from the 200 EMA and trends in one direction, SAR flips on each pullback or bounce trigger signals that often reach the target. Markets that tend to keep going once they pick a direction, like gold in an uptrend or strongly trending index futures, should be a better fit. Conversely, when the major FX pairs are stuck in a range, it is worth checking the losing streak length first.
Where it shines
- Combines three classic indicators into one and only labels bars where all conditions align, so there is less second-guessing
- Every signal comes with a stop and target, and each trade is followed through to its result
- The stats table shows win rate, total R and losing streak length for your own symbol and timeframe at a glance
- Entry type lets you switch entry styles and compare their results
- All checks run on confirmed bars, so past signals never change after the fact
Trade-offs to accept
- In choppy markets, buys and sells alternate and stop-outs tend to pile up
- A 200 EMA breakout alone is not a signal, so the initial move is easy to miss
- Because the stop sits at the SAR dot, stops tend to get wide on higher timeframes
- The stats table does not include fees or spread
- With Allow overlapping trades on, older trades drop out of the tally
Adding ADX below makes it easier to sit out the chop
The three conditions in “MSTF” tell you the direction, but not how strong the trend is. A great way to fill that gap is TradingView’s built-in ADX (Average Directional Index). ADX measures trend strength regardless of direction, and readings below roughly 20–25 are generally taken to mean there is no real trend.
Adding ADX below to check trend strength
MSTF's three conditions read direction, not trend strength. Adding the built-in ADX in a lower pane fills that gap visually.
Vowars DE ver.3.12.36
In Figure 1, ADX is below 20, and the short opened during that range gets stopped out for -1R in Figure 2. ADX then picks up, and the BUY that prints while it is rising in Figure 3 goes on to reach +1R. In practice, all you need is one extra rule, such as “skip any label that prints while ADX is below 20”. Of course, a high ADX does not guarantee the target gets hit, so keep checking it against the stats table.
Here are a few other indicators that should pair well with it.
- ATR Checking how many ATRs the stop distance (the distance to the SAR dot) represents tells you whether a trade carries more risk than usual. It also gives you a baseline for setting Max stop
- Choppiness Index Higher readings point to a choppy, consolidating market, which makes it useful for deciding when to sit out sideways action
- DMI Looking at where +DI sits relative to -DI goes one step beyond ADX and shows whether buyers or sellers have the stronger momentum
On the other hand, stacking contrarian-leaning oscillators like RSI or Stochastic on top tends to create conflicting reads: the stronger the trend that “MSTF” is buying into, the more likely those oscillators are to flash “overbought”. If you are going to combine it with something, tools that measure trend strength or volatility tend to fit more naturally.
Alerts, repainting and backtesting
Three alert conditions plus JSON alerts
When you select “MSTF [fob]” in the Create Alert dialog, you can choose from three conditions: “MSTF Long setup”, “MSTF Short setup” and “MSTF Any setup”. All of them only fire on signals that were actually taken as trades, never on bars marked “not taken”.
On top of that, when Send JSON alert() messages is on, every signal that becomes a trade also sends a JSON alert containing the direction, symbol, timeframe, entry, stop, target and whether the stop was capped. You receive these by choosing “Any alert() function call” as the alert condition, and they fire once per bar close. It is built with webhooks in mind, for passing signals to external tools.
No repainting
The three conditions, the signals and the win/loss results are all evaluated once the bar closes. It does not pull in data from other timeframes either. As a result, once a BUY, SELL, +1R or -1R label appears, it never disappears or moves to a different bar later.
When watching in real time, no label appears on the forming bar; it shows up the moment the bar closes. That said, the 200 EMA, the SAR dots and the bottom four rows of the stats table (the current bar’s state) do update with the forming bar. Just keep in mind that even if all three rows briefly turn the same color, it is not a signal unless they stay that way until the bar closes.
If you want to step through past price action bar by bar, TradingView’s Bar Replay lets you watch the labels print on confirmed bars exactly as they would live. How far back you can go depends on your plan and timeframe.
Check performance with the stats table, not the Strategy Tester
TradingView’s Strategy Tester report only works with scripts built as strategies. “MSTF” is an indicator, so nothing shows up in the report. Instead, you get the stats table in the top right, and you can review each trade individually through its labels and boxes.
The numbers in the table judge the stop and target using only the high and low of confirmed bars, and count bars that hit both as losses. Since intrabar price action is not considered, the results can differ from real fills. Use it with the understanding that numbers that look good on historical charts will not necessarily play out the same way in real time.
“MACD SAR Trend Filter: 200 EMA Strategy” is an indicator for verifying before you trust
Image“MACD SAR Trend Filter: 200 EMA Strategy” takes the well-known combo of the 200 EMA, MACD and Parabolic SAR and turns it into BUY and SELL signals on confirmed bars where everything lines up, complete with a stop-loss and target for each trade.
To me, its biggest value lies less in the signals themselves and more in the stats table in the top right. Comparing Bitcoin from the 1-minute to the weekly, only the 30-minute and 1-hour finished net positive, the 5-minute, 15-minute and 4-hour came in at ±0R, and the 1-minute, daily and weekly were negative. You can see differences like these just by switching timeframes. Its weakness, losing streaks in the chop, is clear, so check trend strength with something like ADX and start by simply watching the stats table on the symbols and timeframes you trade most.











