Unit tested ingestion of bundle chunks. This may not be stable yet.

This commit is contained in:
fredfortier
2017-10-13 16:29:43 -04:00
parent c658d15fcb
commit 93f4d31399
6 changed files with 118 additions and 128 deletions
@@ -91,6 +91,7 @@ def _handle_data(context, data):
elif position.amount > 0 and \
price > cost_basis * (1 + context.PROFIT_TARGET):
profit = (price * position.amount) - (cost_basis * position.amount)
log.info('closing position, taking profit: {}'.format(profit))
order_target_percent(
asset=context.asset,