mirror of
https://github.com/laoxong/nofx.git
synced 2026-06-04 09:58:22 +08:00
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:
+3
-17
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user