RobustnessIntermediate25 min read

Before inventing a market, decide what it must preserve

A guide to constructing and evaluating synthetic Forex scenarios: representation, dependence, costs, controls and the limits of generated evidence.

The first question about an artificial market should not be whether its chart looks real. It should be which error it can help you discover. Perhaps you want to check that purchases execute at the ask, observe a rule when volatility remains elevated, or investigate whether a model depends on one particular way of clustering movements.

Each objective requires a different scenario. A constant price can be excellent for detecting impossible profits caused by accounting errors. A sophisticated series can be useless for the same test if its many variations obscure the origin of the failure. Generator complexity does not determine usefulness on its own.

A synthetic market is a construction with conditions, not another observed history. This distinction lets us use it ambitiously and precisely: as an instrument for framing questions, exposing mechanisms to controlled situations and discovering dependencies that are difficult to see along a single historical path.

Our scope here is Forex and the investigation of executable rules. All numbers and scenarios are original hypothetical exercises. They do not describe Atlas results, the profitability of its robots or an approved generator. The objective is to design the experiment before multiplying the files it produces.

Purpose acts as a contract

There are at least three uses worth separating. A code test seeks a known answer to expose faults. A sensitivity scenario changes a condition to observe the system’s response. A statistical approximation tries to reproduce relevant properties of observed data. These uses can coexist in a project without automatically sharing the same success criterion.

To test accounting, construct a single trade whose outcome you calculate by hand. To investigate cost sensitivity, hold decisions fixed and vary an explicit convention, or rerun the strategy if the convention affects its decisions. To approximate a market, explain which variables and dependencies your model considers important.

Define the scenario’s permitted use before choosing how to generate it. “Check that no trading occurs during a blocked period” is a verifiable question. “Demonstrate that the robot works in every market” identifies neither a population, a mechanism nor a condition that a handful of simulations can establish.

A minimal contract includes the input the robot will receive, properties you want to preserve, properties you will change and the response you intend to observe. Add a sentence about what the exercise excludes. If liquidity and order size are not modelled, do not present the executions as a capacity study.

Also distinguish a typical scenario from a deliberately adverse one. Multiplying a cost to look for fragility can be useful even when it is not a frequency estimate. Its interpretation is conditional: what would happen under that assumption. Assigning it a probability requires additional work and evidence.

Quality is judged against a question. A collection of visually varied curves cannot establish generator quality until we know what it was supposed to produce. A practical starting point is to write two examples of acceptable output and one example of incorrect output. These examples force a general intention into observable conditions.

Represent prices without losing the units

A generator can produce levels, absolute changes, simple returns or log returns. Each representation requires a different reconstruction. Mixing their conventions can yield visually plausible prices and economically incorrect results. The contract should specify units, frequency, initial price and accumulation rule.

Consider a fictional level of one hundred that rises ten percent and then falls ten percent. It reaches one hundred and ten before finishing at ninety-nine. The two percentages sum to zero, but the compounded return is minus one percent. These large changes make the arithmetic visible; they do not describe typical movements in a currency pair.

With simple returns, each new price equals the previous price multiplied by one plus the return. A value below minus one would produce a negative price; discovering this only at the end is insufficient. With log returns, exponentiating their sum reconstructs a positive level, but that algebraic property does not guarantee economically sensible scales or paths.

A hypothetical level of one hundred rises ten percent to one hundred and ten, then falls ten percent to ninety-nine; adding percentages does not reconstruct the price.
An accumulation convention is part of the generator, even in the smallest example.

Frequency matters as much as the formula. A standard deviation calculated per day cannot simply be copied into each minute. Rescaling it requires assumptions about temporal dynamics. Nor can every interval be treated as identical if the calendar contains closures, gaps or periods without observations.

If you supply candles, impose consistency between open, high, low and close. An open of 1.1000, close of 1.1010 and high of 1.1005 are incompatible: the high lies below the close. Silently repairing this after generation can change the distribution, so retain the repair rule and examine its effect.

A valid candle does not reveal intrabar ordering. When both a stop and a target lie within its range, the high and low do not tell you which was reached first. The simulator needs finer data or an explicit convention. Inventing the path that benefits the strategy turns missing information into an artificial advantage.

Consider a fictional candle opening at 1.1000, reaching a high of 1.1020 and a low of 1.0980, then closing at 1.1005. To isolate ordering, this control omits spread and other costs. An initial purchase has a loss exit at 1.0990 and a profit exit at 1.1010. Both barriers fall inside the candle’s range.

