Start working on strategy evaluation
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user