The trader’s journeyIntermediate22 min read

What a trading robot demo can help you decide

Build an evaluation dossier from a Forex robot demo, reconcile discrepancies, and decide whether to study further, pause, or reject.

Hands assembling a wooden sailboat with a fuchsia sail beside an open window
A small sailboat takes shape on the workbench. Concept photograph.

The chart ended before the evaluation began

Mara has the replay report open on one side of her screen and a blank notebook on the other. In this fictional case, a Forex strategy written in Python has just drawn the cleanest rising line she has seen all evening. She reaches for the button to run it again, then realizes she has no idea what the second run would settle. Would it help her understand the rule, decide whether the files suit her workshop, or explain how a simulated event was attributed?

Each question would send her to a different part of the exercise. She writes down the run identifier before touching the settings. The package, report, and discrepancies in this story are fictional. Mara chooses the environment for her own independent workshop and assembles a generic broker adapter backed by a local test double. Every request and event stays inside the simulation, with no broker connection.

Her actual project is modest. She wants an inspectable example for a small research workshop on the life of a signal, from a row in a data file to a decision recorded by the program. She also wants to see what happens when two instances have activity on the same symbol.

If the case is comprehensible and reproducible, she can use it to teach reconciliation. If the files leave an essential boundary unexplained, she can send a precise question or find another specimen. Switching on live execution plays no part in that assignment.

The first page of her dossier gets a decision statement. She will choose a next research action for the supplied revision after checking whether she can trace a closed bar, reproduce the resulting intent, and account for each reported event. She explicitly allows herself to use the strategy as a single-instance exercise even if the two-instance exercise has to wait. That distinction matters. An otherwise useful package could be a poor fit for one class without losing its value for another.

She also writes down the audience for the decision. A colleague should be able to read the evidence next week and tell which observation made her stop. If all Mara saves is a picture of the chart, the colleague will have to reinvent the question and may retest a different version. A short trading experiment journal can hold the exact observation, the proposed explanation and the remaining doubt. Mara gives each discrepancy an identifier so that a later answer can refer to a particular event.

Choose the decision before choosing the next run. With that sentence in her notebook, the chart becomes an artifact to catalogue. The rest of the evening has a finite job.

Five questions for five kinds of evidence

Mara calls her first page an evidence ladder because the questions follow the sequence in which she can investigate them. Each rung represents a different claim. A source read asks what paths are present and which settings reach them. A rule test asks whether a known input produces the intended decision.

A replay asks which recorded events the program actually saw and in which order. A rehearsal asks how the running system behaves when its local journal and the event history held by the test double diverge. A performance study asks what outcomes the defined process produced under specified conditions. Each question can remain open after another is answered.

Five separate questions about source, rule, replay, rehearsal and performance
The questions follow Mara’s investigation. Their positions indicate sequence, and each requires its own evidence.

Suppose the source lists a spread limit. That establishes a candidate rule and gives Mara somewhere to look for a unit conversion. A fixture with quotes on either side of the limit can show what the supplied revision does with those inputs. Replay can reveal whether those quotes existed in the feed used by a specific run.

A rehearsal can reveal whether a delayed response produces a second request after a restart. None of these observations gives her a distribution of outcomes over market conditions. Conversely, a distribution calculated from a recorded run cannot tell her which line of code handled a delayed acknowledgment.

She attaches a claim and artifact to each entry. For a rule test, the artifact is a small input and a trace of the output, with the expected result written separately. For the restart question, the artifact is a pair of logs and a reconciliation of state recorded by the test double.

For the chart, the artifact includes the run settings and the underlying report. When an item is missing, the question stays open in the dossier with a reason. The arrangement makes it harder for a bright spot in one area to settle a separate dispute.

A negative result can be particularly useful when it has this shape. If the restart trace reproducibly attributes a transaction to the wrong instance, Mara can stop the two-instance exercise even with a perfectly understood entry signal. She can still keep a clean fixture for the closed-bar rule and mark it suitable for teaching in isolation. This gives her a defensible stopping point. A single combined pass score would hide the reason she stopped and could invite another impressive chart as a response to an attribution problem.

