mirror of
https://github.com/wassname/catalyst.git
synced 2026-07-31 12:10:31 +08:00
Unit tested ingestion of bundle chunks. This may not be stable yet.
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user