|
@@ -608,9 +608,12 @@ class Strategy(Strategy):
|
|
|
def render(self):
|
|
def render(self):
|
|
|
# Refresh the market-derived display values on render so the dashboard
|
|
# Refresh the market-derived display values on render so the dashboard
|
|
|
# reflects the same inputs the strategy would use on the next tick.
|
|
# reflects the same inputs the strategy would use on the next tick.
|
|
|
|
|
+ live_step_pct = float(self.state.get("grid_step_pct") or 0.0)
|
|
|
|
|
+ live_atr_pct = float(self.state.get("atr_percent") or 0.0)
|
|
|
try:
|
|
try:
|
|
|
self._refresh_balance_snapshot()
|
|
self._refresh_balance_snapshot()
|
|
|
- self._grid_step_pct()
|
|
|
|
|
|
|
+ live_step_pct = self._grid_step_pct()
|
|
|
|
|
+ live_atr_pct = float(self.state.get("atr_percent") or live_atr_pct)
|
|
|
except Exception as exc:
|
|
except Exception as exc:
|
|
|
self._log(f"render refresh failed: {exc}")
|
|
self._log(f"render refresh failed: {exc}")
|
|
|
|
|
|
|
@@ -622,8 +625,8 @@ class Strategy(Strategy):
|
|
|
{"type": "metric", "label": "state", "value": self.state.get("last_action", "idle")},
|
|
{"type": "metric", "label": "state", "value": self.state.get("last_action", "idle")},
|
|
|
{"type": "metric", "label": "orders", "value": len(self.state.get("orders") or [])},
|
|
{"type": "metric", "label": "orders", "value": len(self.state.get("orders") or [])},
|
|
|
{"type": "metric", "label": "open orders", "value": self.state.get("open_order_count", 0)},
|
|
{"type": "metric", "label": "open orders", "value": self.state.get("open_order_count", 0)},
|
|
|
- {"type": "metric", "label": "ATR %", "value": round(float(self.state.get("atr_percent") or 0.0), 4)},
|
|
|
|
|
- {"type": "metric", "label": "grid step %", "value": round(float(self.state.get("grid_step_pct") or 0.0) * 100.0, 4)},
|
|
|
|
|
|
|
+ {"type": "metric", "label": "ATR %", "value": round(live_atr_pct, 4)},
|
|
|
|
|
+ {"type": "metric", "label": "grid step %", "value": round(live_step_pct * 100.0, 4)},
|
|
|
{"type": "metric", "label": "1d", "value": ((self.state.get('regimes') or {}).get('1d') or {}).get('trend', {}).get('state', 'n/a')},
|
|
{"type": "metric", "label": "1d", "value": ((self.state.get('regimes') or {}).get('1d') or {}).get('trend', {}).get('state', 'n/a')},
|
|
|
{"type": "metric", "label": "4h", "value": ((self.state.get('regimes') or {}).get('4h') or {}).get('trend', {}).get('state', 'n/a')},
|
|
{"type": "metric", "label": "4h", "value": ((self.state.get('regimes') or {}).get('4h') or {}).get('trend', {}).get('state', 'n/a')},
|
|
|
{"type": "metric", "label": "1h", "value": ((self.state.get('regimes') or {}).get('1h') or {}).get('trend', {}).get('state', 'n/a')},
|
|
{"type": "metric", "label": "1h", "value": ((self.state.get('regimes') or {}).get('1h') or {}).get('trend', {}).get('state', 'n/a')},
|