Record what the package actually contains

The fictional package contains a Python strategy example for EURUSD, a parameter file, a sample CSV, and a replay report. Mara records each file’s name, role and digest so a colleague can identify the revision she used. She records the Python interpreter and its exact version, the operating system, the environment and dependency manifest, and the parameters actually loaded. She inventories the adapter and test double she assembled separately, including the revision of their event definitions.

Mara creates a fresh virtual environment for the workshop. Python’s documentation describes venv environments as isolated by default and recommends recreating them at the destination. She records the installation result and dependency versions alongside the manifest, then checks that the same small input produces the expected output after recreation. A folder labeled “latest” would give her colleague neither the revision nor the evidence that the setup can be repeated. Python documentation for venv

Her requirements inventory has two kinds of entries. She can check whether the source imports with the recorded Python version and dependencies, whether a known input produces a trace of the chosen rule, and whether the sample row contains enough information to identify the event. Other entries need clarification. The CSV header supplies a timestamp and a value while leaving the time convention and quote component unclear. The report gives a result in pips and leaves its pricing basis unspecified.

Mara records these as open questions with consequences. Without a documented offset, a row close to a session boundary is difficult to associate with the right bar in the replay. If the field contains midpoints, she can use it for a rule exercise with that convention and add a separate bid and ask model for an execution exercise. If the test double cannot reproduce an event sequence the workshop intends to teach, the isolated rule exercise can still go ahead while she improves the rehearsal.

She keeps the sample CSV scope explicit. A CSV accompanying the example is an input to inspect, with the coverage and conventions of that particular file. An independently downloaded broker history may have gaps, rounding, symbol aliases or session definitions of its own. Matching labels such as EURUSD and M15 tell her the instrument name and bar period in the two setups.

To compare signals she still needs to establish that each bar has the same boundaries and comparable inputs. She writes one line for each assumption she has verified, with a reference to a supplied field description or her own inspection. An empty field in the dossier remains useful because it identifies a question she can answer without another broad run.

Read one path and test its boundary

Mara picks one narrow path from the fictional Python source. A pure function receives explicit inputs and returns an eligibility decision and reason, with no clock, file access or adapter calls. At the first evaluation after a bar closes, the caller considers a long intent when the preceding closed bar meets its signal condition. A synthetic fixture sets that condition to true and limits the spread to at most 1.5 pips. Equality is eligible.

For the instrument in the example, one pip represents 0.0001 in quote terms. Mara writes that convention down so someone reading a five-decimal quote knows which unit the function expects. She tests the comparison directly, then uses a separate caller test to check that a repeated evaluation of the same closed bar leaves the number of distinct intents unchanged. The two tests let her locate a failure in the comparison or in how the caller keeps track of the bar.

The reference cases represent spread in integer tenths of a pip. At 14 tenths she expects an eligible intent. At 15 she expects the same result. At 16 she expects a refusal with a spread reason. A second evaluation on the same closed bar should leave the count of distinct intents at one in the eligible cases.

Fixing the signal input means the fixture isolates the threshold and the once-per-bar guard. She adds an independent case with an ineligible signal and a low spread. That case would catch a test harness that had accidentally turned the spread check into the only condition.

This is expected behavior written before execution. Mara includes a case in which the forming bar changes while the closed bar stays fixed. If a change on the forming bar alone alters the eligible intent, she can return to the call site and ask whether the code selected the correct bar.

She saves each expected reason alongside the expected count. A test that merely checks for no order would let a missing-data error masquerade as a successful spread refusal. A useful trace exposes the branch, the bar identifier and the measured spread in consistent units.

An assistant can help her suggest edge cases with a minimal excerpt. A suitable prompt would specify the integer unit, the inclusive comparison, the closed-bar contract and a tiny synthetic table, and ask for cases that distinguish off-by-one errors from wrong-bar selection. Account identifiers, credentials and private factory code have no role in that request.

