15:00收盘
This commit is contained in:
parent
8d1162a2af
commit
1a5ea5b967
@ -60,7 +60,7 @@ const wsStatusClass = computed(() => {
|
||||
|
||||
const wsStatusTitle = computed(() => {
|
||||
if (!props.wsInSession) {
|
||||
return '非交易时段(09:00–11:30 / 13:30–15:30 / 21:00–23:00)'
|
||||
return '非交易时段(09:00–11:30 / 13:30–15:00 / 21:00–23:00)'
|
||||
}
|
||||
return `WebSocket ${wsStatusLabel.value}`
|
||||
})
|
||||
|
||||
@ -40,7 +40,7 @@
|
||||
</template>
|
||||
</div>
|
||||
<p class="schedule-hint">
|
||||
开启后仅在开盘时段(09:00–11:30 / 13:30–15:30 / 21:00–23:00)按间隔自动分析;出现买入/卖出信号时浏览器标题会闪烁提醒
|
||||
开启后仅在开盘时段(09:00–11:30 / 13:30–15:00 / 21:00–23:00)按间隔自动分析;出现买入/卖出信号时浏览器标题会闪烁提醒
|
||||
</p>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
@ -59,15 +59,15 @@ function minutesOfDay(d: Date): number {
|
||||
/**
|
||||
* WebSocket 应保持连接的交易时段(本地时区):
|
||||
* - 上午 09:00–11:30
|
||||
* - 下午 13:30–15:30
|
||||
* - 下午 13:30–15:00
|
||||
* - 夜盘 21:00–23:00
|
||||
* 边界含起止分钟(如 11:30:xx 仍在时段内,11:31 起视为结束)。
|
||||
* 边界含起止分钟(如 15:00:xx 仍在时段内,15:01 起视为结束)。
|
||||
*/
|
||||
export function isWsTradingSession(now: Date = new Date()): boolean {
|
||||
const m = minutesOfDay(now)
|
||||
return (
|
||||
(m >= 9 * 60 && m <= 11 * 60 + 30) ||
|
||||
(m >= 13 * 60 + 30 && m <= 15 * 60 + 30) ||
|
||||
(m >= 13 * 60 + 30 && m <= 15 * 60) ||
|
||||
(m >= 21 * 60 && m <= 23 * 60)
|
||||
)
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user