Skip to content
All strategies

Strategies

EURUSD 1-Hour Close/EMA(5) Cross Execution Plumbing Test: long on cross above, short on cross below, exit after 3 bars or on the opposite cross, 1x, 2%-of-equity fixed size (FX venue, long+short, no session filter, fixed rule; expected outcome fee_edge)

Outcome: Abandoned

EurusdEma5CrossPlumbing

Outcome Summary

This EURUSD 1-hour EMA(5) cross strategy was built as a fixed-rule plumbing test to exercise orders, flips and session-boundary fills, and it was registered in advance as expected to lose to costs. The backtest showed the mechanics working: balanced long and short trades, no liquidations, a clean input audit and no order failures. Economically, though, it lost steadily (-9.34% total, Sharpe -30.6, average trade -0.154%) because the $2 minimum commission swamped a gross edge of about zero. The analyst abandoned it at backtest review after one iteration and noted that the operator's plumbing goal is better served outside the promotion pipeline.

Hypothesis

User-specified execution plumbing test, ported to EURUSD.FX 1-HOUR bars. 1-minute EURUSD bars do not exist on the FX venue, which serves only 1-HOUR and 1-DAY for EURUSD; the user accepted the switch. Instrument and rules are the user's, and only the bar interval changes from 1m to 1h. The rule is FIXED: ema_period=5 and hold_bars=3 are constants with no tunable parameters, as the user requested. RULES: compute EMA(5) of the 1-hour close. Go long when the close crosses above its EMA(5) and short when it crosses……Show moreShow less

User-specified execution plumbing test, ported to EURUSD.FX 1-HOUR bars. 1-minute EURUSD bars do not exist on the FX venue, which serves only 1-HOUR and 1-DAY for EURUSD; the user accepted the switch. Instrument and rules are the user's, and only the bar interval changes from 1m to 1h. The rule is FIXED: ema_period=5 and hold_bars=3 are constants with no tunable parameters, as the user requested. RULES: compute EMA(5) of the 1-hour close. Go long when the close crosses above its EMA(5) and short when it crosses below. Exit after 3 bars or on the opposite cross, whichever comes first. One position at a time, at 1x with no leverage. The strategy trades every hour the FX24_5 calendar is open (Monday 00:00 London to Friday 17:00 New York) with no session filter. The EMA runs continuously across the weekend close, so the first hourly bar of a new week can already produce a decision. That is how this test exercises orders shortly after the market opens. EXECUTION: FX is a session venue, so a decision on bar N's close fills at bar N+1's open (next_open_fill, supported). Decisions made while the market is closed are held to the next session open. No stops or resting orders are used. Weekends are closed market, not data gaps. The 3-bar clock counts session bars only. SIZING: a fixed 2% of account equity in notional (about USD 2,000 on USD 100,000), converted to whole EUR base units and floored at the venue minimum of 1,000 units. That is the user's 'smallest position size relative to equity'. COST NOTE AND EXPECTED OUTCOME: the USD 2.00 minimum commission per order is about 0.10% per side at USD 2,000 notional, so about 0.20% a round trip, plus a spread of about 0.007-0.01%. A 1-3 hour EURUSD EMA-cross move gives a gross capture of about 0.00-0.03%. The average trade will therefore be clearly negative, far below the 0.1% FX fee floor. The user has accepted this outcome. The run is pre-registered as EXPECTED TO END fee_edge, which says nothing beyond costs; the operator intends to promote it to paper manually for plumbing purposes. Risk control route (b): a signal/time exit (3-bar clock or opposite cross) with capped sizing at 2% of equity, far below 100%. Risk profile: book volatility is about 2% x EURUSD's ~7% annual vol, about 0.15% a year, at 0.02x effective leverage. The pnl drag comes almost entirely from commissions. If the only goal is exercising orders, a Lab backtest outside the promotion pipeline is a cheaper route.

The user settled the venue, instrument, interval, fixed rule and expected outcome. The FX venue is nearly unused in the corpus (2 experiments), so this does not add to concentration. No tunable parameters, at the user's explicit request.

Negative expectancy, as the run was pre-registered to show (expected outcome: costs exceed any edge). This EURUSD 1-hour close/EMA(5) cross plumbing test does what the hypothesis says: 2,532 trades, balanced long and short, with flips and 3-bar time exits. On the development period it loses after costs. The average trade is -0.153% of notional against a 0.10% FX floor, with profit factor 0.087, win rate 11.9% and total return -7.44%. The $2 minimum commission per order, about $2.83 per round trip at about $2,000 notional, eats a gross capture of about zero. QA's concern is borne out. Optimization cannot help: the rule is fixed with no tunable parameters, and there is no gross edge to tune toward. This verdict is on economics only. The order, fill, flip and session-boundary plumbing appears to work. The operator's stated goal of exercising orders on paper is better served by a Lab backtest, or a manual paper deployment, outside the promotion pipeline. Nothing is concluded about the held-back period.