Mara calculates the three expected threshold results herself and uses a deterministic comparison against the observed trace. An explanation from the same assistant that generated a fixture can help interpret it, while independent expectations are what make the check informative. The guide to independent tests for AI-generated code develops that distinction.

Discrepancy one lives in the clock

The first discrepancy in the fictional dossier is an apparent two-hour delay. Mara’s CSV viewer shows a row at 08:45. The log labels the matching bar 10:45. The label belongs to the opening time of a fifteen-minute bar, and the evaluation happens after its close. She had compared the two displayed strings directly and started searching the source for an extra wait. Before modifying the code, she extracts the neighboring rows and asks which convention each export used.

For this example the file’s accompanying note is eventually confirmed to use UTC, and the log export documents a fixed offset of UTC+02:00 over the interval in question. Subtracting two hours from 10:45 gives 08:45 UTC. The bar closes at 09:00 UTC, which corresponds to 11:00 in that log export.

A trace event just after 11:00 local belongs to the expected evaluation window. She verifies the row by normalized opening time and symbol and checks its neighbors. A matching label on a single record could be accidental, especially if a join silently used the nearest timestamp.

The root cause is a comparison of display conventions. Mara preserves the original strings and raw row number and adds normalized fields to her working copy. She distinguishes the time of the data observation, the bar identifier and the time the Python process evaluated it.

That lets another reader reconstruct a discrepancy without assuming that a bar’s time field reports when an order request was sent. She also checks that each expected bar maps to one row, with missing and duplicated rows listed separately. Joining a repeated minute by whichever record comes first would make the replay depend on file order.

Preserve the raw timestamp alongside its interpretation. The confirmed offset explains this interval. A conversion for another period needs the rules for that period, especially around clock changes. A session filter based on the wrong time reference can affect eligibility even after reports are displayed in a common zone.

Mara makes a separate fixture for the session edge if that issue matters to the workshop. She does not smooth the discrepancy away by shifting all records until the chart looks similar. The correction changes only the comparison for which she has evidence. The underlying timestamp questions are covered in the article on Forex data timestamps.

Discrepancy two is a cost reconciliation

The next discrepancy is a trade summary showing a hypothetical gain of 6.0 pips while a separate reconstruction shows 2.8. Mara chooses one long round trip and defines a common unit before comparing it. The entry midpoint is 1.10000 and the exit midpoint is 1.10060.

Their difference is 0.00060, or 6.0 pips. At entry the assumed spread is 1.4 pips, so the ask is 0.7 pip above midpoint at 1.10007. At exit the assumed spread is 1.8 pips, so the bid is 0.9 pip below midpoint at 1.10051. The quote-side difference is 0.00044, or 4.4 pips.

A hypothetical midpoint gain of six pips reconciled to a net result of 2.8 pips
The example separates midpoint movement, two half-spreads, modeled slippage and commission in pip equivalents.

She assumes adverse slippage of 0.3 pip at entry and 0.5 at exit for this calculation. That puts the modeled buy fill at 1.10010 and sell fill at 1.10046. The difference is 3.6 pips. With a round-trip commission equivalent to 0.8 pip under the example’s convention, the result is 2.8 pips.

There is no overnight financing in this invented same-session illustration. Working downward from the midpoint, the arithmetic is 6.0 minus 0.7, minus 0.9, minus 0.3, minus 0.5, minus 0.8. Starting from modeled fills would give the same result by deducting the commission from 3.6.

The root cause is a mismatch of measurement bases. The fictional summary counted midpoint movement and the reconstruction applied a cost model. Neither calculation needs to be adjusted to match the other. Mara labels the columns and keeps the reference for each. If she started from already cost-adjusted fills and subtracted the half-spreads again, she would invent a 1.6-pip charge. If a charge were expressed in account currency, she would first need its matching conversion convention to compare it with pips.

