def test_stop_losses(self):
    expected_transactions_quantities = [8130, (- 127), 1, (- 8004), 7454, (- 58), (- 7396), 6900, (- 6900), 6390, (- 44), (- 6346), 5718, (- 36)]
    result_transactions_quantities = [t.quantity for t in self.transactions]
    assert_equal(expected_transactions_quantities, result_transactions_quantities)
    expected_transactions_prices = [125, 130, 135, 235.6, 255, 260, 259.35, 280, 264.1, 285, 290, 282, 315, 320]
    result_transactions_prices = [t.price for t in self.transactions]
    assert_almost_equal(expected_transactions_prices, result_transactions_prices)
    expected_portfolio_values = [1024390, 1064659, 1064659, 1064659, 1104677, 1144697, 1184717, 1224737, 1264757, 1264757, 1264757, 1304777, 1344797, 1384817, 1424837, 1464857, 1464857, 1464857, 1504877, 1544897, 1584917, 1624937, 1664957, 1664957, 1664957, 1704977, 1744997, 1785017, 1825037, 1865057, 1865057, 1865057, 1905077, 1945097, 1985117, 1885867.4, 1908229.4, 1908229.4, 1908229.4, 1945325.4, 1982305.4, 2019285.4, 1918330, 1808620, 1808620, 1808620, 1827790, 1859608, 1891338, 1923068, 1954798, 1954798, 1954798, 1789802, 1806956, 1835438, 1863848, 1892258, 1892258]
    assert_almost_equal(expected_portfolio_values, list(self.portfolio.portfolio_eod_series()))
def test_stop_losses(self):
    expected_transactions_quantities = [8130, (- 127), 1, (- 8004), 7454, (- 58), (- 7396), 6900, (- 6900), 6390, (- 44), (- 6346), 5718, (- 36)]
    result_transactions_quantities = [t.quantity for t in self.transactions]
    assert_equal(expected_transactions_quantities, result_transactions_quantities)
    expected_transactions_prices = [125, 130, 135, 235.6, 255, 260, 259.35, 280, 264.1, 285, 290, 282, 315, 320]
    result_transactions_prices = [t.price for t in self.transactions]
    assert_almost_equal(expected_transactions_prices, result_transactions_prices)
    expected_portfolio_values = [1024390, 1064659, 1064659, 1064659, 1104677, 1144697, 1184717, 1224737, 1264757, 1264757, 1264757, 1304777, 1344797, 1384817, 1424837, 1464857, 1464857, 1464857, 1504877, 1544897, 1584917, 1624937, 1664957, 1664957, 1664957, 1704977, 1744997, 1785017, 1825037, 1865057, 1865057, 1865057, 1905077, 1945097, 1985117, 1885867.4, 1908229.4, 1908229.4, 1908229.4, 1945325.4, 1982305.4, 2019285.4, 1918330, 1808620, 1808620, 1808620, 1827790, 1859608, 1891338, 1923068, 1954798, 1954798, 1954798, 1789802, 1806956, 1835438, 1863848, 1892258, 1892258]
    assert_almost_equal(expected_portfolio_values, list(self.portfolio.portfolio_eod_series()))