Skip to content

Instantly share code, notes, and snippets.

@WillForan
Created March 19, 2019 19:11
Show Gist options
  • Save WillForan/ec4b057d44595acaf442c54a42d7d1c9 to your computer and use it in GitHub Desktop.
Save WillForan/ec4b057d44595acaf442c54a42d7d1c9 to your computer and use it in GitHub Desktop.
[2019-03-19 18:27:45.593426] INFO: Algorithm: livetrader start running with backend = alpaca data-frequency = minute
have Portfolio({
'capital_used': 0.0,
'starting_cash': 0.0,
'portfolio_value': 22924.4,
'pnl': 0.0,
'returns': 0.0,
'cash': 87439.91,
'positions': {
Asset(03fb07bb-5db1-4077-8dea-5d711b272625, symbol=AMD, asset_name=AMD, exchange=NASDAQ): Position({
'asset': Asset(03fb07bb-5db1-4077-8dea-5d711b272625, symbol=AMD, asset_name=AMD, exchange=NASDAQ),
'amount': -2533,
'cost_basis': 24.62153178049743,
'last_sale_price': 25.4746,
'last_sale_date': Timestamp('2019-03-19 14:27:47.979000-0400', tz='America/New_York')}
)},
'start_date': None,
'positions_value': -64515.51
})
[2019-03-19 18:27:48.061286] INFO: ShortTest: before_trading_start hit
[2019-03-19 18:28:00.581557] INFO: ShortTest: buyback AMD @ $25.48
/home/foranw/.local/share/virtualenvs/alpaca-uaQd7gxB/lib/python3.6/site-packages/pylivetrader/protocol.py:301: UserWarning: Position lookup expected a value of type Asset but got str instead (AMD, order).
" instead ({1}, {2}).".format(type(key).__name__, key, calframe[1][3]))
[2019-03-19 18:28:01.130722] DEBUG: Alpaca: submitting market order for AMD - qty:2533, side:buy, limit_price:None, stop_price:None
[2019-03-19 18:28:01.238484] WARNING: Alpaca: order for symbol AMD is rejected insufficient position (0 < 2533)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment