fix: trend preview uses USDT profit, snapshot risk budget, and money RR across four exchanges
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+16
-3
@@ -597,7 +597,14 @@ def _fetch_preview(pid):
|
||||
from strategy_trend_lib import build_trend_preview_level_rows
|
||||
|
||||
enriched, level_rows = build_trend_preview_level_rows(d)
|
||||
for key in ("preview_target_rr", "preview_first_take_profit", "preview_unified_stop_loss"):
|
||||
for key in (
|
||||
"preview_target_rr",
|
||||
"preview_first_take_profit",
|
||||
"preview_unified_stop_loss",
|
||||
"preview_risk_amount_u",
|
||||
"preview_first_profit_u",
|
||||
"preview_take_profit_price",
|
||||
):
|
||||
if key in enriched:
|
||||
d[key] = enriched[key]
|
||||
d["preview_level_rows"] = level_rows
|
||||
@@ -607,9 +614,15 @@ def _fetch_preview(pid):
|
||||
"label": row.get("label"),
|
||||
"price": row.get("price"),
|
||||
"contracts": row.get("contracts"),
|
||||
"cum_contracts": row.get("cum_contracts"),
|
||||
"avg_entry": row.get("avg_entry"),
|
||||
"take_profit": row.get("take_profit"),
|
||||
"stop_loss": row.get("stop_loss"),
|
||||
"take_profit_price": row.get("take_profit_price"),
|
||||
"profit_u": row.get("profit_u"),
|
||||
"risk_u": row.get("risk_u"),
|
||||
"rr": row.get("rr"),
|
||||
"stop_loss_price": row.get("stop_loss_price"),
|
||||
"take_profit": row.get("profit_u"),
|
||||
"stop_loss": row.get("risk_u"),
|
||||
}
|
||||
for row in level_rows
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user