ai-trading-sys/test.ts
2025-07-16 15:37:26 +07:00

39 lines
1.1 KiB
TypeScript

import "dotenv/config";
import { BybitService } from "./src/services/bybitService";
import * as indicatorService from "./src/services/indicatorService";
import {
analyzeCandleSequence,
isHighVolatilityCandle,
isPinBar,
} from "./src/helpers/candles";
import { analyzeCandlesJob } from "./src/schedule/candleAnalysisSchedule";
import { log } from "console";
const bybitService = new BybitService(
'dqGCPAJzLKoTRfgCMq',
'aDYziLWN2jvdWNuz4QhWrM1O65JZ5f1NtEUO',
false
);
function toTimestamp(strTime: string): number {
return new Date(strTime).getTime();
}
(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);
const balance = await bybitService.getBalance();
console.log(balance.result.list[0].totalEquity);
})();