TL;DR. You're going to build a short-biased EMA crossover with two features that separate it from the toy version: a cooldown that prevents machine-gunning entries in trending markets, and dynamic exits computed relative to your actual fill price. By the end you'll have a complete, tested strategy and you'll have used every category of node in the palette.
What you'll be able to do
- Wire indicators into logic into order management on a real canvas.
- Use the Trade Management hub to compose entries and exits without duplicating wiring.
- Read your first backtest result and know whether the strategy is worth keeping.
Two ways to do this
The interactive canvases below let you actually wire the nodes inside this page. You can also open the Visual Builder in another tab and follow along with your own canvas — whichever you prefer. The end result is identical.
What we're building
A short-only strategy that enters when the 20-EMA crosses below the 40-EMA (bearish momentum), exits at ±10 points from the actual entry, and refuses to re-enter until the 20-EMA has climbed clearly back above the 40-EMA (the cooldown).
The reason for each piece:
- Two EMAs and a comparison — the entry signal. Standard, well-known, well-understood.
- Cooldown logic — prevents the strategy from re-firing every bar while EMAs stay crossed during a strong trend (the most common reason new strategies machine-gun losses).
- Dynamic exits relative to entry price — the targets and stops follow your actual fill, not a hardcoded price. This is what makes the strategy work across different price levels and different market conditions without constant manual adjustment.
It's not a profitable strategy as written. It's the shape of a real strategy, and it uses every category of node you'll encounter on the canvas.
Step 1 — Drop the two EMA nodes
Open the Indicators category in the palette. Drag two EMA nodes onto the canvas. Set the first to Period 20 (fast). Set the second to Period 40 (slow).
Both EMA nodes should be on the same data series — your default symbol and timeframe (MES 5m works fine for following along).
Step 2 — Define the bearish crossover
From the Logic & Flow category, drag a Comparison node onto the canvas. Set its operator to < (less than).
Wire the EMA 20 output into Input A. Wire the EMA 40 output into Input B.
You've now expressed: "The 20-EMA is below the 40-EMA" — the bearish state. The Comparison node's output is a boolean that flips to true whenever this is the case.
Why a comparison and not a crossover node
A pure "less than" comparison stays true for the entire time the fast EMA is under the slow EMA, not just at the crossover moment. That's intentional — combined with the cooldown we're about to build, this gives us one entry per crossover event instead of either a single bar-edge trigger (which can miss in fast markets) or a continuous fire-every-bar machine-gun.
Step 3 — Build the cooldown (reset) condition
The cooldown answers a specific question: "After we enter, what has to happen before we're allowed to enter again?" For this strategy, the answer is "the 20-EMA must climb back above the 40-EMA by at least 1 point." That's a clean reset of the bearish state.
To express that:
- From Math & Operators, drag a Constant node. Set its value to
1. - Drag an Add node. Wire EMA 40 into Input A and the Constant 1 into Input B. The output of this node is "EMA 40 plus 1 point."
- Drag a second Comparison node, this time set to
>(greater than). Wire EMA 20 into Input A and the Add output into Input B.
This second comparison expresses: "The 20-EMA is above the 40-EMA + 1 point." That's the reset condition.
Open the "Comparisons" folder and drag the "Greater Than" node onto the canvas.
Step 4 — Place the entry hub
From the Order Management category, drag the Entry item onto the canvas. Two things happen automatically:
- An Enter Trade node appears (the action — the thing that places the order).
- A Trade Management node appears, already connected to it (the hub from which you'll spawn the exit logic).
On the Enter Trade node, set:
- Direction:
Short - Order Type:
Market
Now wire:
- The output of your first Comparison (the bearish signal) into the Entry's condition input.
- The output of your second Comparison (the reset / cooldown) into the Entry's cooldown input.
Open the "Order Management" folder and drag the "Entry" node onto the canvas.
The strategy now reads: "When the 20-EMA crosses below the 40-EMA, short the market. Don't allow another short until the 20-EMA has climbed back above the 40-EMA + 1 point."
That's a complete entry layer. Next we build the exits.
Step 5 — Spawn the exit nodes from the hub
Look at the Trade Management node you placed in Step 4. Notice the three buttons inside it: Target Profit, Stop Loss, Entry Price.
Each button is a "spawn point" — drag it onto the canvas to create a connected node:
- Drag Target Profit → creates a Set Target Profit node, pre-wired to the trade management hub.
- Drag Stop Loss → creates a Set Stop Loss node.
- Drag Entry Price → creates an Entry Price data node that emits the actual fill price of the trade.
Open "Order Management" and drag "Trade Management" onto the canvas.
The Trade Management hub is the cleanest way to wire exits. Spawning from it auto-connects the exit nodes back to the right trade, so you don't have to drag wires across the whole canvas. Use this pattern in every strategy you build.
Step 6 — Compute the targets relative to entry
We want our target 10 points below the entry (it's a short, so down is profit) and our stop 10 points above the entry (up is loss).
- From Math & Operators, drag a Constant node. Set its value to
10. - The target. Drag a Subtract node. Wire Entry Price into Input A and Constant 10 into Input B. Wire the result into Set Target Profit.
- The stop. Drag an Add node. Wire Entry Price into Input A and Constant 10 into Input B. Wire the result into Set Stop Loss.
Double-click the "Entry Price" button inside the Trade Management node.
The exits are now relative to your actual fill. If you enter at 4290.25, your target is 4280.25 and your stop is 4300.25. If you enter at a different fill, both numbers move with you. This is what makes the strategy work at any price level without per-trade tweaking.
Step 7 — The final graph audit
The graph should now read left-to-right: indicators on the left, logic in the middle, order management on the right.
Start by dragging a new "Constant" node onto the canvas.
Trace it once more in plain English:
"Run the 20-EMA and the 40-EMA on this data series. When the 20-EMA is below the 40-EMA AND the cooldown condition (20-EMA back above 40-EMA + 1) is currently met, short the market. Manage the trade with a target 10 points below entry and a stop 10 points above entry."
That's a complete strategy. Every node has a job. Nothing is unwired.
Step 8 — Run a backtest
In the toolbar at the top of the Visual Builder, click Run Backtest.
Strategy Parameters
Click the 'Start Date' input to select March 21, 2024.
Backtest Period
Time Range
Series Manager
In the configuration panel:
- Symbol: MES (or whichever you used).
- Timeframe: 5m.
- Date range: a 2–5 year window.
- Commission:
$0.62round-trip (realistic retail rate). - Slippage:
Realistic. - Simulate Fills: leave off for this first run (we want fast iteration).
Run. Wait 30–60 seconds. The Analytics view opens automatically.
Reading your first result
The strategy won't be profitable — this is a deliberately basic shape, not an edge. That's fine. The point of this exercise is the wiring, not the PnL.
Three numbers to look at:
- Total trades. Should be in the dozens to low hundreds over a multi-year window. Far more means the cooldown isn't doing its job. Far fewer means the crossover didn't happen often enough.
- Win rate. Probably 30–50%. That's normal for a crossover strategy with fixed exits.
- Profit factor. Probably 0.7–1.1. Below 1.0 means you lost money over the test. Slightly above 1.0 is "this is a real shape but not a real edge."
Then open the equity curve. If it descends in a roughly straight line, the strategy is consistent-but-losing — there's nothing structurally broken about the wiring, the signal just isn't an edge in the tested period.
The first strategy is for learning the platform, not for trading. Real strategies need a real edge — usually some combination of a higher-timeframe filter, a volatility filter, or a regime detector layered on top of a simple crossover like this. The strategy design section covers what those look like.
What you just used
In one strategy you've now used every major category in the palette:
- Indicators — two EMAs.
- Logic & Flow — two Comparison nodes for the entry signal and the cooldown.
- Math & Operators — Constants, Add, Subtract for the dynamic exits.
- Order Management — Enter Trade, Trade Management, Set Target Profit, Set Stop Loss.
- Data — the implicit Entry Price emitted by the Trade Management hub.
This is the canonical "left-to-right" structure every AlgoLift strategy uses. The complexity comes from the math and the conditions, not from the structure.
Common mistakes (and how to fix them)
- Forgot the cooldown. Strategy fires every bar the condition is true. Symptom: hundreds or thousands of trades in a 2-year window, almost all losing. Add the second Comparison and wire it into the Entry's cooldown input.
- Used
<=instead of<(or vice versa). Symptom: trade count slightly off from expected. Both work for this strategy; pick one and stick with it. - Wired the exits to the wrong direction. A short with a Target Profit above entry is a strategy that exits for a loss every time the trade goes the right way. Symptom: every "win" is tiny and every "loss" is your full stop distance. Swap Add and Subtract on the target and stop.
- Set Simulate Fills on for the first run. Slows iteration without changing anything useful at this stage. Leave it off until the strategy is interesting enough to want a decision-grade test.
Where to go from here
You now know the workflow:
- Improve this strategy. Replace the fixed 10-point exits with ATR-scaled exits. Add a higher-timeframe trend filter. See what each change does to the backtest.
- Read the foundations. Backtesting explained, overfitting, risk management, trading metrics. These four pages cover the math that separates serious strategy work from trial and error.
- Explore real strategy patterns. The strategy design section covers momentum, mean reversion, and breakout — three families of strategies that account for most of what works in retail systematic trading.
- Or take the structured path. The Algotrading-101 Academy is the alternative if you'd prefer a linear, curriculum-style learning sequence with knowledge checks and labs at each step.