TaUse08HoldingDays.expected.txt
lib/advantage/trading-actions-on-verb/08-holding-days/TaUse08HoldingDays.expected.txt · 22 line(s) · txt
== Use case 8: holding days ==
buy 100 @ 5000 on day 10 : ok
ok age on day 10 = 0
hold to day 25 : ok
ok age on day 25 = 15
ok book day = 25
hold back to day 20 : refused: day goes backwards
ok book day unchanged by the refusal = 25
hold to day 40 : ok
ok oldest age on day 40 = 30
-- a day before the book day has no answer, never a negative age --
ok age asked for day 30 (book day is 40) = -1
ok oldest age asked for day 30 = -1
ok weighted age asked for day 30 = -1
ok shares older than 5 days asked for day 30 = -1
ok isLongTerm is false for an invalid day
flatten on day 40 @ 5100 : ok
ok oldest age when flat = -1
ok weighted age when flat = 0
ok invariants hold
checks passed=13 failed=0