Start working on strategy evaluation

This commit is contained in:
2020-10-26 21:44:18 -04:00
parent d112dce5f5
commit 85a9c4fcb3
8 changed files with 438 additions and 83 deletions

View File

@@ -75,6 +75,7 @@ def get_portfolio_value(holding, prices):
def handle_order(date, order, holding, prices, commission, impact):
"""Process the order."""
symbol, order, shares = order
assert(shares > 0) # Can only buy or sell positive amount of shares.
adj_closing_price = prices[symbol]
cost = shares * adj_closing_price
# Charge commission and deduct impact penalty