Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…robot into master
  • Loading branch information
areed1192 committed Nov 10, 2020
2 parents f37895a + f004eb7 commit c0536b4
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions pyrobot/robot.py
Original file line number Diff line number Diff line change
Expand Up @@ -882,7 +882,7 @@ def get_accounts(self, account_number: str = None, all_accounts: bool = False) -
redirect_uri=REDIRECT_URI,
credentials_path=CREDENTIALS_PATH
)
>>> trading_robot_accounts = tradeconsole_session.get_accounts(
>>> trading_robot_accounts = trading_robot.session.get_accounts(
account_number="<YOUR ACCOUNT NUMBER>"
)
>>> trading_robot_accounts
Expand Down Expand Up @@ -1071,7 +1071,7 @@ def get_positions(self, account_number: str = None, all_accounts: bool = False)
redirect_uri=REDIRECT_URI,
credentials_path=CREDENTIALS_PATH
)
>>> trading_robot_positions = tradeconsole_session.get_positions(
>>> trading_robot_positions = trading_robot.session.get_positions(
account_number="<YOUR ACCOUNT NUMBER>"
)
>>> trading_robot_positions
Expand Down Expand Up @@ -1149,7 +1149,7 @@ def _parse_account_positions(self, positions_response: Union[List, Dict]) -> Lis

if isinstance(positions_response, dict):

position_dict = {}


for account_type_key in positions_response:

Expand All @@ -1159,6 +1159,7 @@ def _parse_account_positions(self, positions_response: Union[List, Dict]) -> Lis
positions = account_info['positions']

for position in positions:
position_dict = {}
position_dict['account_number'] = account_id
position_dict['average_price'] = position['averagePrice']
position_dict['market_value'] = position['marketValue']
Expand Down Expand Up @@ -1188,7 +1189,7 @@ def _parse_account_positions(self, positions_response: Union[List, Dict]) -> Lis

for account in positions_response:

position_dict = {}


for account_type_key in account:

Expand All @@ -1198,6 +1199,7 @@ def _parse_account_positions(self, positions_response: Union[List, Dict]) -> Lis
positions = account_info['positions']

for position in positions:
position_dict = {}
position_dict['account_number'] = account_id
position_dict['average_price'] = position['averagePrice']
position_dict['market_value'] = position['marketValue']
Expand Down

0 comments on commit c0536b4

Please sign in to comment.