The fictional CSV still needs a confirmed field dictionary. Mara uses the invented quotes to demonstrate the arithmetic and leaves the observed feed and fill questions open. She records which replay consumes bar snapshots and which consumes a sequence of quote updates, along with the point in the sequence at which each simulated fill is priced. If the inputs cannot establish the order of two intrabar events, she marks that order as an assumption in the run record.

Discrepancy three belongs to two instances

The third fictional discrepancy appears in Mara’s local rehearsal. Two Python instances on EURUSD, A and B, share a strategy tag so the workshop can group related activity. After a simulated interruption, the adapter assigns an event from A to B’s unresolved intent. A separate fixture ledger records which instance originated each intent. The chart summary suggests a duplicate signal because it mixes the two streams. The event ledger gives Mara a way to test the attribution directly.

The test double supplies a predetermined sequence of asynchronous acknowledgments and execution events. A records intent A17 and B records B04. The double acknowledges A17 for processing. The rehearsal stops B, then makes A’s simulated fill available during B’s recovery. A17 should take the fill and B04 should stay unresolved. The invented adapter looks up events using only symbol and shared strategy tag, so B selects A’s fill. Constant spreads and artificial bars suffice to reproduce the error.

In this fixture, acknowledging a request and recording a fill are distinct state changes. As a provider-specific comparison, OANDA’s order endpoint documents separate creation and immediate-fill transactions in its response. The same response can contain both. OANDA order endpoints

OANDA’s transaction definitions distinguish a client ID from a tag and show that a fill can carry a client order ID if one was assigned. These are examples of fields to look for when reading a provider’s contract. The test double follows the workshop’s own event contract. OANDA transaction definitions and ClientExtensions

Mara repeats the fixture using durable records that bind the local instance identifier to each intent. Where the adapter or API explicitly supports it, she can also record a distinct client order identifier per intent and use it to correlate events. A confirmed mapping to an order reference returned by the simulated service can provide another link. When a mapping is missing or ambiguous, the exercise expects the event to remain unresolved. A strategy tag still helps group events for inspection.

A client order ID is correlation data. Retry behavior depends on the documented duplicate-handling contract and on what the program has already recorded and reconciled. Authorization depends on separate access controls. Mara checks whether the event belongs to the intended instance using the saved mapping and the event record. A and B can still respond to the same market movement, even with correct attribution. The test shows only what the revised lookup does on the supplied event sequence.

For a follow-up rehearsal that remains pending, she specifies an unresolved acknowledgment, a delayed fill, and a simulated event that appears again after recovery. She plans to restart the Python process twice against the same saved state and scripted event history. The expected trace shows one application of A’s fill, no new simulated request due to the restart, and B04 left pending until its own evidence arrives. She will compare intent, request and fill counts separately and check the exact record that changed.

The plan also covers the interval after the request was recorded and before an acknowledgment was saved. In that interval the local journal cannot establish whether the simulated receiver accepted the request. The expected result is to reconcile against the double’s recorded history and retain an unresolved status if the evidence is incomplete. Once she runs these checks, she will save the input sequence, the journal before each restart and the resulting reconciliation for a colleague to repeat offline.

Freeze the revision and preserve the limits

Mara now has three explanations and several possible changes. She creates a frozen baseline with the source digest, configuration, Python version, dependency manifest and adapter revision, input slice, fixture definitions and run reports. She stores the baseline’s inputs separately from derived output such as normalized CSV rows.

The normalization has its own description, including the time interval for which the offset was established. The test report links the artifact and the expectation it checks. A clean folder beside the frozen revision holds new experiments, so a later run cannot quietly replace the evidence for her original decision.

The run that first impressed her remains in the dossier. It may explain why she chose the package, and it records the exact conditions she originally saw. Because she selected it after looking at its shape, she treats it as a selected observation.

If the workshop later needs performance analysis, she will specify in advance which periods, settings and cost assumptions the study will evaluate. She will keep comparable failed and incomplete runs and record whether a setting was chosen before or after seeing an outcome. That sequence affects what she can infer from the resulting report.

