Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions schwab_api/schwab.py
Original file line number Diff line number Diff line change
Expand Up @@ -708,6 +708,19 @@ def get_account_info_v2(self):
position["symbolDetail"]["schwabSecurityId"]
)._as_dict()
)
if "childOptionHoldings" in position:
for child_position in position["childOptionHoldings"]:
positions.append(
Position(
child_position["symbolDetail"]["symbol"],
child_position["symbolDetail"]["description"],
float(child_position["quantity"]),
0 if "costDetail" not in child_position else float(child_position["costDetail"]["costBasisDetail"]["costBasis"]),
0 if "priceDetail" not in child_position else float(child_position["priceDetail"]["marketValue"]),
child_position["symbolDetail"]["schwabSecurityId"]
)._as_dict()
)

if not valid_parse:
continue
account_info[int(account["accountId"])] = Account(
Expand Down