|
@@ -79,6 +79,8 @@ def cancel_order(order_no=None):
|
|
|
|
|
|
|
|
|
|
def change_password(password=None, retype_password=None):
|
|
def change_password(password=None, retype_password=None):
|
|
|
|
+ if password != retype_password:
|
|
|
|
+ password = None
|
|
if password is None:
|
|
if password is None:
|
|
while True:
|
|
while True:
|
|
if sys.stdin.isatty():
|
|
if sys.stdin.isatty():
|
|
@@ -186,6 +188,9 @@ def buy(amount=None, object_name=None, limit='', stop_loss='', time_until_expira
|
|
else:
|
|
else:
|
|
limit = None
|
|
limit = None
|
|
stop_loss = None
|
|
stop_loss = None
|
|
|
|
+ if limit is not None and stop_loss == '':
|
|
|
|
+ stop_loss = yn_dialog('Is this a stop-loss limit?')
|
|
|
|
+
|
|
if time_until_expiration is None:
|
|
if time_until_expiration is None:
|
|
time_until_expiration = input('Time until order expires (minutes, default 60):')
|
|
time_until_expiration = input('Time until order expires (minutes, default 60):')
|
|
if time_until_expiration == '':
|
|
if time_until_expiration == '':
|
|
@@ -204,7 +209,7 @@ def buy(amount=None, object_name=None, limit='', stop_loss='', time_until_expira
|
|
'to see if the order has been executed already.')
|
|
'to see if the order has been executed already.')
|
|
|
|
|
|
|
|
|
|
-def sell(amount=None, object_name=None, limit=None, stop_loss=None, time_until_expiration=None):
|
|
|
|
|
|
+def sell(amount=None, object_name=None, limit=None, stop_loss='', time_until_expiration=None):
|
|
if object_name is None: # TODO list some available objects
|
|
if object_name is None: # TODO list some available objects
|
|
object_name = input('Name of object to sell: ')
|
|
object_name = input('Name of object to sell: ')
|
|
if amount is None:
|
|
if amount is None:
|
|
@@ -213,10 +218,11 @@ def sell(amount=None, object_name=None, limit=None, stop_loss=None, time_until_e
|
|
set_limit = yn_dialog('Do you want to place a limit?')
|
|
set_limit = yn_dialog('Do you want to place a limit?')
|
|
if set_limit:
|
|
if set_limit:
|
|
limit = input('Limit: ')
|
|
limit = input('Limit: ')
|
|
|
|
+ stop_loss = yn_dialog('Is this a stop-loss limit?')
|
|
else:
|
|
else:
|
|
limit = None
|
|
limit = None
|
|
stop_loss = None
|
|
stop_loss = None
|
|
- if limit is not None:
|
|
|
|
|
|
+ if limit is not None and stop_loss == '':
|
|
stop_loss = yn_dialog('Is this a stop-loss limit?')
|
|
stop_loss = yn_dialog('Is this a stop-loss limit?')
|
|
|
|
|
|
if time_until_expiration is None:
|
|
if time_until_expiration is None:
|