fix: ctp_list_positions pass refresh_margin to fix empty positions
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+7
-2
@@ -1027,11 +1027,16 @@ def ctp_get_account(mode: str) -> dict[str, Any]:
|
||||
return b.get_account()
|
||||
|
||||
|
||||
def ctp_list_positions(mode: str, *, refresh_if_empty: bool = True) -> list[dict[str, Any]]:
|
||||
def ctp_list_positions(
|
||||
mode: str,
|
||||
*,
|
||||
refresh_if_empty: bool = True,
|
||||
refresh_margin: bool = False,
|
||||
) -> list[dict[str, Any]]:
|
||||
b = get_bridge()
|
||||
if b.connected_mode != mode or not b.ping():
|
||||
return []
|
||||
return b.list_positions(refresh_if_empty=refresh_if_empty)
|
||||
return b.list_positions(refresh_if_empty=refresh_if_empty, refresh_margin=refresh_margin)
|
||||
|
||||
|
||||
def ctp_list_active_orders(mode: str) -> list[dict[str, Any]]:
|
||||
|
||||
Reference in New Issue
Block a user