Example #1
0
def test_increasingrate_doublebuy():
    t = Trades()
    t.buy(Trade(0.0, 1, "x", 1.0))
    t.buy(Trade(1.0, 1, "x", 2.0))

    assert t.value_of_this_stock(1.5, "x", 2.0) == 4.0
Example #2
0
def test_value_of_this_stock():
    t = Trades()
    t.buy(Trade(0.0, 1, "x", 2.0))

    assert t.value_of_this_stock(1.0, "x", 2.1) == 2.1