For the workshop example, a useful demonstration limit is attached to each passed case. The clock reconstruction covers one documented interval. The threshold fixture covers an inclusive comparison and a once-per-bar expectation over a small input. The arithmetic reconciliation covers one round trip with hypothetical quotes and charges. The revised identifier fixture covers an artificial interruption. Each item is useful because its boundaries tell a colleague when a fresh check is needed.

Version the input, the expectation and the observation together. Consider what happens if a colleague finds a new report whose form matches the old one. A changed time-zone export can make a fixed program appear to shift its activity. A different parameter file can turn a correctly tested boundary into a different rule.

Comparing the revision names alone would miss both changes. The frozen dossier gives the colleague a starting point for distinguishing a changed system from a changed observation method. It is also a way to keep the repair honest. Mara can rerun the original failing case and then a case that was already passing, with both expectations preserved from before the repair.

Give the study a time limit with exit conditions

Mara budgets three focused sessions for the fictional workshop decision. They are units of available attention. In the first she inventories the files and recreates the Python environment for the frozen revision. She leaves with either an artifact list and a startup trace or one precise compatibility question, such as whether a dependency can be installed with the chosen interpreter.

In the second she runs the rule fixtures and reconstructs the clock and cost examples. A failing boundary case with a recorded input can be a complete outcome for that session because it gives her a reproducible object to discuss. The third session is reserved for a rehearsal and a decision record.

Decision ledger with separate entries for accepting an exercise, delaying a rehearsal and rejecting an inference
One dossier can lead to different decisions about a bounded lesson, a rehearsal and a performance claim.

She sets a deadline for finishing the dossier even if a reply has not arrived. A question sent to someone else has an owner, a specific requested artifact and a condition for reopening the study. For example, the two-instance lesson can reopen when she has a written adapter event contract defining instance attribution and a matching trace across repeated restarts.

The single-instance lesson can proceed as a bounded fixture with a clock convention written down. The claim that the rising chart demonstrates executable performance is rejected on the evidence available. This decision refers to the claim and the current report. It leaves a later, separately designed performance study possible.

If the package could not run in the Python environment the workshop actually uses and the required interpreter or dependencies were unavailable there, choosing another specimen would be reasonable. If only one CSV field were ambiguous and its meaning would change the conclusion, a clarification would have high value.

If the field is irrelevant to the closed-bar fixture because that fixture supplies all its own inputs, Mara can finish that part while she waits. Accept, delay and reject are decisions about particular uses of particular evidence. That is what makes the ledger readable when more information arrives.

A budget can also protect against the temptation to repeat an easy test because its output feels reassuring. Three sessions give Mara a way to allocate work. They establish no universal practice period, trade count or safety threshold. She revisits the budget only when she can name the new question and explain why an additional experiment would distinguish between plausible answers.

Read a performance report as a claim with a denominator

A report becomes easier to question when Mara names what enters the denominator. Are the entries trades, deals, signals or bars? Two recorded deals can belong to one round trip. A signal might never become a request because the spread check failed. A request may be refused.

Leaving refusals outside a trade-only report can be sensible for a narrowly defined fill statistic, while it makes that same statistic weak evidence about the full set of opportunities the rule encountered. She asks for the count of each stage in the report and the observation window that produced it.

The CFTC’s advisory on commodity futures trading systems points out the difference between hypothetical results and actual trades, including the role of execution prices and liquidity. Mara uses that warning to keep the interpretation of her simulated report narrow. CFTC advisory on commodity trading systems

A useful next study would record the comparison population. If the replay report covers a quiet interval and a different comparison includes a volatile session, a change in transaction count can reflect the market window rather than the code revision. If changing the quote model also changes which trades pass the spread filter, the effect combines selection and cost.

Mara would first compare an identical set of intents under alternate accounting assumptions, then measure how many intents actually change under the alternate input. The first comparison addresses the charge model conditional on the original intents. The second addresses a behavior change. Writing both questions in advance helps prevent a single aggregate from hiding the mechanism.

