Skip to content

Incomplete get_positions() function #12

@Tippsie

Description

@Tippsie

The get_position() function in APP(binance_interface/app/account/account_um.py) is incomplete. It can only return the "LONG" holding positions. "SHORT" positions are never listed.
Please check and modify line 144 by adding abs to positionAmt attribute as short positions hold your property by a negative amount.

143:            for v in result['data']['positions']:
144:               if 'positionAmt' in v.keys() and float(v['positionAmt']) > 0:
145:                  this_symbol = v['symbol']
143:            for v in result['data']['positions']:
144:               if 'positionAmt' in v.keys() and abs(float(v['positionAmt'])) > 0: # abs() value returns both Long and short positions
145:                  this_symbol = v['symbol']

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions