|
@@ -24,3 +24,20 @@ def place_order(ownable_id):
|
|
stop_loss=False,
|
|
stop_loss=False,
|
|
amount=amount,
|
|
amount=amount,
|
|
expiry=expiry)
|
|
expiry=expiry)
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+def main(): # TODO testen
|
|
|
|
+ """the initial part of the trading bot algorithm"""
|
|
|
|
+ if model.get_user_orders(model.bank_id()):
|
|
|
|
+ raise AssertionError('The trading bot already has some orders.')
|
|
|
|
+ if input('Are you sure you want to set the trading bots initial orders? (type in "yes" or something else):') == 'yes':
|
|
|
|
+ for ownable_id in model.ownable_ids():
|
|
|
|
+ if ownable_id != model.currency_id():
|
|
|
|
+ place_order(ownable_id)
|
|
|
|
+ else:
|
|
|
|
+ print('Not placing orders.')
|
|
|
|
+ model.cleanup()
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+if __name__ == '__main__':
|
|
|
|
+ main()
|