fix: include created_at in price_snapshot key monitor query
Avoid IndexError when rendering false breakout gate preview after the gate UI change. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -6301,7 +6301,7 @@ def api_account_snapshot():
|
||||
def api_price_snapshot():
|
||||
conn = get_db()
|
||||
key_rows = conn.execute(
|
||||
"SELECT id,symbol,monitor_type,direction,upper,lower,fib_entry_price,fib_limit_order_id FROM key_monitors"
|
||||
"SELECT id,symbol,monitor_type,direction,upper,lower,fib_entry_price,fib_limit_order_id,created_at FROM key_monitors"
|
||||
).fetchall()
|
||||
order_rows = conn.execute(
|
||||
"SELECT id,symbol,exchange_symbol,direction,trigger_price,stop_loss,initial_stop_loss,take_profit,margin_capital,leverage FROM order_monitors WHERE status='active'"
|
||||
@@ -6359,7 +6359,7 @@ def api_price_snapshot():
|
||||
prev = false_breakout_gate_preview(
|
||||
entry_display=entry_txt,
|
||||
limit_order_id=_sqlite_row_val(r, "fib_limit_order_id"),
|
||||
created_at=r["created_at"],
|
||||
created_at=_sqlite_row_val(r, "created_at"),
|
||||
now=app_now(),
|
||||
)
|
||||
gate_summary = prev.get("summary") or "-"
|
||||
|
||||
@@ -6411,7 +6411,7 @@ def api_account_snapshot():
|
||||
def api_price_snapshot():
|
||||
conn = get_db()
|
||||
key_rows = conn.execute(
|
||||
"SELECT id,symbol,monitor_type,direction,upper,lower,fib_entry_price,fib_limit_order_id FROM key_monitors"
|
||||
"SELECT id,symbol,monitor_type,direction,upper,lower,fib_entry_price,fib_limit_order_id,created_at FROM key_monitors"
|
||||
).fetchall()
|
||||
order_rows = conn.execute(
|
||||
"SELECT id,symbol,exchange_symbol,direction,trigger_price,stop_loss,initial_stop_loss,take_profit,margin_capital,leverage FROM order_monitors WHERE status='active'"
|
||||
@@ -6478,7 +6478,7 @@ def api_price_snapshot():
|
||||
prev = false_breakout_gate_preview(
|
||||
entry_display=entry_txt,
|
||||
limit_order_id=_sqlite_row_val(r, "fib_limit_order_id"),
|
||||
created_at=r["created_at"],
|
||||
created_at=_sqlite_row_val(r, "created_at"),
|
||||
now=app_now(),
|
||||
)
|
||||
gate_summary = prev.get("summary") or "-"
|
||||
|
||||
@@ -6411,7 +6411,7 @@ def api_account_snapshot():
|
||||
def api_price_snapshot():
|
||||
conn = get_db()
|
||||
key_rows = conn.execute(
|
||||
"SELECT id,symbol,monitor_type,direction,upper,lower,fib_entry_price,fib_limit_order_id FROM key_monitors"
|
||||
"SELECT id,symbol,monitor_type,direction,upper,lower,fib_entry_price,fib_limit_order_id,created_at FROM key_monitors"
|
||||
).fetchall()
|
||||
order_rows = conn.execute(
|
||||
"SELECT id,symbol,exchange_symbol,direction,trigger_price,stop_loss,initial_stop_loss,take_profit,margin_capital,leverage FROM order_monitors WHERE status='active'"
|
||||
@@ -6478,7 +6478,7 @@ def api_price_snapshot():
|
||||
prev = false_breakout_gate_preview(
|
||||
entry_display=entry_txt,
|
||||
limit_order_id=_sqlite_row_val(r, "fib_limit_order_id"),
|
||||
created_at=r["created_at"],
|
||||
created_at=_sqlite_row_val(r, "created_at"),
|
||||
now=app_now(),
|
||||
)
|
||||
gate_summary = prev.get("summary") or "-"
|
||||
|
||||
@@ -5998,7 +5998,7 @@ def api_settings_open_guard():
|
||||
def api_price_snapshot():
|
||||
conn = get_db()
|
||||
key_rows = conn.execute(
|
||||
"SELECT id,symbol,monitor_type,direction,upper,lower,fib_entry_price,fib_limit_order_id FROM key_monitors"
|
||||
"SELECT id,symbol,monitor_type,direction,upper,lower,fib_entry_price,fib_limit_order_id,created_at FROM key_monitors"
|
||||
).fetchall()
|
||||
order_rows = conn.execute(
|
||||
"SELECT id,symbol,exchange_symbol,direction,trigger_price,stop_loss,initial_stop_loss,take_profit,margin_capital,leverage FROM order_monitors WHERE status='active'"
|
||||
@@ -6065,7 +6065,7 @@ def api_price_snapshot():
|
||||
prev = false_breakout_gate_preview(
|
||||
entry_display=entry_txt,
|
||||
limit_order_id=_sqlite_row_val(r, "fib_limit_order_id"),
|
||||
created_at=r["created_at"],
|
||||
created_at=_sqlite_row_val(r, "created_at"),
|
||||
now=app_now(),
|
||||
)
|
||||
gate_summary = prev.get("summary") or "-"
|
||||
|
||||
Reference in New Issue
Block a user