Construct two paths from straight segments, each monotonic between the specified points. The first follows open, high, low and close: it crosses the profit barrier before falling. The second follows open, low, high and close: it crosses the loss barrier first. Both share the same candle. We are not trying to guess which was more likely: the supplied representation lacks the information needed to distinguish them.

This case lets you check the executor’s contract. It can flag an ambiguous observation, request finer detail or apply a previously defined convention and show sensitivity to it. What would be inconsistent is choosing favourable ordering for gains and a different ordering for losses without disclosure. Generating more candles does not resolve the ambiguity if none contains an interior path.

Choose a family for what it lets you control

A parametric family defines a process through equations and parameters. This makes it easier to change some properties separately and know the mechanism behind each sample. Its limitation is equally clear: it represents only what its equations permit, even if you generate millions of observations.

Resampling reuses observed information. It can carry values, residuals or entire fragments, depending on the design. It does not create data independent of the original history. Choosing what stays together is central; the article on block length develops that problem when temporal neighbourhood matters.

A learned generator attempts to capture relationships from data. TimeGAN combines supervised and adversarial objectives to generate sequences, while Quant GANs uses temporal convolutional networks in a proposal for financial series. These are researched mechanisms, not guarantees of fidelity for every currency pair, frequency or application. TimeGAN, Quant GANs.

Family Accessible control Question that remains
Parametric Equations and parameters What does the chosen form omit?
Resampling Values and transported fragments Which dependence does mixing break?
Learned Data, architecture and training What is reproduced, smoothed or memorised?

There is no need to begin with the most complex family. To check a stop, a deterministic path with a known crossing can contribute more than a generative network. To study a rule’s response to varying persistence, a small controllable process can make changes easier to interpret.

Families can also be combined. A volatility dynamic might use shocks drawn from historical residuals instead of a parametric distribution. The arch forecasting documentation distinguishes simulations based on an assumed distribution from bootstrapping standardised residuals. This identifies where variation comes from, not which method will suit your case.

Choose an initial family and write down one problem you expect it cannot solve. This prevents a useful model from becoming a universal representation. Knowing the omission is part of the design. If you later extend the mechanism, you can explain which new question requires that extension and how you will check its contribution.

Build a first world you can explain

Imagine an educational generator of price changes with independent symmetric direction, fixed scale and no predictive information accessible to the rule. Its initial purpose is not to resemble Forex perfectly. It provides a simple world with a known mechanism in which the executor’s conventions can be inspected.

Before running it, decide whether zero means no drift in absolute changes, simple returns or log returns. These statements are not identical after transforming levels. Also document whether scale stays fixed and whether the strategy receives only information available before the next change.

You can compare normal innovations with a heavier-tailed alternative, but a distribution’s name does not specify its scale. NumPy’s standard_t function generates Student’s t draws with specified degrees of freedom. Adding that function does not itself introduce temporal dependence, trading sessions or a spread.

Change a property because it answers a question, not because its name sounds more realistic. If you change tails, scale, drift and frequency simultaneously, any change in the robot has several possible explanations. A sequence of smaller comparisons helps locate which assumption causes the difference.

Begin with a deterministic path containing a few observations, then add randomness, and only then increase the size. At the first step, calculate prices, signals and positions by hand. At the second, verify that the mechanism introduces variation without violating its invariants. At the third, investigate distributions while retaining the earlier controls.

Do not automatically remove a path because it looks unpleasant. Reject it and count the rejection if it violates a declared constraint. If it complies but produces losses, it belongs to the experiment. Filtering on the robot’s outcome turns the generator into a procedure for selecting favourable scenarios.

A small model helps distinguish an error from a surprise. If you cannot explain why a sequence is possible under its rules, examine the generator first. Economic interpretation follows understanding what the program produces and which choices allow those outputs.

A histogram does not preserve time

Two series can contain exactly the same magnitudes in different orders. Consider eight hypothetical magnitudes: four ones and four fours. One sequence groups the ones first and the fours last; another alternates one and four. Their histograms are identical, but they describe different persistence.

A robot that adjusts size to a recent estimate of variability can respond differently to those sequences even before signs are assigned to the movements. The marginal distribution does not determine when large changes arrive or how long their clusters last. That ordering may be central to the question.

The same eight magnitudes are ordered as four ones followed by four fours or as alternating ones and fours; the histogram matches but persistence changes.
Preserving frequencies does not imply preserving temporal relationships.

