merge lavoro/goldrake-u4 (revisione 27/09)

This commit is contained in:
2026-09-27 13:53:10 +00:00
9 changed files with 454 additions and 45 deletions
+5 -1
View File
@@ -116,7 +116,11 @@ def test_fifo_non_mescola_gli_asset():
_f("2026-01-02T00:00:00+00:00", "ETH", "sell", 1.0, 100.0)]
rts, aperti = T.fifo_roundtrips(fills)
assert rts == [] # la vendita ETH non chiude il long BTC
assert set(aperti) == {"BTC"}
# (#32 C2) una vendita ETH senza lotti long apre un SHORT — non sparisce piu' in silenzio:
# e' comunque isolata dal long BTC, che e' quel che il test verifica.
assert set(aperti) == {"BTC", "ETH"}
assert aperti["BTC"][0]["direzione"] == "long"
assert aperti["ETH"][0]["direzione"] == "short"
def test_fifo_riproduce_il_conto_del_libro_vero():