TradeReign
Back to HomeEducation HubCompatibilityAboutDisclosures
Futures Trading Education

How to Build and Test a Mechanical Trading System

A mechanical trading system needs a rule for what happens after the signal. Use the two fictional MES sessions below to practice deciding which order was working, when it expired, and whether either outcome belongs in your trade results.

Quick Answer

Write the market, time window, signal, order, cancellation and exit rules before you replay the chart. Then check that two people following those rules agree on each entry, cancellation and exit. You can follow the rules manually or automate them later.

Start 7-Day TrialCopy the sample rulesCompare a fill and a cancellationCheck a partial fill while cancelingCheck replay agreement and costs

Write rules someone else can follow

Start with an idea such as buying a pullback after an opening breakout. Decide which bars define the range, which close can qualify, and where the order sits. Use the same contract, session settings and bar timestamps in both replays.

In this exercise only the 9:50 close can qualify. An equal close fails the strict comparison. Submit the simulated order after that close and let it work through the bar ending 10:00. The high or low of the 9:50 signal candle happened before the order became eligible.

For these examples, count a resting limit as filled at its limit only when a later bar trades through the level while the order is working. This is a replay convention. Live fills depend on the actual order and market. Confirm cancellation in the order log before treating a working order as gone.

Version 1 · fictional replay only
Market: one dated MES contract, standard 5-minute bars, New York time
Reference: highest high of the bars ending 9:35, 9:40 and 9:45
Signal: the 9:50 close is strictly above that high
Entry: after that close, work one buy limit at the range high
Cancel: cancel the unfilled entry at the 10:00 close
After fill: stop 1 point below entry, target 2 points above entry
Time exit: at 10:30 send a market exit if still in the position
Daily cap: one entry attempt; skip sessions with missing required bars

Replay the same signal with two different outcomes

Both sessions have a 6,002.00 opening-range high and a 6,002.75 close at 9:50. A one-contract buy limit at 6,002.00 becomes eligible after that close. In the first replay, the 9:55 low reaches 6,001.75 and the model fills the entry at 6,002.00. The low stays above the 6,001.00 stop. The next bar reaches 6,004.25, so the model fills the 6,004.00 target.

In the second replay, the 9:55 and 10:00 lows both stay at 6,002.50. Cancel the unfilled order at 10:00. The 10:05 bar trades down to 6,001.75, but the order has expired under the rule. Log the qualifying signal, the submitted order and the cancellation. The later rally adds no profit to the record.

One opening-range signal, two order outcomes

Synthetic MES 5-minute candles. Times are bar closes in ET.

Marked bars · 9:50 A / 9:55 B / 10:00 C

Price levels · 6,002 Limit / 6,001 Stop / 6,004 Target

A is the qualifying 9:50 close. B trades through the limit while it is working. C trades through the target on the following bar.

Write a mechanical rule for a partial fill at the cutoff

The chart exercise uses one contract and an immediate simulated cancellation. If your plan allows several contracts, write down what happens to the unfilled quantity at the cutoff and what happens to the position already open. A cancel request and a cancellation confirmation are separate events.

In this fictional order log, the plan works a buy limit for three MES contracts, cancels any unfilled entry at 10:00 ET, and keeps the original exit rules for filled contracts. One contract fills before the cutoff. Another fills while the cancel is pending. Only the last contract is canceled.

Record one submitted entry order, two contracts filled, one contract canceled and two contracts open assuming no exits. The plan stops new entries at the cutoff. The filled quantity still needs its exit rules. Match the stop and target quantities to the actual position in the account and verify the cancellation separately. On replay data without order events, mark this sequence unknown or label your simulated fill assumption.

Fictional three-contract entry at the 10:00 ET cutoff
TimeOrder eventFilledUnfilled
9:58:00First fill12 working
10:00:00Cancel requested12 pending cancel
10:00:01Second fill21 pending cancel
10:00:02Cancellation confirmed21 canceled

Check that two traders get the same results

Give a second reader the same rule sheet and candle data. Ask each person to log the range high, signal time, order status, entry and exit prices, and the reason for a cancellation or skip. For these two sessions the expected totals are two signals, two submitted entries, one filled entry and one unfilled cancellation. There is one closed trade.

The filled example gains 2.00 points, or eight MES ticks. At $1.25 per tick, that is $10 gross. With fictional round-trip fees of $1.50, the example nets $8.50. If an independently modeled exit is one tick worse, net falls to $7.25. The one-point stop represents $5 of price risk before fees and slippage. It does not cap the live loss at $5.

If the stop and target both appear inside a later candle, check smaller bars or tick data for the order of events. If the sequence stays unknown, flag it and report how different fill assumptions affect the result. Record the earliest timestamp you could know the signal and the earliest fill allowed by your platform’s settings.

Use earlier sessions to find and clarify ambiguous rules. Freeze the rule sheet and its fill model before testing later sessions you have kept apart. Track signals, submissions, fills, cancellations, net results after modeled costs, and drawdown. If you change a rule after seeing the later set, record a new version and use another untouched sample for the next check.

Sources

Official References

Platform details on this page were checked against these official resources.

CME Globex order statesCheck the difference between a pending cancel and a completed cancellation.CME Group MES tick valueVerify the outright contract tick size and dollar value.CME Group futures order typesReview limit orders, stop orders and how long orders can remain active.TradingView broker emulator and Bar MagnifierCheck how bar data, order timing and lower-timeframe data affect historical fills.
Related Guides

Keep Building the Rule System

Compare mechanical and discretionary trading

Decide which decisions should follow fixed rules and where judgment can help.

Use a futures trading plan template

Document risk limits, session preparation and how you will review trades.

Learn how futures limit orders work

Check what price a limit controls and why a touch may go unfilled.

FAQ

Common Questions

Does a mechanical trading system need to be automated?

No. You can execute it manually if the rules tell you which data to use and what action follows. Automation is a separate choice about who or what submits and monitors the orders.

Do you count a valid signal with an unfilled order as a trade?

Keep it in the signal and order records. It contributes to your fill-rate denominator. With no entry fill, it does not belong in closed-trade results.

Risk Disclosure

Futures trading contains substantial risk and is not suitable for every investor. TradeReign is a trading-discipline and rule-enforcement application. It does not provide trading advice, trade signals, investment recommendations, or performance guarantees.

TradeReign is not a broker-dealer, futures commission merchant, or investment advisor.

Futures trading contains substantial risk and is not for every investor. An investor could potentially lose all or more than the initial investment. Only risk capital - money that can be lost without jeopardizing financial security or lifestyle - should be used for trading. Past performance is not necessarily indicative of future results.