This commit is contained in:
KienVT9 2025-07-16 22:19:44 +07:00
parent 95e8e427df
commit 8588eb9720
3 changed files with 6 additions and 16 deletions

View file

@ -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);
});

View file

@ -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}

18
test.ts
View file

@ -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);
})();