This commit is contained in:
KienVT9 2025-07-11 17:28:40 +07:00
parent e45c62215e
commit d8f8b04943
15 changed files with 458 additions and 162 deletions

20
test.ts
View file

@ -4,23 +4,21 @@ import * as indicatorService from "./src/services/indicatorService";
import {
analyzeCandleSequence,
isHighVolatilityCandle,
isPinBar,
} from "./src/helpers/candles";
import { analyzeCandlesJob } from "./src/schedule/candleAnalysisSchedule";
const bybitService = new BybitService(
process.env.BYBIT_API_KEY!,
process.env.BYBIT_API_SECRET!,
false
);
function toTimestamp(strTime: string): number {
return new Date(strTime).getTime();
}
(async () => {
const candles = await bybitService.getCandles({
symbol: "BTCUSDT",
interval: "240",
category: "linear",
limit: 500,
});
console.log(candles[0], candles[1]);
const cA = analyzeCandleSequence([candles[2], candles[1], candles[0]]);
const isH = isHighVolatilityCandle(candles.reverse());
console.log(cA);
console.log("isHighVolatilityCandle", isH);
// await analyzeCandlesJob("ETHUSDT", "15", toTimestamp("2025-07-08 23:59:59"));
await analyzeCandlesJob("ETHUSDT", "15");
})();