Alert Setup Guide

How to Set EMA Crossover Alerts on TradingView

Set an alert between two EMA plots, confirm the crossing direction and timeframe, and distinguish an example EMA pair from a tested trading strategy.

Setup Steps

1

Add and identify the two averages

Add two exponential moving averages and set their lengths and price sources. For an illustrative setup, use 9 and 21 with the same source and timeframe. Label the intended fast and slow inputs in your notes; these values are examples, not the best settings for a market.

2

Compare the two plotted series

Open Create Alert. Select the fast EMA plot, a Crossing up operator and the slow EMA plot as the other operand where offered. Use Crossing down for the reverse event. Do not accidentally compare an EMA with a fixed price or the symbol’s close. If a custom variant does not expose both plots, use a script with a documented crossover condition.

3

Distinguish event from continuing state

A crossover occurs when relative ordering changes. Fast EMA remaining above slow EMA is a state that can persist for many bars. Decide which you need before choosing the condition. The term golden cross usually refers to a longer-term 50/200 moving-average comparison; name short-period alerts by their actual lengths.

4

Save the alert context

Choose the frequency, expiry and notification method in your account. For a rule defined on completed candles, select Once Per Bar Close where available. Record the symbol, timeframe and inputs. Recreate the alert after changing the script or its inputs; the running alert retains its saved configuration.

5

Verify delivery on new market data

Treat chart inspection and delivery as separate checks. Bar Replay can help inspect historical plots, but server alerts continue using live data. Check a new event against the alert log, then check the chosen notification channel. This is a test procedure, not a claim that delivery or investment performance has been tested here.

Alert Conditions Reference

Conditions to define and verify for the selected indicator.

Feature comparison table: Signal vs Notes
ConditionSignalNotes
Fast EMA crosses above slow EMAThe faster average moved above the slowerA lagging change in relative averages, not a guaranteed upward move.
Fast EMA crosses below slow EMAThe faster average moved below the slowerThe rule still needs an exit, position size and cost assumptions before it becomes a strategy.
Fast EMA remains above slow EMAPositive ordering stateUse a greater-than rule for a state; it is not interchangeable with a single cross event.
Three-EMA orderingA separately defined composite conditionSpecify whether all three must cross on one bar or merely finish in a chosen order.

Parameters to record and evaluate

Examples describe the configuration, not validated trading settings.

Feature comparison table: Starting value or requirement vs Description
ParameterStarting value or requirementDescription
Fast length9, exampleChoose a length before evaluating later data; do not optimize by repeatedly selecting the best recent result.
Slow length21, exampleKeep it distinct from the fast length and document the pair in the alert name.
SourceSame source for both, initiallyHLC3 and OHLC4 are alternative price averages; neither guarantees earlier or more reliable signals.
TimeframeExplicitly selectedAn event on a one-minute chart is not the same calculation as a five-minute crossover.

FAQ

Alert Setup FAQ

How do I configure a 50/200 EMA alert?
Set the two EMA lengths to 50 and 200, then compare their plots in the desired direction. Choose and record the chart timeframe. This defines an alert, not evidence that a bull or bear market will follow.
Why can an alert disagree with the current chart?
Check saved inputs, timeframe, the chosen plots and intrabar versus close timing. A running alert is not automatically updated when chart settings change.
Can a crossover reverse before close?
Yes. The current price affects the developing averages. A condition that was true intrabar can be false by close, which is why the required confirmation time must be explicit.
What is the best EMA pair for scalping?
No universal pair or win rate is established here. Compare responsiveness, turnover, costs and drawdown with fixed rules and later data.
When is custom code useful?
When you need an exact combination such as a crossover, a volume threshold and a session restriction. Specify those conditions, validate the resulting code and test the alert separately.

Need a custom alert rule?

Describe the condition in Pineify’s coding agent, then review the generated Pine Script and test its timing and delivery in TradingView.

Explore Pine Script coding