Cont’s paper on empirical properties of returns examines distributions, extremes and dependence over time and across assets. It helps identify dimensions a purely visual comparison can miss. Its regularities should not become universal values copied without examination into the currency pair, period and frequency under investigation.

For your contract, choose a few properties connected to the strategy. These might include the duration of high-magnitude periods, the speed at which a local scale changes, or the relationship between consecutive sessions. Define how each property will be observed before choosing the generator that best reproduces it.

Matching the average of a property does not imply matching its distribution either. Two generators can produce the same mean duration and very different numbers of long episodes. Several justified measures are more informative than one aggregate score whose economic meaning remains hidden.

Reproducing dependence does not mean discovering profitable predictability. Volatility clustering can help describe uncertainty without offering a directional signal that remains exploitable after costs. Do not move from “the generator preserves this structure” to “the robot can profit from it” without investigating the decision and its execution.

Include prices at which trading can occur

A midpoint path does not contain executable prices on its own. To study a strategy that buys and sells, you need a coherent representation of bid and ask, together with other relevant conventions. A fixed spread can serve as an initial control when clearly identified as an assumption rather than a full market description.

Consider EUR/USD, defining one pip as 0.0001 in this exercise. At the first instant, the midpoint is 1.1000 and the full spread is 0.0002: bid 1.0999 and ask 1.1001. At the second instant, the midpoint rises to 1.1003 and the spread widens to 0.0006: bid 1.1000 and ask 1.1006.

Buying at the first ask and selling at the second bid produces minus one pip before other costs. The midpoint rose three pips. The difference comes from crossing executable quotes under different spreads; no complicated algorithm is needed to explain it. A generator producing only midpoints can leave this possibility invisible.

EUR/USD example: buying at ask 1.1001 and selling at bid 1.1000 loses one pip although the midpoint rises three pips, because the spread widens.
A rising midpoint does not determine the outcome of a trade between ask and bid.

Model together the conditions the robot encounters when deciding and executing. If spread varies with another relevant feature in your data, drawing it independently can alter that relationship. You do not need to assume a universal association beforehand; you need to recognise which dependence is preserved or broken.

Do not charge the spread again as a commission if bid and ask already determined the result. Commissions, slippage and other items need separate definitions. The guide to bid, ask and spread helps examine those conventions before introducing them into a generator.

The execution scenario is also a model. If a large and a small order always receive the same price, the experiment omits their possible interaction with liquidity. You can retain that simplification for a limited question, but the report must prevent its interpretation as evidence of capacity at any size.

Generate several series without breaking their relationships

When a strategy uses several pairs, generating each series separately can create a different environment from the one you intended to study. Contemporaneous and lagged dependencies can matter for signals, exposures and joint outcomes. Comparing individual distributions tells you nothing sufficient about those relationships.

There are also quotation identities to examine. In an idealised example of simultaneous midpoints, EUR/USD at 1.10 and USD/JPY at 150 imply EUR/JPY at 165 through multiplication of the units. Generating that cross independently requires explaining why it departs from the constructed relationship.

This calculation does not demonstrate an executable arbitrage opportunity. That claim would require bid and ask sides, synchronisation, costs and execution conditions. Here it is a consistency check for a simplified representation. Do not turn an identity between midpoints into a promise of available transactions.

Correlation does not summarise the whole problem either. Two datasets can share an average correlation while differing when large movements occur. If the strategy concentrates positions in those conditions, the relevant dependence may sit in a small part of the sample. Define the diagnostic according to the exposure you intend to investigate.

The joint unit must travel through the whole experiment. When normalising columns, retain the transformations and temporal alignment. If some series contain gaps, record how they are handled. If a price belongs to an earlier instant, do not present it as a simultaneous observation merely because it shares a row in a file.

One starting point is to generate a common variable and individual components while making the imposed relationship explicit. This simplicity makes it easier to investigate increased or reduced shared exposure. Do not call it a reproduction of the market until you compare it with the observed properties that motivated the design.

Evaluate the generator before evaluating the robot

Organise evaluation in layers. The first checks invariants: prices and spreads within constraints, temporal ordering, dimensions and candle consistency. The second compares defined statistical properties. The third examines usefulness for a task. Passing one layer does not automatically confer the next.

A small distance between distributions can ignore temporal order. A classifier unable to distinguish real from synthetic samples might lack power or be poorly evaluated. A visual projection can hide relevant differences. These tools provide diagnostics; they require controls and should not be presented as complete demonstrations that two processes are identical.

