Skip to content

Money movement and financial logic

Trading and investment platform testing

Trading and investment platform testing checks the order lifecycle and FIX sessions, market data handling, margin and buying power, corporate actions, T+1 settlement dates, and trade reporting inputs. Brokerage, crypto exchange, and robo-advisor teams receive an order lifecycle test suite, a market data latency and consistency report, margin and liquidation calculation checks, and corporate action and rebalancing scenarios.

What trading platform testing covers

An order defect becomes an unwanted position, a fill booked twice, or a margin loan the collateral no longer covers. We test order handling and calculations against the venue protocol, rule text, and an independent reference model. Segment failure patterns and regulator evidence are on the investing and trading app and trading terminal pages.

Order lifecycle and FIX sessions

The order lifecycle test suite sends each order type through place, amend, cancel, partial fill, and reject over FIX 4.4 and REST or WebSocket APIs. Every ExecutionReport (35=8) is checked for OrdStatus (39), ExecType (150), and LeavesQty (151), which equals OrderQty (38) minus CumQty (14) while the order is active (FIX 4.4 dictionary). Races that move money:

  • a cancel that meets an in-flight fill, rejected with CxlRejReason (102) = 0, too late to cancel, while the fill still reaches the position
  • an OrderCancelReplaceRequest (35=G) that lowers quantity below CumQty after a partial fill
  • a retried order with a new ClOrdID (11), which opens a second position
  • a replayed ExecutionReport with PossDupFlag (43) = Y, which must not book a second fill

Session tests cover Logon (35=A), TestRequest (35=1) to a silent counterparty, and gap recovery through ResendRequest (35=2). A SequenceReset (35=4) that tries to decrease the expected sequence number should be rejected and treated as a serious error (FIX 4.4 message reference). On crypto-asset trading platforms, the suite tests rejection of orders above pre-determined volume and price thresholds under MiCA Article 76(7)(d).

Market data handling

The market data latency and consistency report measures quote age from feed receipt to display, order entry, and the risk engine at the 50th and 99th percentile, under load profiles from performance testing. Consistency checks compare last price, bid, and ask across the app, API, risk engine, and statements at one timestamp. Fault injection covers feed sequence gaps, WebSocket reconnects that resume from a stale snapshot, crossed quotes, trading halts, and a symbol that stops updating without a halt message. Each case records the stale price flag and the response of the order ticket and margin engine.

Margin, buying power, and liquidation

Margin and liquidation calculation checks recalculate every account in a synthetic book. US rule inputs, checked on 2026-09-16:

  • required margin of 50 percent of current market value for a margin equity security, or the percentage set where the trade occurs if greater (Regulation T section 220.12(a))
  • maintenance margin of 25 percent of the current market value of long margin securities (FINRA Rule 4210(c)(1))
  • intraday margin deficits under 4210(d)(2), effective 4 June 2026 with phase-in permitted until 20 October 2027 (Regulatory Notice 26-10), found by real-time monitoring that blocks deficit-creating transactions or by one end-of-day calculation

Rule 4210(d)(2)(B)(vi) makes event order testable: when the broker cannot demonstrate which of two activities came first, the intraday margin level is computed in the order that gives the highest deficit. We test that event timestamps survive retries and replays. On crypto derivatives venues, the checks cover liquidation prices per margin tier. Margin interest uses the reference model from financial calculation testing.

Corporate actions and rebalancing

Corporate action and rebalancing scenarios apply each event to positions, open orders, cost basis, and cash:

  • forward and reverse splits, with cash in lieu of fractional shares
  • cash dividends on whole and fractional shares, with ex-dividend dates under FINRA Rule 11140(b)(1) for distributions under 25 percent of the security's value and (b)(2) for 25 percent or more
  • mergers, symbol changes, and spin-offs with cost basis allocation
  • rebalancing runs around drift thresholds, with minimum trade sizes and tax-lot selection

T+1 settlement and trade reporting inputs

SEC Rule 15c6-1(a) sets settlement no later than the first business day after the contract date for securities outside the listed exceptions, unless the parties expressly agree otherwise at the time of the transaction, effective 28 May 2024 (SEC). Canadian equity and long-term debt trades moved to T+1 on 27 May 2024 (CSA). Regulation (EU) 2025/2075 applies T+1 to transferable securities transactions executed on EU trading venues from 11 October 2027. We test settlement dates across US and Canadian holidays, the EU switch date, and settled and unsettled cash in buying power. MiCA Article 76(12) requires crypto-asset trading platforms to initiate final settlement on the distributed ledger within 24 hours of execution, or by the close of the day for transactions settled outside it.

Each order event from the lifecycle suite is traced to the Consolidated Audit Trail data that FINRA Rule 6830(b)(2) requires by 8:00 a.m. Eastern Time on the following Trading Day. EU executions are traced to the MiFIR Article 26 transaction report fields, due no later than the close of the following working day. Position and cash breaks at settlement go to ledger and reconciliation testing.

Deliverables

  • Order lifecycle test suite (place, amend, cancel, partial fill, reject)

    Automated tests that send each order type through FIX and API channels and check OrdStatus, ExecType, CumQty, and LeavesQty on every execution report, for engineering leads and release managers.

  • Market data latency and consistency report

    A per-release report of quote age from feed receipt to display, order entry, and the risk engine, with the result of each gap, stale price, and halt test, for engineering and trading operations leads.

  • Margin and liquidation calculation checks

    Recalculations of initial margin, maintenance margin, buying power, intraday margin deficits, and liquidation triggers in an independent reference model, with each difference listed per account, for risk and finance leads.

  • Corporate action and rebalancing scenarios

    Test cases for splits, dividends, mergers, spin-offs, and portfolio rebalancing that check positions, cost basis, open orders, and cash entitlements after each event, for operations leads and auditors.