The two-instance issue adds a dependence problem. A and B can fire in the same market interval and respond to the same quote movement. Treating two reports as independent evidence because they have separate filenames can exaggerate how many distinct circumstances were observed. Mara would prepare a time-aligned overlap record and inspect whether the examples cover different conditions, then decide what inference is reasonable. She has no need to run that larger study to finish the narrower workshop decision.

A replay answers for its inputs and assumptions. When a report lacks the conditions needed to interpret it, Mara requests the missing description and preserves the report as received. Corrections belong beside the original, with an explanation of which quantities change and which question the corrected report can answer.

Define the handover before considering an order

Mara’s workshop also needs a written scope record for its materials. She lists the fictional example files, what she verified in her chosen Python environment, and questions about interpreter versions, dependencies and data fields. If she evaluates a separate offer, she uses that offer’s written terms to confirm its deliverables and compatibility. Her adapter, its event contract and the local test double belong to her own exercise. The workshop manifest records those separately so a colleague can reproduce the rehearsal.

Handover sheet with materials recorded for the workshop alongside unverified terms
The inventory pairs what Mara has in hand with questions that need written confirmation.

Her intended use raises concrete license questions. Can participants inspect the supplied code in a shared classroom environment? Can she keep a modified fixture for later sessions? Does a replacement revision require a different license or change what her students can reproduce?

She asks what support covers and how reproducible installation or compatibility issues are handled. She also asks for the applicable tax treatment to be stated in the written offer. The answers belong in the commercial record where she can compare them with the workshop requirements.

Mara bases each lesson on what the corresponding files let her inspect. The Python strategy and the fixture are enough to study the closed-bar decision. The two-instance lesson also needs the local adapter, the event definitions and an independently written record of the expected attribution.

If she adds another strategy to the workshop, it brings its own input and rule assumptions. Several examples can use the same data and encounter the same conditions. Before expanding the collection, she checks which question an additional example would help the participants answer.

The workshop also needs to assign maintenance tasks. Mara specifies who would keep the frozen files, who would update the workshop notes after a revision and who would respond if an example no longer imports or runs. The person receiving the handover needs the input and expected output for a small smoke check so they can detect a mismatch early. Ownership here means responsibility for the maintenance task. Permission to share the source follows from the written terms. Keeping both questions visible prevents a colleague from reading possession of an archive as an answer to a license question.

Close the dossier with the decision it can support

Mara closes the fictional dossier with a favorable decision on the single-instance classroom fixture, a pause on the two-instance rehearsal, and a rejection of the original chart as evidence of executable performance. The clock discrepancy is explained for the confirmed interval.

The cost explanation stands as fully worked arithmetic with hypothetical inputs. The recovery problem is reproducible in the artificial fixture, and the workshop still needs a trace across repeated restarts. Her colleague can see the reasoning and locate each supporting artifact without trying to duplicate the excitement of her first evening.

She gives the remaining adapter question to her workshop colleague with the smallest context needed. It includes the Python and adapter revisions, the expected distinction between A17 and B04, the observed attribution and the fixture events needed to reproduce it. A reply could identify a missing mapping, clarify which events survive a restart or reveal a different interpretation of an acknowledgment. Each answer gives them a different test to run. The ledger has a place to record that test and who will maintain it.

Possible live execution is a separate personal risk decision. A person facing it would need to evaluate real losses they could bear, operational responsibilities they can meet, and conditions that would make them stop or seek qualified advice. They would need evidence relevant to the actual environment and to the consequences of error.

A passed classroom fixture settles none of those questions. In particular, the demonstrated ability to reconcile an inventory of events gives someone a way to understand what happened after an incident. It gives no assurance that the incident would be affordable or recoverable.

Write the action and the condition for revisiting it. A closing note could say that the exercise is ready for one bounded lesson and name the exact open dependency for the next one. When circumstances change, a new evaluation can cite the earlier note and explain which evidence justifies reopening it. The result is a decision a colleague can use even if the original run was memorable for entirely different reasons.

For current availability and the deliverables in TradeAndRoll’s broker-agnostic Python demo, see the demo page.

Back to the Blog