TimeGAN evaluates similarity and a task involving training on synthetic data and testing on real data. This examines a particular utility of generated data; it does not certify trading profitability. The task, metric and comparison conditions remain part of the claim. TimeGAN evaluation.

Three different layers: file invariants, process properties and usefulness for a task; the robot's economic behaviour requires its own evaluation.
A format check, statistical resemblance and an economic result answer different questions.

Validate the representation without using the robot’s profit as the criterion for realism. If you select the generator because it favours a strategy, both results become connected to that preference. You can subsequently investigate their interaction, but cannot present the chosen scenario as an independent judge of the strategy that chose it.

Retain relevant discrepancies rather than hiding them behind a global average. Perhaps a generator approximates the distribution’s centre well but poorly reproduces long high-magnitude episodes. This can permit an educational use while ruling out an extreme-risk application. The verdict should name the task rather than award an absolute label of realistic.

Prepare an evaluation sheet with a property, a unit and an associated decision on each row. For example, checking OHLC consistency decides whether a file can enter the executor. Comparing episode durations helps decide whether it makes sense to study a rule that depends on them. These decisions differ: a statistical problem is not repaired merely because the format is valid.

Acceptance margins need justification proportionate to the application. Do not invent a universal five-percent tolerance for every measure. A small error in a variable that triggers entry can matter more than a large difference in a variable the robot ignores. If you do not yet know the discrepancy’s impact, describe it and keep the use exploratory.

Nor should you reuse the same diagnostic sample indefinitely without recording adjustments. If you modify the generator whenever a property looks wrong, that sample participates in its selection. A subsequent check should reflect this history and follow a defined plan for evaluating the chosen version. The point is not to prohibit improvement, but to avoid presenting the comparison used for improvement as an independent test afterward.

A useful diagnostic must be able to expose a known defect. Include an altered version that breaks a property: disrupted ordering, constant spread when studying its variation, or misaligned columns. If evaluation cannot detect a relevant alteration, examine its sensitivity before trusting that a pass means anything useful.

Do not recycle information as new evidence

A learned generator uses information from its fitting data. Changing the output seed does not erase that origin. If history reserved for strategy evaluation helped fit or select the generator producing its training data, there is an information pathway you must acknowledge.

The necessary separation begins with provenance, not the filename. A file called synthetic can incorporate statistics, normalisations or decisions based on observations you intended to keep separate. For each generator, retain which data it used and which evaluations influenced its selection.

Partial memorisation is also possible. A model can reproduce fragments very close to its inputs even when the complete file is not identical. Examining similarities and duplicates helps discover some cases but does not guarantee the absence of all memorisation. Keep the diagnostic’s scope alongside its result.

Do not confuse this issue with a prohibition on learning from history. Learning is precisely the purpose of many models. The point is that a new file does not imply informational independence. Interpreting an evaluation requires knowing which information is shared by the generator, the strategy and the criterion used to judge them.

A useful practice is to draw provenance before training: data for fitting, data for choosing decisions and data for a defined later check. Record transformations and versions at each connection. If you change the plan after seeing results, retain that as a new research decision and redefine the claim’s boundaries.

The CSV planned for a demo can help readers learn these distinctions and inspect formats. Its availability belongs within the scope of that demo, currently in preparation. Do not assume other products include data, or that generating derivatives removes restrictions on source material or turns the exercise into Atlas evidence.

Design stress without inventing probabilities

A stress scenario can impose a sequence you want to understand even if you do not estimate its frequency. You can extend a high-variability phase, introduce a defined gap or widen costs according to an explicit rule. The question is how the system responds when those conditions hold.

The arch volatility-scenario documentation shows that ordinary draws can be replaced with designed shocks. This technical capability supports conditional scenarios. It does not itself assign an occurrence probability to the chosen pattern or validate its parameters for Forex.

Avoid presenting one extreme scenario as the worst possible case. Adversity has many dimensions: movement, duration, cost, data availability and account state. The case maximising a single loss may differ from the one producing a chain of mistaken decisions or preventing an exposure from being closed.

Do not turn severity into a contest of larger numbers either. An enormous shock that violates the representation may reveal only a numerical failure. A small persistent change can expose a much more relevant economic dependence. Design each scenario for a specific fragility and explain why that fragility matters.

If adverse conditions are combined, identify the relationships you impose. Separately doubling a scale and a cost does not necessarily describe an observed joint transition. It can be a legitimate sensitivity exercise, provided it is not disguised as a historical frequency or forecast.

