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

View File

@@ -63,9 +63,15 @@ export function ChartWithOrders({
return 0
}
// 如果已经是数字Unix 时间戳),直接返回
// 如果已经是数字Unix 时间戳)
if (typeof time === 'number') {
console.log('[ChartWithOrders] ✅ Unix timestamp:', time, '(', new Date(time * 1000).toISOString(), ')')
// 判断是毫秒还是秒:如果大于 10^12 则认为是毫秒2001年之后的毫秒时间戳
if (time > 1000000000000) {
const seconds = Math.floor(time / 1000)
console.log('[ChartWithOrders] ✅ Unix timestamp (ms→s):', time, '→', seconds, '(', new Date(time).toISOString(), ')')
return seconds
}
console.log('[ChartWithOrders] ✅ Unix timestamp (s):', time, '(', new Date(time * 1000).toISOString(), ')')
return time
}