How trading platform tests fit your release process

Pull requests. Order state machine and margin calculation tests run in your CI against a FIX simulator and recorded market data. A change to order handling or margin code fails the build with the message sequence or the account that broke.

Certification environments. Before a release that touches routing, the order lifecycle suite runs against each counterparty's certification or UAT environment: executing brokers, clearing firms, and exchange test sessions. Session tests with forced disconnects run here, because a simulator does not reproduce each counterparty's resend behaviour. The FIX logs from these runs are kept as release evidence.

Market calendar events. Corporate action scenarios run when your corporate action feed or entitlement code changes, and before index rebalance and option expiry dates. Holiday calendar files are tested each time they change. The EU move to T+1 on 11 October 2027 is scheduled as a configuration test that runs both settlement cycles side by side.

Rule changes. When a margin rule or house requirement changes, as FINRA Rule 4210 did on 4 June 2026, the reference model is updated from the rule text first, and the platform is tested against it before the new parameters go live.

Test data. Tests use synthetic accounts, positions, and prices. Where a defect only reproduces on production account data, samples are masked under the controls on our security page before they enter a test environment.

After release. A smoke run after each deploy places and cancels orders in test symbols or a test account on each venue connection where the venue permits it, and compares a sample of margin figures with the reference model.

Handover. The suites, the FIX simulator configuration, the reference model, and the evidence packs live in your repository. Your engineers run every suite without us, your risk team signs off margin parameters, and your operations team owns the corporate action calendar.

Sample deliverable

Sample, synthetic data

position and ledger reconciliationPosition and ledger reconciliation run: custodian, chain, payroll, and revenue feeds
Position and ledger reconciliation run: custodian, chain, payroll, and revenue feeds
IDSource pair and instrument or assetInternal quantity or amountExternal quantity or amountDifference (internal minus external)Break classification and cause
POS-01Internal position ledger vs custodian settled position file: Equity A shares1,200 shares1,000 shares+200 sharesTiming break, expected: a 200-share buy executed on trade date settles on T+1 and is absent from the settled position file until the next file
POS-02Internal position ledger vs clearing position file: Equity B shares500 shares1,000 shares-500 sharesCorporate action break, open: the clearing file applies a 2-for-1 split on the effective date and the internal ledger has no split entry
POS-03Portfolio ledger vs custodian holdings file: Fund A units1,250.457362 units1,250.457 units+0.000362 unitsRounding break inside the 0.001-unit tolerance: the portfolio ledger stores units to 6 decimal places and the custodian file to 3
POS-04Hot wallet ledger vs blockchain node balance: Testnet coin A on a public testnet2.500000 coin A2.000000 coin A+0.500000 coin ATrue break, defect: deposit DEP-7713 was credited after 1 confirmation against a configured threshold of 12, and a chain reorganisation removed the transaction from the canonical chain
POS-05Hot wallet ledger vs blockchain node balance: Testnet coin A on a public testnet50.000000 coin A49.999580 coin A+0.000420 coin ATrue break, defect: the network fee for withdrawal WD-2291 was paid from the hot wallet and has no ledger entry
POS-06Tracker holdings from imported exchange history vs self-custody wallet node balance: Testnet coin B1.0000 coin B0.9995 coin B+0.0005 coin BTrue break, defect: the import records the exchange withdrawal at the gross amount and drops the 0.0005 coin B withdrawal fee, so the lot quantity is overstated by 0.0005 coin B and later disposals consume units the wallet does not hold
POS-07EWA advance ledger vs employer payroll deduction file: employee EMP-0042, pay period PP-18350.00 XTS300.00 XTS+50.00 XTSTiming break, expected: advance ADV-5520 was requested after the payroll cut-off and the employer file deducts it in pay period PP-19
POS-08Revenue-share remittance ledger vs expected remittance recalculated from processor revenue feed: agreement RBF-0310, month M-061,200.00 XTS1,160.00 XTS+40.00 XTSCalculation break, defect: the remittance applies the 8% share to 15,000.00 XTS gross revenue, while the agreement defines the share on 14,500.00 XTS revenue net of refunds

Amounts use XTS, the ISO 4217 code reserved for testing; Equity A, Equity B, Fund A, and testnet coins A and B are generic test instruments with no market value, and all employee, agreement, deposit, and withdrawal IDs are invented.

Questions

What is margin trading?

Margin trading is buying securities with money borrowed from a broker, with the securities in the account as collateral. In the US, Regulation T section 220.12(a) sets required margin for a margin equity security at 50 percent of current market value, or the percentage set where the trade occurs if greater. FINRA Rule 4210(b)(4) adds minimum equity of $2,000, though cash need not exceed the purchase cost.

How does margin trading work?

A broker lends part of the purchase price, charges interest on the debit balance, and values the positions at current market prices. Under FINRA Rule 4210(c)(1), equity must stay at 25 percent or more of the current market value of long margin securities, and brokers can set higher house requirements. An account below the requirement receives a margin call, and the broker can sell positions to meet it.

Scope your trading platform testing

Send your order types, venue and clearing connections, margin products, and markets, and we return a test scope with the evidence each release needs.

Scope your testing