{"abstract":"A flat book reports an average rate after a zero-quantity booking correction.","category":"Currency rounding and FX conversion","checks":6,"contract":"solve(trades, spot): trades are [qty, rate] in foreign units (buy positive, sell negative) at home-per-foreign decimal rates. Adding in the position's direction updates the weighted average rate; reducing realizes closed_qty * (rate - avg) * sign(position) without changing avg; a flip realizes the closed part and opens the remainder at the trade rate; a flat position has no average. Zero-quantity trades are ignored. Unrealized = position * (spot - avg). Return [position, avg to 6 dp or None, realized to 2 dp, unrealized to 2 dp], rounded half-even only at output with unsigned zeros.","evaluation_group":"w2-currency_rounding_and_fx_conversion-fx-position-average-rate","failed_approach":"Skipping zero trades only while a position is open still assigns an average on a flat book.","family":"w2-currency_rounding_and_fx_conversion-fx-position-average-rate-zero-quantity-trade","id":"FA-62051","implementations":{"attempt":{"sha256":"08a36fde0dc0df0b0d3193df150358e16403c3e6a27834090a60e09fb9fae578","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nfrom decimal import Decimal, ROUND_HALF_EVEN, ROUND_HALF_UP, ROUND_FLOOR, ROUND_CEILING, ROUND_DOWN, ROUND_UP, ROUND_HALF_DOWN\nfrom fractions import Fraction\nN = 1\nobservations = []\ndef solve(trades, spot):\n    def fmt(fr, e):\n        d = (Decimal(fr.numerator) / Decimal(fr.denominator)).quantize(Decimal(1).scaleb(-e), rounding=ROUND_HALF_EVEN)\n        return format(abs(d) if d == 0 else d, 'f')\n    pos, avg, realized = 0, None, Fraction(0)\n    for qty, rate in trades:\n        r = Fraction(rate)\n        if qty == 0 and pos != 0: continue\n        if pos == 0 or (pos > 0) == (qty > 0):\n            avg = r if pos == 0 else (abs(pos) * avg + abs(qty) * r) / (abs(pos) + abs(qty))\n            pos += qty\n        else:\n            closed = min(abs(qty), abs(pos))\n            sgn = 1 if pos > 0 else -1\n            realized += closed * (r - avg) * sgn\n            pos += qty\n            if pos == 0: avg = None\n            elif (pos > 0) != (sgn > 0): avg = r\n    unreal = pos * (Fraction(spot) - avg) if pos else Fraction(0)\n    return [pos, None if avg is None else fmt(avg, 6), fmt(realized, 2), fmt(unreal, 2)]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncases = [[('regression zero-quantity-trade 1', ([[0, '1.10']], '1.05'), [0, None, '0.00', '0.00']),\n  ('regression zero-quantity-trade 2', ([[50, '1.1'], [-50, '1.2'], [0, '1.3']], '1.5'), [0, None, '5.00', '0.00']),\n  ('control: add then reduce', ([[100, '1.10'], [100, '1.20'], [-50, '1.30']], '1.25'),\n   [150, '1.150000', '7.50', '15.00']),\n  ('control: flip long to short', ([[100, '1.10'], [-150, '1.00']], '1.05'), [-50, '1.000000', '-10.00', '-2.50']),\n  ('control: close short', ([[-100, '1.10'], [100, '1.00']], '1.05'), [0, None, '10.00', '0.00']),\n  ('control: short add', ([[-30, '1.0833'], [-70, '1.0851']], '1.0800'), [-100, '1.084560', '0.00', '0.46'])],\n [('regression zero-quantity-trade 1', ([[0, '1.1473'], [0, '1.0737']], '1.1228'), [0, None, '0.00', '0.00']),\n  ('regression zero-quantity-trade 2', ([[0, '1.1043']], '1.1389'), [0, None, '0.00', '0.00']),\n  ('control: zero trade only', ([[0, '1.10']], '1.05'), [0, None, '0.00', '0.00']),\n  ('control: short add', ([[-30, '1.0833'], [-70, '1.0851']], '1.0800'), [-100, '1.084560', '0.00', '0.46']),\n  ('control: three reductions', ([[300, '1.0711'], [-100, '1.0733'], [-100, '1.0745'], [-100, '1.0719']], '1.07'),\n   [0, None, '0.64', '0.00']),\n  ('control: zero between', ([[50, '1.1'], [-50, '1.2'], [0, '1.3'], [20, '1.4']], '1.5'),\n   [20, '1.400000', '5.00', '2.00'])],\n [('regression zero-quantity-trade 1', ([[0, '1.0667']], '1.1026'), [0, None, '0.00', '0.00']),\n  ('regression zero-quantity-trade 2', ([[0, '1.0905']], '1.0908'), [0, None, '0.00', '0.00']),\n  ('control: zero between', ([[50, '1.1'], [-50, '1.2'], [0, '1.3'], [20, '1.4']], '1.5'),\n   [20, '1.400000', '5.00', '2.00']),\n  ('control: flip short to long', ([[-40, '1.2'], [100, '1.1']], '1.15'), [60, '1.100000', '4.00', '3.00']),\n  ('control: add then reduce', ([[100, '1.10'], [100, '1.20'], [-50, '1.30']], '1.25'),\n   [150, '1.150000', '7.50', '15.00']),\n  ('control: flip long to short', ([[100, '1.10'], [-150, '1.00']], '1.05'), [-50, '1.000000', '-10.00', '-2.50'])],\n [('regression zero-quantity-trade 1', ([[0, '1.1082']], '1.0890'), [0, None, '0.00', '0.00']),\n  ('regression zero-quantity-trade 2', ([[0, '1.0848']], '1.0930'), [0, None, '0.00', '0.00']),\n  ('control: flip long to short', ([[100, '1.10'], [-150, '1.00']], '1.05'), [-50, '1.000000', '-10.00', '-2.50']),\n  ('control: close short', ([[-100, '1.10'], [100, '1.00']], '1.05'), [0, None, '10.00', '0.00']),\n  ('control: zero trade only', ([[0, '1.10']], '1.05'), [0, None, '0.00', '0.00']),\n  ('control: short add', ([[-30, '1.0833'], [-70, '1.0851']], '1.0800'), [-100, '1.084560', '0.00', '0.46'])],\n [('regression zero-quantity-trade 1', ([[0, '1.1213'], [0, '1.0823']], '1.1168'), [0, None, '0.00', '0.00']),\n  ('regression zero-quantity-trade 2', ([[0, '1.0532']], '1.1383'), [0, None, '0.00', '0.00']),\n  ('control: short add', ([[-30, '1.0833'], [-70, '1.0851']], '1.0800'), [-100, '1.084560', '0.00', '0.46']),\n  ('control: three reductions', ([[300, '1.0711'], [-100, '1.0733'], [-100, '1.0745'], [-100, '1.0719']], '1.07'),\n   [0, None, '0.64', '0.00']),\n  ('control: zero between', ([[50, '1.1'], [-50, '1.2'], [0, '1.3'], [20, '1.4']], '1.5'),\n   [20, '1.400000', '5.00', '2.00']),\n  ('control: flip short to long', ([[-40, '1.2'], [100, '1.1']], '1.15'), [60, '1.100000', '4.00', '3.00'])]]\nfor label, args, expected in cases[N - 1]:\n    check(label, solve(*args), expected)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"},"broken":{"sha256":"a96a599f4b5edff42a5b58bf34d073e659d8a37f364350a53a43ed48ad958098","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nfrom decimal import Decimal, ROUND_HALF_EVEN, ROUND_HALF_UP, ROUND_FLOOR, ROUND_CEILING, ROUND_DOWN, ROUND_UP, ROUND_HALF_DOWN\nfrom fractions import Fraction\nN = 1\nobservations = []\ndef solve(trades, spot):\n    def fmt(fr, e):\n        d = (Decimal(fr.numerator) / Decimal(fr.denominator)).quantize(Decimal(1).scaleb(-e), rounding=ROUND_HALF_EVEN)\n        return format(abs(d) if d == 0 else d, 'f')\n    pos, avg, realized = 0, None, Fraction(0)\n    for qty, rate in trades:\n        r = Fraction(rate)\n        pass\n        if pos == 0 or (pos > 0) == (qty > 0):\n            avg = r if pos == 0 else (abs(pos) * avg + abs(qty) * r) / (abs(pos) + abs(qty))\n            pos += qty\n        else:\n            closed = min(abs(qty), abs(pos))\n            sgn = 1 if pos > 0 else -1\n            realized += closed * (r - avg) * sgn\n            pos += qty\n            if pos == 0: avg = None\n            elif (pos > 0) != (sgn > 0): avg = r\n    unreal = pos * (Fraction(spot) - avg) if pos else Fraction(0)\n    return [pos, None if avg is None else fmt(avg, 6), fmt(realized, 2), fmt(unreal, 2)]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncases = [[('regression zero-quantity-trade 1', ([[0, '1.10']], '1.05'), [0, None, '0.00', '0.00']),\n  ('regression zero-quantity-trade 2', ([[50, '1.1'], [-50, '1.2'], [0, '1.3']], '1.5'), [0, None, '5.00', '0.00']),\n  ('control: add then reduce', ([[100, '1.10'], [100, '1.20'], [-50, '1.30']], '1.25'),\n   [150, '1.150000', '7.50', '15.00']),\n  ('control: flip long to short', ([[100, '1.10'], [-150, '1.00']], '1.05'), [-50, '1.000000', '-10.00', '-2.50']),\n  ('control: close short', ([[-100, '1.10'], [100, '1.00']], '1.05'), [0, None, '10.00', '0.00']),\n  ('control: short add', ([[-30, '1.0833'], [-70, '1.0851']], '1.0800'), [-100, '1.084560', '0.00', '0.46'])],\n [('regression zero-quantity-trade 1', ([[0, '1.1473'], [0, '1.0737']], '1.1228'), [0, None, '0.00', '0.00']),\n  ('regression zero-quantity-trade 2', ([[0, '1.1043']], '1.1389'), [0, None, '0.00', '0.00']),\n  ('control: zero trade only', ([[0, '1.10']], '1.05'), [0, None, '0.00', '0.00']),\n  ('control: short add', ([[-30, '1.0833'], [-70, '1.0851']], '1.0800'), [-100, '1.084560', '0.00', '0.46']),\n  ('control: three reductions', ([[300, '1.0711'], [-100, '1.0733'], [-100, '1.0745'], [-100, '1.0719']], '1.07'),\n   [0, None, '0.64', '0.00']),\n  ('control: zero between', ([[50, '1.1'], [-50, '1.2'], [0, '1.3'], [20, '1.4']], '1.5'),\n   [20, '1.400000', '5.00', '2.00'])],\n [('regression zero-quantity-trade 1', ([[0, '1.0667']], '1.1026'), [0, None, '0.00', '0.00']),\n  ('regression zero-quantity-trade 2', ([[0, '1.0905']], '1.0908'), [0, None, '0.00', '0.00']),\n  ('control: zero between', ([[50, '1.1'], [-50, '1.2'], [0, '1.3'], [20, '1.4']], '1.5'),\n   [20, '1.400000', '5.00', '2.00']),\n  ('control: flip short to long', ([[-40, '1.2'], [100, '1.1']], '1.15'), [60, '1.100000', '4.00', '3.00']),\n  ('control: add then reduce', ([[100, '1.10'], [100, '1.20'], [-50, '1.30']], '1.25'),\n   [150, '1.150000', '7.50', '15.00']),\n  ('control: flip long to short', ([[100, '1.10'], [-150, '1.00']], '1.05'), [-50, '1.000000', '-10.00', '-2.50'])],\n [('regression zero-quantity-trade 1', ([[0, '1.1082']], '1.0890'), [0, None, '0.00', '0.00']),\n  ('regression zero-quantity-trade 2', ([[0, '1.0848']], '1.0930'), [0, None, '0.00', '0.00']),\n  ('control: flip long to short', ([[100, '1.10'], [-150, '1.00']], '1.05'), [-50, '1.000000', '-10.00', '-2.50']),\n  ('control: close short', ([[-100, '1.10'], [100, '1.00']], '1.05'), [0, None, '10.00', '0.00']),\n  ('control: zero trade only', ([[0, '1.10']], '1.05'), [0, None, '0.00', '0.00']),\n  ('control: short add', ([[-30, '1.0833'], [-70, '1.0851']], '1.0800'), [-100, '1.084560', '0.00', '0.46'])],\n [('regression zero-quantity-trade 1', ([[0, '1.1213'], [0, '1.0823']], '1.1168'), [0, None, '0.00', '0.00']),\n  ('regression zero-quantity-trade 2', ([[0, '1.0532']], '1.1383'), [0, None, '0.00', '0.00']),\n  ('control: short add', ([[-30, '1.0833'], [-70, '1.0851']], '1.0800'), [-100, '1.084560', '0.00', '0.46']),\n  ('control: three reductions', ([[300, '1.0711'], [-100, '1.0733'], [-100, '1.0745'], [-100, '1.0719']], '1.07'),\n   [0, None, '0.64', '0.00']),\n  ('control: zero between', ([[50, '1.1'], [-50, '1.2'], [0, '1.3'], [20, '1.4']], '1.5'),\n   [20, '1.400000', '5.00', '2.00']),\n  ('control: flip short to long', ([[-40, '1.2'], [100, '1.1']], '1.15'), [60, '1.100000', '4.00', '3.00'])]]\nfor label, args, expected in cases[N - 1]:\n    check(label, solve(*args), expected)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"},"fixed":{"sha256":"ff95ed2f2538e797183e3267e3c626a36588a9dd315686364dafd003c3192697","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nfrom decimal import Decimal, ROUND_HALF_EVEN, ROUND_HALF_UP, ROUND_FLOOR, ROUND_CEILING, ROUND_DOWN, ROUND_UP, ROUND_HALF_DOWN\nfrom fractions import Fraction\nN = 1\nobservations = []\ndef solve(trades, spot):\n    def fmt(fr, e):\n        d = (Decimal(fr.numerator) / Decimal(fr.denominator)).quantize(Decimal(1).scaleb(-e), rounding=ROUND_HALF_EVEN)\n        return format(abs(d) if d == 0 else d, 'f')\n    pos, avg, realized = 0, None, Fraction(0)\n    for qty, rate in trades:\n        r = Fraction(rate)\n        if qty == 0: continue\n        if pos == 0 or (pos > 0) == (qty > 0):\n            avg = r if pos == 0 else (abs(pos) * avg + abs(qty) * r) / (abs(pos) + abs(qty))\n            pos += qty\n        else:\n            closed = min(abs(qty), abs(pos))\n            sgn = 1 if pos > 0 else -1\n            realized += closed * (r - avg) * sgn\n            pos += qty\n            if pos == 0: avg = None\n            elif (pos > 0) != (sgn > 0): avg = r\n    unreal = pos * (Fraction(spot) - avg) if pos else Fraction(0)\n    return [pos, None if avg is None else fmt(avg, 6), fmt(realized, 2), fmt(unreal, 2)]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncases = [[('regression zero-quantity-trade 1', ([[0, '1.10']], '1.05'), [0, None, '0.00', '0.00']),\n  ('regression zero-quantity-trade 2', ([[50, '1.1'], [-50, '1.2'], [0, '1.3']], '1.5'), [0, None, '5.00', '0.00']),\n  ('control: add then reduce', ([[100, '1.10'], [100, '1.20'], [-50, '1.30']], '1.25'),\n   [150, '1.150000', '7.50', '15.00']),\n  ('control: flip long to short', ([[100, '1.10'], [-150, '1.00']], '1.05'), [-50, '1.000000', '-10.00', '-2.50']),\n  ('control: close short', ([[-100, '1.10'], [100, '1.00']], '1.05'), [0, None, '10.00', '0.00']),\n  ('control: short add', ([[-30, '1.0833'], [-70, '1.0851']], '1.0800'), [-100, '1.084560', '0.00', '0.46'])],\n [('regression zero-quantity-trade 1', ([[0, '1.1473'], [0, '1.0737']], '1.1228'), [0, None, '0.00', '0.00']),\n  ('regression zero-quantity-trade 2', ([[0, '1.1043']], '1.1389'), [0, None, '0.00', '0.00']),\n  ('control: zero trade only', ([[0, '1.10']], '1.05'), [0, None, '0.00', '0.00']),\n  ('control: short add', ([[-30, '1.0833'], [-70, '1.0851']], '1.0800'), [-100, '1.084560', '0.00', '0.46']),\n  ('control: three reductions', ([[300, '1.0711'], [-100, '1.0733'], [-100, '1.0745'], [-100, '1.0719']], '1.07'),\n   [0, None, '0.64', '0.00']),\n  ('control: zero between', ([[50, '1.1'], [-50, '1.2'], [0, '1.3'], [20, '1.4']], '1.5'),\n   [20, '1.400000', '5.00', '2.00'])],\n [('regression zero-quantity-trade 1', ([[0, '1.0667']], '1.1026'), [0, None, '0.00', '0.00']),\n  ('regression zero-quantity-trade 2', ([[0, '1.0905']], '1.0908'), [0, None, '0.00', '0.00']),\n  ('control: zero between', ([[50, '1.1'], [-50, '1.2'], [0, '1.3'], [20, '1.4']], '1.5'),\n   [20, '1.400000', '5.00', '2.00']),\n  ('control: flip short to long', ([[-40, '1.2'], [100, '1.1']], '1.15'), [60, '1.100000', '4.00', '3.00']),\n  ('control: add then reduce', ([[100, '1.10'], [100, '1.20'], [-50, '1.30']], '1.25'),\n   [150, '1.150000', '7.50', '15.00']),\n  ('control: flip long to short', ([[100, '1.10'], [-150, '1.00']], '1.05'), [-50, '1.000000', '-10.00', '-2.50'])],\n [('regression zero-quantity-trade 1', ([[0, '1.1082']], '1.0890'), [0, None, '0.00', '0.00']),\n  ('regression zero-quantity-trade 2', ([[0, '1.0848']], '1.0930'), [0, None, '0.00', '0.00']),\n  ('control: flip long to short', ([[100, '1.10'], [-150, '1.00']], '1.05'), [-50, '1.000000', '-10.00', '-2.50']),\n  ('control: close short', ([[-100, '1.10'], [100, '1.00']], '1.05'), [0, None, '10.00', '0.00']),\n  ('control: zero trade only', ([[0, '1.10']], '1.05'), [0, None, '0.00', '0.00']),\n  ('control: short add', ([[-30, '1.0833'], [-70, '1.0851']], '1.0800'), [-100, '1.084560', '0.00', '0.46'])],\n [('regression zero-quantity-trade 1', ([[0, '1.1213'], [0, '1.0823']], '1.1168'), [0, None, '0.00', '0.00']),\n  ('regression zero-quantity-trade 2', ([[0, '1.0532']], '1.1383'), [0, None, '0.00', '0.00']),\n  ('control: short add', ([[-30, '1.0833'], [-70, '1.0851']], '1.0800'), [-100, '1.084560', '0.00', '0.46']),\n  ('control: three reductions', ([[300, '1.0711'], [-100, '1.0733'], [-100, '1.0745'], [-100, '1.0719']], '1.07'),\n   [0, None, '0.64', '0.00']),\n  ('control: zero between', ([[50, '1.1'], [-50, '1.2'], [0, '1.3'], [20, '1.4']], '1.5'),\n   [20, '1.400000', '5.00', '2.00']),\n  ('control: flip short to long', ([[-40, '1.2'], [100, '1.1']], '1.15'), [60, '1.100000', '4.00', '3.00'])]]\nfor label, args, expected in cases[N - 1]:\n    check(label, solve(*args), expected)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"}},"limitations":"A deterministic, bounded teaching model with a stipulated toy contract; it makes no claim of conformance to any real regulation, standard, or institution's rules. This reproducer isolates one failure mechanism. Results cover the supplied fixtures. Variants within a family share a test contract and should remain grouped when constructing evaluation splits. Related mechanisms with a shared evaluation_group must also remain together; these controlled models are not independent production incidents.","method":"Deterministic executable model with adversarial boundary fixtures.","provenance":{"created_by":"Failure Map","dependencies":"Python standard library","family":"w2-currency_rounding_and_fx_conversion-fx-position-average-rate-zero-quantity-trade","generated_at":"2026-09-29T14:47:01.017973+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Currency amounts must be rounded at the right stage and in the right unit, or ledgers, quotes and settlements drift by minor units.","repair":"Ignore zero-quantity trades entirely.","root_cause":"Zero-quantity trades are not skipped, so a flat position opens an average at the trade rate.","sha256":"dc1546750921eec03cdfb9f0979bd521712e0dde7f10f9bd2f5b54c1fe616531","title":"A zero-quantity fill on a flat position invents an average rate · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":43.009,"exit_code":1,"observations":[{"actual":[0,"1.100000","0.00","0.00"],"check":"regression zero-quantity-trade 1","expected":[0,null,"0.00","0.00"],"passed":false},{"actual":[0,"1.300000","5.00","0.00"],"check":"regression zero-quantity-trade 2","expected":[0,null,"5.00","0.00"],"passed":false},{"actual":[150,"1.150000","7.50","15.00"],"check":"control: add then reduce","expected":[150,"1.150000","7.50","15.00"],"passed":true},{"actual":[-50,"1.000000","-10.00","-2.50"],"check":"control: flip long to short","expected":[-50,"1.000000","-10.00","-2.50"],"passed":true},{"actual":[0,null,"10.00","0.00"],"check":"control: close short","expected":[0,null,"10.00","0.00"],"passed":true},{"actual":[-100,"1.084560","0.00","0.46"],"check":"control: short add","expected":[-100,"1.084560","0.00","0.46"],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression zero-quantity-trade 1\", \"actual\": [0, \"1.100000\", \"0.00\", \"0.00\"], \"expected\": [0, null, \"0.00\", \"0.00\"], \"passed\": false}, {\"check\": \"regression zero-quantity-trade 2\", \"actual\": [0, \"1.300000\", \"5.00\", \"0.00\"], \"expected\": [0, null, \"5.00\", \"0.00\"], \"passed\": false}, {\"check\": \"control: add then reduce\", \"actual\": [150, \"1.150000\", \"7.50\", \"15.00\"], \"expected\": [150, \"1.150000\", \"7.50\", \"15.00\"], \"passed\": true}, {\"check\": \"control: flip long to short\", \"actual\": [-50, \"1.000000\", \"-10.00\", \"-2.50\"], \"expected\": [-50, \"1.000000\", \"-10.00\", \"-2.50\"], \"passed\": true}, {\"check\": \"control: close short\", \"actual\": [0, null, \"10.00\", \"0.00\"], \"expected\": [0, null, \"10.00\", \"0.00\"], \"passed\": true}, {\"check\": \"control: short add\", \"actual\": [-100, \"1.084560\", \"0.00\", \"0.46\"], \"expected\": [-100, \"1.084560\", \"0.00\", \"0.46\"], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":44.833,"exit_code":1,"observations":[{"actual":[0,"1.100000","0.00","0.00"],"check":"regression zero-quantity-trade 1","expected":[0,null,"0.00","0.00"],"passed":false},{"actual":[0,"1.300000","5.00","0.00"],"check":"regression zero-quantity-trade 2","expected":[0,null,"5.00","0.00"],"passed":false},{"actual":[150,"1.150000","7.50","15.00"],"check":"control: add then reduce","expected":[150,"1.150000","7.50","15.00"],"passed":true},{"actual":[-50,"1.000000","-10.00","-2.50"],"check":"control: flip long to short","expected":[-50,"1.000000","-10.00","-2.50"],"passed":true},{"actual":[0,null,"10.00","0.00"],"check":"control: close short","expected":[0,null,"10.00","0.00"],"passed":true},{"actual":[-100,"1.084560","0.00","0.46"],"check":"control: short add","expected":[-100,"1.084560","0.00","0.46"],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression zero-quantity-trade 1\", \"actual\": [0, \"1.100000\", \"0.00\", \"0.00\"], \"expected\": [0, null, \"0.00\", \"0.00\"], \"passed\": false}, {\"check\": \"regression zero-quantity-trade 2\", \"actual\": [0, \"1.300000\", \"5.00\", \"0.00\"], \"expected\": [0, null, \"5.00\", \"0.00\"], \"passed\": false}, {\"check\": \"control: add then reduce\", \"actual\": [150, \"1.150000\", \"7.50\", \"15.00\"], \"expected\": [150, \"1.150000\", \"7.50\", \"15.00\"], \"passed\": true}, {\"check\": \"control: flip long to short\", \"actual\": [-50, \"1.000000\", \"-10.00\", \"-2.50\"], \"expected\": [-50, \"1.000000\", \"-10.00\", \"-2.50\"], \"passed\": true}, {\"check\": \"control: close short\", \"actual\": [0, null, \"10.00\", \"0.00\"], \"expected\": [0, null, \"10.00\", \"0.00\"], \"passed\": true}, {\"check\": \"control: short add\", \"actual\": [-100, \"1.084560\", \"0.00\", \"0.46\"], \"expected\": [-100, \"1.084560\", \"0.00\", \"0.46\"], \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":44.201,"exit_code":0,"observations":[{"actual":[0,null,"0.00","0.00"],"check":"regression zero-quantity-trade 1","expected":[0,null,"0.00","0.00"],"passed":true},{"actual":[0,null,"5.00","0.00"],"check":"regression zero-quantity-trade 2","expected":[0,null,"5.00","0.00"],"passed":true},{"actual":[150,"1.150000","7.50","15.00"],"check":"control: add then reduce","expected":[150,"1.150000","7.50","15.00"],"passed":true},{"actual":[-50,"1.000000","-10.00","-2.50"],"check":"control: flip long to short","expected":[-50,"1.000000","-10.00","-2.50"],"passed":true},{"actual":[0,null,"10.00","0.00"],"check":"control: close short","expected":[0,null,"10.00","0.00"],"passed":true},{"actual":[-100,"1.084560","0.00","0.46"],"check":"control: short add","expected":[-100,"1.084560","0.00","0.46"],"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression zero-quantity-trade 1\", \"actual\": [0, null, \"0.00\", \"0.00\"], \"expected\": [0, null, \"0.00\", \"0.00\"], \"passed\": true}, {\"check\": \"regression zero-quantity-trade 2\", \"actual\": [0, null, \"5.00\", \"0.00\"], \"expected\": [0, null, \"5.00\", \"0.00\"], \"passed\": true}, {\"check\": \"control: add then reduce\", \"actual\": [150, \"1.150000\", \"7.50\", \"15.00\"], \"expected\": [150, \"1.150000\", \"7.50\", \"15.00\"], \"passed\": true}, {\"check\": \"control: flip long to short\", \"actual\": [-50, \"1.000000\", \"-10.00\", \"-2.50\"], \"expected\": [-50, \"1.000000\", \"-10.00\", \"-2.50\"], \"passed\": true}, {\"check\": \"control: close short\", \"actual\": [0, null, \"10.00\", \"0.00\"], \"expected\": [0, null, \"10.00\", \"0.00\"], \"passed\": true}, {\"check\": \"control: short add\", \"actual\": [-100, \"1.084560\", \"0.00\", \"0.46\"], \"expected\": [-100, \"1.084560\", \"0.00\", \"0.46\"], \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}