|
@@ -134,13 +134,13 @@ def help():
|
|
|
params = signature(method).parameters
|
|
|
command_table.append([cmd] + [p for p in params])
|
|
|
|
|
|
- print(_my_tabulate(command_table,tablefmt='pipe',headers=['command',
|
|
|
- 'param 1',
|
|
|
- 'param 2',
|
|
|
- 'param 3',
|
|
|
- 'param 4',
|
|
|
- 'param 5',
|
|
|
- ]))
|
|
|
+ print(_my_tabulate(command_table, tablefmt='pipe', headers=['command',
|
|
|
+ 'param 1',
|
|
|
+ 'param 2',
|
|
|
+ 'param 3',
|
|
|
+ 'param 4',
|
|
|
+ 'param 5',
|
|
|
+ ]))
|
|
|
print('NOTE:')
|
|
|
print(' All parameters for all commands are optional!')
|
|
|
print(' Commands can be combined in one line with ; between them.')
|
|
@@ -231,7 +231,7 @@ def buy(obj_name=None, amount=None, limit='', stop_loss='', expiry=None):
|
|
|
if limit is not None and \
|
|
|
float(limit) <= 0 and \
|
|
|
input(input('Are you sure you want to use such a low limit (limit=' + str(
|
|
|
- limit) + '? (type in "yes" or something else):') != 'yes'):
|
|
|
+ limit) + '? (type in "yes" or something else):') != 'yes'):
|
|
|
print('Order was not placed.')
|
|
|
return
|
|
|
|
|
@@ -278,7 +278,7 @@ def sell(obj_name=None, amount=None, limit='', stop_loss='', expiry=None):
|
|
|
if limit is not None and \
|
|
|
float(limit) <= 0 and \
|
|
|
input(input('Are you sure you want to use such a low limit (limit=' + str(
|
|
|
- limit) + '? (type in "yes" or something else):') != 'yes'):
|
|
|
+ limit) + '? (type in "yes" or something else):') != 'yes'):
|
|
|
print('Order was not placed.')
|
|
|
return
|
|
|
|
|
@@ -381,6 +381,12 @@ def tradables():
|
|
|
print(_my_tabulate(response['data'],
|
|
|
headers=['Name', 'Course', 'Market Cap.'],
|
|
|
tablefmt="pipe"))
|
|
|
+ world_wealth = 0
|
|
|
+ for row in response['data']:
|
|
|
+ if row[2] is not None:
|
|
|
+ world_wealth += row[2]
|
|
|
+ print('Estimated worldwide wealth:', world_wealth)
|
|
|
+
|
|
|
else:
|
|
|
if 'error_message' in response:
|
|
|
print('Data access failed with message:', response['error_message'])
|