> ## Documentation Index
> Fetch the complete documentation index at: https://docs.askfutures.com/llms.txt
> Use this file to discover all available pages before exploring further.

# EMA cross with stop and target (ES)

> Turn a classic EMA crossover into a backtested ES strategy with a fixed dollar stop and profit target.

This is the friendliest place to start with a structured exit. You'll take a
classic moving-average crossover and bolt on a fixed dollar stop and a fixed
dollar target — the two most common ways traders cap a loss and book a win.

By the end you'll have a saved strategy, a backtest, and a feel for how changing
the stop and target reshapes the results.

<Info>
  **You'll learn:** an EMA(9)/EMA(21) crossover entry, a `$500` stop and `$1,000`
  target, and how to read the exit reasons. **Time:** about five minutes.
</Info>

## The idea, in one sentence

When the fast moving average crosses up through the slow one, momentum has turned
up — go long. Then risk `$500` to make `$1,000` on each trade: a 2-to-1
reward-to-risk shape.

## Step 1 — Describe it

Open a new chat and type the idea exactly as you'd say it to another trader:

> Buy ES on an EMA(9)/EMA(21) cross with a $500 stop and a $1,000 target.

That's the whole prompt. You don't pick bar sizes, date ranges, or directions —
AskFutures fills in sensible defaults and shows you what it chose.

<Note>
  Because you didn't say otherwise, AskFutures applies its silent defaults: the
  **last 1 year** of data, **Day Trading on 1-minute bars**, and an
  **end-of-day exit** so no position is carried overnight. It also makes the
  strategy **both directions** unless you ask for long-only. Want longs only?
  Just add *"longs only"* to the prompt.
</Note>

## Step 2 — Read the strategy card

AskFutures builds the strategy and shows you a card. Skim it before you backtest —
this is where you confirm it understood you.

<Steps>
  <Step title="Market">
    `ES` (E-mini S\&P 500). See [choosing a symbol](/guides/choose-a-symbol) if
    you'd rather trade the micro, `MES`.
  </Step>

  <Step title="Entry rule">
    Go long when the **9-period EMA crosses above the 21-period EMA**. Because the
    strategy is both-directions by default, it also goes short on the opposite
    cross.
  </Step>

  <Step title="Exit rules">
    A **$500 stop loss**, a **$1,000 profit target**, and an **end-of-day close** —
    whichever comes first. These are *structured exits*; see
    [risk & trade management](/concepts/risk-and-trade-management).
  </Step>

  <Step title="Parameters">
    The tunable numbers are surfaced for you — typically `ema_fast = 9`,
    `ema_slow = 21`, `stop_loss = 500`, and `target = 1000`. These are exactly
    what the [optimizer](/concepts/optimization) can sweep later.
  </Step>
</Steps>

The card also includes a **Strategy Flow** chart so you can see the logic at a
glance:

```mermaid theme={null}
flowchart LR
  C["EMA(9) crosses<br/>above EMA(21)"] --> L["Go long ES"]
  L --> X{"First to hit?"}
  X -->|"-$500"| S["Stop"]
  X -->|"+$1,000"| T["Target"]
  X -->|"day ends"| E["EOD close"]
```

<Tip>
  Check the **Assumptions** and **Issues** notes on the card. That's where
  AskFutures tells you what it inferred (for example, the 1-minute bars) and
  flags anything it couldn't add — so you're never guessing.
</Tip>

## Step 3 — Run the backtest

Ask for it in plain English:

> Backtest it.

A fixed, deterministic engine replays a year of real ES prices one bar at a time,
applying your exact rules. It reports P\&L, win rate, drawdown, and a full trade
list — each trade tagged with *why* it closed (`stop`, `target`, or
`session_close`). The same rules on the same data always produce the same
numbers; the [AI never invents results](/concepts/is-the-backtest-real).

<Warning>
  Backtest results are **hypothetical and simulated**. No real trades were placed,
  so live outcomes can differ (liquidity, slippage, and execution delays are not
  the same as a replay). Reported P\&L is net of modeled slippage (default **1
  tick**) and commission (default **\$2.50/side** for full-size ES). Past
  performance — actual or simulated — does not guarantee future results. Always
  test before you trade.
</Warning>

## Step 4 — Read the exit mix

The single most useful thing on the results panel for this strategy is *how the
trades ended*. Sort or scan the trade list by exit reason:

* **Lots of `target` exits** means the 2-to-1 shape is doing its job.
* **Lots of `stop` exits** means the entry is catching too many false crosses.
* **Lots of `session_close` exits** means trades are still open at the bell —
  the stop and target are spaced wide relative to a single day's range.

That mix tells you what to change next.

## Step 5 — Iterate

Keep chatting. Each edit becomes a new saved version you can
[compare](/guides/version-and-compare) side by side.

<AccordionGroup>
  <Accordion title="Tighten or widen the risk" icon="arrows-left-right-to-line">
    > Change the stop to $300 and the target to $900.

    A tighter stop usually means more `stop` exits but smaller losers — watch
    whether win rate falls faster than the average loss shrinks.
  </Accordion>

  <Accordion title="Make it long-only" icon="arrow-up">
    > Only take long trades.

    Useful when you only want to trade with an up-cross and ignore the shorts.
  </Accordion>

  <Accordion title="Add a trend filter" icon="filter">
    > Only go long when the 50-period EMA is rising.

    Thinning out counter-trend crosses is the classic next move. See
    [signals & indicators](/concepts/signals-indicators-series).
  </Accordion>

  <Accordion title="Let the optimizer search" icon="gauge-high">
    > Optimize the fast and slow EMA periods and the stop and target.

    The [optimizer](/guides/optimize-a-strategy) sweeps the parameters across a
    range and ranks the combinations — no manual trial and error.
  </Accordion>
</AccordionGroup>

<Warning>
  This example is **illustrative, not a recommendation**. A bare EMA crossover is
  one of the most-tested ideas in trading and is not, on its own, profitable. The
  point is to show you the build-backtest-iterate loop, not to hand you an edge.
</Warning>

## Next steps

<CardGroup cols={2}>
  <Card title="Trend pullback with adaptive risk" icon="arrow-trend-up" href="/tutorials/trend-pullback-adaptive-risk">
    Step up to ATR-based stops, a daily-trend filter, and an RSI trigger.
  </Card>

  <Card title="Risk & trade management" icon="shield-halved" href="/concepts/risk-and-trade-management">
    Every exit type explained: stops, targets, trailing, max-time, EOD.
  </Card>

  <Card title="Optimize a strategy" icon="gauge-high" href="/guides/optimize-a-strategy">
    Sweep the EMA periods, stop, and target instead of guessing.
  </Card>

  <Card title="Iterate & refine" icon="arrows-rotate" href="/guides/iterate-and-refine">
    How to chat your way from a rough idea to a tighter strategy.
  </Card>
</CardGroup>