A stress result is a conditional response. You can report which constraint activates, when position size changes or which decision becomes inconsistent. That description provides useful research information without converting a constructed scenario into a prediction of when a crisis will arrive.

Controls where part of the answer is known

A good collection includes deliberately simple worlds. With constant prices, an immediate purchase and sale on opposite sides of a positive spread should reflect that cost under the chosen convention. If a profit appears with no other defined source, you have a small case for investigating signs, quote sides or accounting.

Another control compares two inputs that are identical up to the decision instant, followed by deliberately different futures. With the robot’s weights, state and randomness fixed, the earlier decision should match. If it changes when only the inaccessible future is altered, examine possible temporal leakage or labels being used as inputs. This tests dependence on future information; correctly guessing one isolated path would not demonstrate leakage.

For a more precise null control, use integrable absolute price changes with conditional expectation zero given prior information. Fix a finite horizon and bounded positions chosen before the next change. In that world, the sum of position times price change has gross expectation zero. This does not require every sample to finish at zero or every robot always to lose after costs. Integrability excludes distributions without a first moment; zero log drift does not replace this condition on price changes.

You can then introduce a known artificial signal available in time. The purpose is to check whether the process can identify it under declared conditions, not to establish that the same signal exists in Forex. A negative result can reveal label errors, inadequate learning or a task that is too difficult for the sample.

Positive and negative controls answer complementary questions. A negative control asks whether you invent an advantage where the mechanism supplies none. A positive control asks whether you detect deliberately introduced structure. Both need specifications that make failures interpretable, without endlessly adjusting the scenario until the desired outcome appears.

When working with AI, request these small cases and their expected outcomes first. Require inputs, decision times, quotes used and position state to be shown. An executable file and an attractive curve do not replace this inspection. The explanation must be checkable against a manual calculation.

Separate seeds, parameters and families

A new seed changes draws within a mechanism. Changing parameters changes that mechanism within a family. Changing families can alter which relationships are representable. These are three different sources of variation and should appear separately in the study record.

Imagine three families, two configurations per family and five seeds per configuration. That gives thirty runs, not thirty independent market histories. There are six configured mechanisms, each observed through five realisations. Counting experiments must not be confused with the amount of empirical evidence.

Three families times two configurations times five seeds produce thirty runs: six mechanisms with five realisations each, not thirty observed markets.
The generation hierarchy helps locate where variation comes from.

More realisations refine the response to a mechanism; they do not correct its omissions. If a family excludes widening spreads, repetition will not investigate that phenomenon. If parameters were estimated from few episodes, holding them fixed and generating many curves does not remove parameter uncertainty.

When parallelising, manage random streams explicitly. The NumPy parallel-generation documentation explains mechanisms for creating derived streams. Saving that organisation helps avoid accidentally repeating identical draws across workers and makes it possible to reconstruct which sample produced each result.

Do not choose the best seed as representative. Show the planned variation and retain results contradicting the first impression. If a particular case needs investigation, identify it as a diagnostic. Scenario selection can also favour a conclusion. Recording everything executed helps distinguish legitimate exploration from incomplete presentation.

Close the experiment with a defensible claim

A useful result joins four elements: what you wanted to learn, which mechanism you used, which checks it passed and what you observed in the system. Retain the limitations that condition that observation too. A reader should be able to distinguish a code test, a sensitivity analysis and a statistical approximation without guessing from a chart’s appearance.

The technical record needs units, calendar, price representation, costs, fitting data where applicable, parameters and seeds. Save versions and output rejection or repair rules. Keeping only final curves loses the explanation of why some paths were possible and others were not.

You can conclude that a rule changes behaviour when high-magnitude episodes are prolonged within a defined family. You can conclude that the executor fails a spread control. You can also conclude that a generator fails to reproduce a necessary property and therefore does not serve the chosen question. None of these conclusions needs to promise future profitability.

As a final exercise, design three scenarios with ten observations each: one to check units, another to check execution and a third to explore temporal dependence. Write the expected answers for the first two and the uncertainty you want to observe in the third. Then ask another person to interpret the outputs without seeing your explanation.

If they confuse simulation with observed history, improve the labels. If they cannot reconstruct a calculation, improve the specification. If the scenario produces a response you cannot explain, investigate before expanding it. An invented market becomes a scientific tool when its conditions and failures can be discussed precisely.

Three different contracts for a synthetic market: checking code, investigating sensitivity and approximating observed properties.
Purpose determines what a scenario needs to preserve and which conclusions it allows.
Back to the Blog