Implementation

EURUSD.FX 1-hour close/EMA(5) cross plumbing test. The EMA(5) of the hourly close is seeded with a simple average after 5 bars and runs continuously across weekend closes. A cross up (prev_close <= prev_ema and close > ema) goes long; a cross down goes short. A position exits after 3 session bars counted from the entry fill, or on the opposite cross. The opposite cross closes and flips the position with one market order sized held quantity + new size, so there is only ever one net position. Size = max(1000, floor(0.02 * equity / close)) EUR units, at 1x, with no stops and no session filter. A market decision on a bar close fills at the next session bar's open (FX next_open_fill), and weekend decisions wait for the Monday open.

Implements the user's fixed rule as written, with no tunable parameters: ema_period=5, hold_bars=3, position_pct=0.02, min_units=1000. Risk control route (b): a signal/time exit with sizing at 2% of equity. The hold clock counts primary session bars that close after the entry fill time. An entry filled at bar N+1's open is exited by the decision at bar N+3's close, which fills at bar N+4's open. The flip is one order that is not reduce-only, following the platform's reversal rule, so there is no unsafe close+open pair. Expected outcome is fee_edge, as pre-registered: the USD 2 minimum commission per order is about 0.10% per side at about USD 2,000 notional.

Verification Results

For paper, derive bars_held from position.ts_opened and the count of session bars since then, rather than from an in-memory counter.

The hold clock and EMA state (ema_value, prev_close/prev_ema, held_side, entry_fill_ts, bars_held) are kept only in instance attributes. If a paper node restarts with a position open, they are rebuilt only if the platform's scalar persistence restores them. Otherwise the EMA re-seeds and the hold restarts at 0. The backtest never restarts, so the measurement is unaffected.

No change needed.

min_bars_required() is overridden to return ema_period + 1 = 6, and Layer 1 flags this as base_shadow. The base documents the method as 'Override as needed', so the override is deliberate and harmless. The EMA seeds itself on the first 5 bars it sees.

Pre-registered as fee_edge. At about USD 2,000 notional, the USD 2 minimum commission per order is about 0.10% per side, against an expected gross of 0.00-0.03% per 1-3h EMA(5) cross. Expect an average trade near -0.2% of notional and a cumulative commission drag of roughly 10-15% of equity over about 2 years (the sandbox made 4,419 trades in 738 days). The run exists to test execution plumbing. It has no edge to measure, and the analyst should treat the result that way.

Backtest Review

Sharpe
-30.61
Total return
-9.34%
Max drawdown
9.34%
Trades
3194
Win rate
10.8%
Profit factor
0.08

The plumbing works as described. There are 2,532 closed trades over about 420 development days, split exactly 1,266 long and 1,266 short, which is what a symmetric EMA(5) cross rule should produce. There were no liquidations, the input audit is clean, and the reviewed vendor gaps are accounted for.

Commission was $7,169 over 2,532 trades, about $2.83 per round trip. That fits the $2 minimum per order, with flips sharing one order between the close and the new entry. Gross capture before commission and spread is about zero (about -$0.11 per trade), as the hypothesis predicted.

The average trade is -0.153% of notional, against a 0.10% FX floor. Profit factor is 0.087, win rate 11.9% and Sharpe -28.9. Every month lost money, and total return is -7.44% with a 7.44% drawdown that never recovered.

Costs are all there is. With gross capture near zero, no fixed-rule look can produce an edge, and the hypothesis has no tunable parameters anyway (tunable = {}). Optimization would be one frozen replay with nothing to search.

Outcome Summary

Small fixed-size FX tests are dominated by the per-order minimum commission, so pure execution or plumbing tests should go through a Lab backtest or a manual paper deployment instead of the promotion pipeline.

At backtest review the analyst voted to abandon on economics. The $2 minimum commission per order (about $2.83 per round trip at about $2,000 notional) consumed a gross capture of about zero, which put the average trade far below the 0.10% FX floor. With a fixed rule and no tunable parameters, optimization could not help, so optimization, analyst and risk stages were never reached.

A user-specified execution plumbing test on EURUSD.FX 1-hour bars that goes long when the close crosses above its EMA(5) and short when it crosses below, exits after 3 session bars or on the opposite cross, and uses a fixed 2%-of-equity size at 1x. It was pre-registered as expected to lose to costs (fee_edge), not as an edge claim.

Over the full-history backtest (2024-10-28 to 2026-11-02) it closed 3,194 trades, split evenly long and short. Total return was -9.34%, Sharpe -30.6, average trade -0.154% of notional, win rate 10.8% and profit factor 0.077. Commission of $9,038 was about 1,166% of gross PnL. The backtest review's development-period figures were similar: 2,532 trades, -7.44%, Sharpe -28.9, average trade -0.153%.

Backtest and paper results are hypothetical. Trading involves risk of loss.