FINGER TRADER

Hands-on tutorials

Example 1: MACD Cross

Apply a template, read the wiring and verify a long-only entry and exit step by step.

Updated 18 November 2026

What this example does

When flat, open a long on a MACD Line / Signal Line upward cross. Close the long on a downward cross. Keep one position at a time; do not add on every bar above the signal line. This is a local simulated learning exercise.

For input ports and fixed values, read “Left input port reference” and “Fixed value or strategy parameter?” in Build a visual strategy.

Start in Quant → Strategy Templates. The two basic lessons use the first two cards shown here.
  1. View Rules opens a preview; it does not start trading.
  2. Use Template creates an editable copy in My Strategies. Keep separate copies for the two lessons.

Create and inspect the model

  1. Open Quant → Strategy Templates → MACD Cross → View Rules → Use Template. Name the copy “Lesson 1 · MACD Cross”.
  2. In My Strategies select this copy. Check Fast Length 12, Slow Length 26, Signal Length 9, Source Close, both MA types EMA and Histogram Mode Standard (1×).
  3. Follow Close → MACD Input Price. Send MACD Line to the left value and Signal Line to the right value of both Cross Above and Cross Below.
  4. Connect Cross Above → entry Trigger Condition; connect Cross Below → exit Trigger Condition. Click Check Strategy and save.
Read the graph from left to right: data → indicator → condition → action. This is a wiring reference, not a backtest result.
  1. Close feeds the MACD Input Price. Use the same instrument and timeframe throughout.
  2. MACD Line and Signal Line feed both cross nodes. Their order matters: MACD Line is the left value.
  3. The upward cross triggers entry; the downward cross triggers exit. Blue ports carry numbers; green ports carry conditions.

Read the same logic as rules

Open Condition Rules and compare the two sentences with the canvas. Check Trade Settings on the entry and exit: long-only, flat-position entry, full-position reduce-only exit. Keep the template’s 1 integer unit, 2% stop loss and 4% take profit for this exercise; allocate enough simulated capital for the chosen contract and fees.

Condition Rules presents the same graph as sentences. Editing either view updates the same strategy.
  1. The upper rule opens or adds a position. Keep long-only and the flat-position entry guard for this lesson.
  2. The lower rule closes or reduces the existing long. It must not open a short.
  3. Trade Settings configures sizing and protection separately from the signal. Amounts in the screenshot are illustrative.

Choose data and run

  1. Open Backtest Replay → Replay Settings. Select “Lesson 1 · MACD Cross”, a local OHLCV dataset and a matching instrument/timeframe. The template screenshot uses 15m; choose your available dataset interval consistently in the model and replay.
  2. Select a simulated account and explicitly set the allocated capital, sizing and leverage. If replay uses equity-percentage sizing, review that budget instead of assuming the template’s fixed quantity will apply. Reserve money for fees.
  3. Review the 2%/4% protection and enter the provider fee percentage (for example, 0.1 means 0.1%). Save Settings, then Play.
  4. Pause at the first confirmed fill and use Next Bar to inspect the order, simulated position, price line and execution log together.
Replay Settings is shared by both lessons. The model name and account amounts shown are examples; select your own lesson copy.
  1. Select the lesson strategy at the top, then a local dataset with matching symbol and interval.
  2. Account & Capital selects the simulated account and allocated budget; it does not select another strategy.
  3. Position Sizing & Leverage controls order size. An equity-percentage budget still has to afford at least one integer contract plus fees.

Decide whether a signal is correct

The numbers below are hand-written signal illustrations, not measured backtest returns. Warm-up values are not signals. A valid cross requests an action; an actual fill also requires a valid position state, available funds and the configured execution timing. A stop-loss or take-profit exit can happen without a MACD cross.

  1. Check the signal timestamp against the fill timestamp; a fill may be later than its confirmed signal.
  2. If orders are rejected, read the reason. Do not count an order request or a B marker alone as proof of a completed fill.
  3. Stop and Play starts a fresh execution. Use a manually selected saved run only when you intend to replay previous results.
Decide whether a signal is correct
Previous → current barConditionExpected action
MACD −1.2 / Signal −1.0 → MACD −0.8 / Signal −0.9Cross AboveIf flat, request a long entry
MACD −0.8 / Signal −0.9 → MACD −0.6 / Signal −0.7Still above; no new crossNo new entry
MACD 1.2 / Signal 1.0 → MACD 0.8 / Signal 0.9Cross BelowIf long, request a close

For the current Desktop workflow. Labels and available capabilities can vary by application version and connected provider.