This case study is not a description of one client system. It combines recurring requirements from eight completed records involving indicator agreement, higher-timeframe context, lower-timeframe triggers, risk-based sizing, and position management. Names, markets, parameter values, links, and proprietary rules are excluded.
The purpose is to show how a familiar request—“trade when several timeframes agree”—can be turned into an architecture that a trader can inspect and a developer can test.
How a trading brief becomes software
The work moves from a clear request to state logic, risk control, repeatable tests, and documented delivery.
- 01BriefSeparate higher context, setup, lower trigger, exits, and risk permission.
- 02State mapDefine values, bars, validity, expiry, conflicts, and once-per-event rules.
- 03Risk layerCalculate size, verify protection, and cap sequence and account exposure.
- 04EvidenceReplay labelled scenarios and compare logs before broader historical tests.
- 05DeliveryDocument inputs, assumptions, blocked states, recovery, and acceptance checks.
The request
The recurring brief had a higher-timeframe condition for market context, one or more indicator conditions for confirmation, and a faster timeframe for entry. It also asked for stop and target management, optional risk-based volume, and controls over repeated positions.
Written that way, the method sounds complete. It is not yet testable. “Agreement” could mean simultaneous conditions, a remembered setup, or the latest signal from each timeframe. “Closed candle” could apply to the trigger only or to every layer.
The questions
We first separate market meaning from interface options. For every condition, the specification needs the source, timeframe, exact bar, valid state, expiry, and reset. For the group, it needs AND/OR logic, precedence, and the event that is allowed to evaluate a trade.
The risk questions follow before coding the order path: where the protective distance comes from, how the lot is normalized, how much combined exposure is allowed, whether an opposite signal closes or reverses, and which safety control can veto a valid setup.
- Are higher-timeframe conditions filters, setups, or direct signals?
- Must confirmations be simultaneous, or may earlier states remain armed?
- Which candles are final, and what event creates a new decision?
- What cancels a setup before the lower-timeframe trigger arrives?
- What happens when the signal is valid but risk permission is denied?
The architecture
The composite solution uses separate modules. A context module reads the chosen higher bars and produces a stable state. A setup module records whether the required agreement exists and when it expires. A trigger module evaluates the lower timeframe once per permitted event. A risk module decides whether an order is allowed and calculates the intended exposure.
Position management begins only after a confirmed broker result. It supervises the protective stop, target, break-even or trailing state without changing the historical entry signal. Shared logs record both positive states and blocks, so “no trade” can be explained rather than guessed.
The validation path
Validation starts with labelled scenarios, not a long equity curve. The test set includes a valid agreement, an expired setup, a current-bar signal that disappears, a missing higher-timeframe history segment, a duplicated lower event, a blocked risk state, and a rejected or modified order.
Only after those behaviours match the specification does broader historical testing become useful. The goal of the first stage is behavioural equivalence: the code and the written method must make the same decision from the same snapshot.
The lesson
The most important improvement was not another indicator. It was the separation of responsibilities. Once context, timing, risk, and management were independent, changes became safer and test failures became easier to locate.
This composite reflects recurring engineering experience only. It does not reproduce an underlying client strategy and it is not evidence of future trading performance.
Questions you may have
Is this a description of a product sold by POLARIS?
No. It is a composite educational case derived from recurring anonymized development requirements.
Why not publish the indicators and thresholds?
They belong to different private projects and are not needed to explain the engineering lesson.
What was the first acceptance target?
Behavioural equivalence: the specification and the EA should produce the same state and action from the same timestamped data.