fix: chart order markers not displaying due to timestamp format mismatch

- Fix milliseconds to seconds conversion in parseCustomTime (AdvancedChart & ChartWithOrders)
- Add GetTraderOrdersFiltered to filter orders at database level by symbol/status
- Increase order limit from 50 to 200 for more historical orders
- Group multiple orders at same candle time and show count (B3, S5, etc.)
- Buy markers shown below bar (green), sell markers above bar (red)
This commit is contained in:
tinkle-community
2026-01-06 21:08:42 +08:00
parent c0c89d7534
commit 5e65ae7077
4 changed files with 86 additions and 41 deletions
+3 -17
View File
@@ -2294,28 +2294,14 @@ func (s *Server) handleOrders(c *gin.Context) {
return
}
// Get all orders for this trader
allOrders, err := store.Order().GetTraderOrders(trader.GetID(), limit)
// Get orders with filters applied at database level
orders, err := store.Order().GetTraderOrdersFiltered(trader.GetID(), symbol, statusFilter, limit)
if err != nil {
SafeInternalError(c, "Get orders", err)
return
}
// Filter by symbol and status if specified
result := make([]interface{}, 0)
for _, order := range allOrders {
// Filter by symbol
if symbol != "" && order.Symbol != symbol {
continue
}
// Filter by status
if statusFilter != "" && order.Status != statusFilter {
continue
}
result = append(result, order)
}
c.JSON(http.StatusOK, result)
c.JSON(http.StatusOK, orders)
}
// handleOrderFills Order fill details (all fills for a specific order)