Fix roll position display: live contracts, TP profit, and 2-decimal qty precision.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -55,6 +55,8 @@ def build_strategy_config(
|
||||
return float(row["current_capital"])
|
||||
|
||||
def get_position(ex_sym, direction):
|
||||
from lib.hub.hub_position_metrics import normalize_contracts_qty
|
||||
|
||||
qty = m.get_live_position_contracts(ex_sym, direction)
|
||||
entry = None
|
||||
try:
|
||||
@@ -77,7 +79,7 @@ def build_strategy_config(
|
||||
break
|
||||
except Exception:
|
||||
pass
|
||||
return {"contracts": float(qty or 0), "entry_price": entry}
|
||||
return {"contracts": normalize_contracts_qty(qty or 0), "entry_price": entry}
|
||||
|
||||
def amount_to_precision(ex_sym, amount):
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user