From the getting-started tutorial:
def initialize(context):
# Reference to AAPL
context.aapl = sid(24)
def handle_data(context, data):
# Position 100% of our portfolio to be long in AAPL
order_target_percent(context.aapl, 1.00)
From 2008-03-03 to 2008-03-31 with $1,000,000 initial capital yields the following transaction history:
Only day with transactions, as expect (2008-03-03).
If someone can explain to me why there are 7 transactions.
4 Buys
2 Sells
1 Buy
Buys = $1.489M
Sells = $0.490M
What causes this? I would have expected it to buy roughly $1M worth of shares, and nothing over. It uses leverage when it never had to. Simply fill 100% of portfolio and do nothing. What am I missing?
Thanks,
M