Example: BTC while Close holds above its 50-day EMA
This example uses an indicator and a duration: BTC's daily close holding above its 50-day exponential moving average for three consecutive days. It shows how to put a calculation on the chart, compare two measurements, and why warm-up matters.
On this page · 7 sections
The question
After BTC's close has held above its 50-day EMA for three days in a row, what did the close do over the following days? The condition describes a trend state; the study describes what followed in the period you choose.
Put the EMA on the chart
- In Explore on 1d candles, choose Add to chart and search
EMA.ResultThe chooser lists Exponential moving average under Indicators & calculations.
- Choose it, set the input to Close and the period to 50.
ResultThe configuration shows the unit (USDT per BTC, the same as Close) and the daily bars it needs to initialize.
- Add it. Display on recommends the price pane because an EMA of Close is in the price unit.
ResultThe EMA draws as a line on the price pane and appears in On chart with its value at the latest loaded bar.

Pin a few candles and read the EMA in Inspect › Measurement, including its percentile in the research range and How it's calculated. Putting the EMA on the chart is optional for the condition; it just lets you see it.
Write the condition
- Open Find matches and choose Close as the measurement.
ResultThe row starts with Close.
- Choose Greater than, then Another measurement.
ResultThe right side opens the same chooser; pick Exponential moving average and set input Close, period 50.
- Set Duration to For consecutive days and enter 3.
ResultThe row reads Close is above the 50-day EMA of Close for 3 consecutive days.
- Read Matches.
ResultMatching, Not matching, Unknown and Excluded, plus True before duration — the days Close was above the EMA before the 3-day requirement.
A state, not a crossover
After the match handles this for you: each run of matching days is one episode, measured once from its confirmed onset — here, the third day above the EMA after a day that didn't qualify.
Warm-up and unknown days
An EMA needs several times its period of daily history before its first value, as its configuration says. At the start of the accepted data, the first months are Unknown (insufficient history) — not false and not zero. A research range that starts later reads the needed history from before the range, so warm-up mostly matters near the beginning of accepted coverage.
Read After the match
- Switch to After the match and choose Run study.
Resultmatching days → episodes → confirmed onsets. Expect far fewer onsets than matching days for a trend state.
- Read 3D, 7D and 30D, each against the BTC reference.
ResultFor each horizon: N measured of M confirmed onsets, sign counts, and the two distributions.
Trend states tend to have few onsets, so N is small. Read N before the median, and treat a period that was mostly trending one way as a description of that period. See Interpreting outcomes.
Backtest it
- Choose Use in Strategy Builder.
ResultThe Builder's entry rule reads Close > 50-day EMA of Close for 3 consecutive days.
- Under Exit conditions, choose Add exit condition and write Close Less than Another measurement → the same EMA(50) of Close.
ResultAn exit lane reads Exit when this holds: Close < 50-day EMA of Close, checked on each completed daily bar.
- Set Maximum holding period as an upper bound, for example 30 daily bars.
ResultMaximum hold and the exit condition are joined by or: whichever comes first closes the trade.
- Keep Scheduled daily · 9:00 AM ET (required for calculations and durations), review costs, then Validate strategy → Continue to Backtests → Run backtest.
ResultA completed report with its trades.
While a position is open, the entry condition can stay true day after day; the engine holds one position at a time, so those days are skipped as overlapping signals and listed in the technical audit. If a trade closes on the 30-bar maximum hold while Close is still above the EMA, the next qualifying day can enter again inside the same episode, so the trade count is not the onset count. In Trades, How trades ended shows how many trades closed on the exit condition versus the maximum hold.