From 8588eb9720e5951bd2f7ee730291d4a294b9fe16 Mon Sep 17 00:00:00 2001 From: KienVT9 Date: Wed, 16 Jul 2025 22:19:44 +0700 Subject: [PATCH] update --- src/schedule/candleAnalysisSchedule.ts | 2 +- src/schedule/index.ts | 2 +- test.ts | 18 ++++-------------- 3 files changed, 6 insertions(+), 16 deletions(-) diff --git a/src/schedule/candleAnalysisSchedule.ts b/src/schedule/candleAnalysisSchedule.ts index 061d59c..0a74c10 100644 --- a/src/schedule/candleAnalysisSchedule.ts +++ b/src/schedule/candleAnalysisSchedule.ts @@ -58,7 +58,7 @@ export function createCandleAnalysisSchedule(symbol: string, interval: KlineInte rule.hour = [6]; break; } - rule.second = 59; + rule.second = 57; schedule.scheduleJob(rule, () => { analyzeCandlesJob(symbol, interval, eventHandler); }); diff --git a/src/schedule/index.ts b/src/schedule/index.ts index 3b6602b..197d18c 100644 --- a/src/schedule/index.ts +++ b/src/schedule/index.ts @@ -17,7 +17,7 @@ const bybitService = new BybitService( -const eventHandlerFuture: EventHandler = { +export const eventHandlerFuture: EventHandler = { onBuy: (order: Order, reason: string) => { sendMessage(`Future Buy ${order.symbol} ${order.interval}M symbol: ${order.symbol} diff --git a/test.ts b/test.ts index 431e1a4..d039474 100644 --- a/test.ts +++ b/test.ts @@ -8,6 +8,7 @@ import { } from "./src/helpers/candles"; import { analyzeCandlesJob } from "./src/schedule/candleAnalysisSchedule"; import { log } from "console"; +import { eventHandlerFuture } from "./src/schedule"; const bybitService = new BybitService( 'dqGCPAJzLKoTRfgCMq', @@ -21,19 +22,8 @@ function toTimestamp(strTime: string): number { (async () => { // await analyzeCandlesJob("ETHUSDT", "15", toTimestamp("2025-07-08 23:59:59")); - // await analyzeCandlesJob("ETHUSDT", "15"); - // const res = await bybitService.createOrder({ - // category: "linear", - // symbol: "ETHUSDT", - // side: "Buy", - // orderType: "Limit", - // price: "3146.81", - // qty: "1", - // takeProfit: "3200", - // stopLoss: "3000", - // }); - // console.log(res); + await analyzeCandlesJob("BTCUSDT", "15", undefined, toTimestamp("2025-07-16 22:14:59")); - const balance = await bybitService.getBalance(); - console.log(balance.result.list[0].totalEquity); + // const balance = await bybitService.getBalance(); + // console.log(balance.result.list[0].totalEquity); })();