update
This commit is contained in:
parent
dbf3b758fe
commit
e45c62215e
3 changed files with 723 additions and 35 deletions
34
test.ts
34
test.ts
|
|
@ -1,14 +1,26 @@
|
|||
import 'dotenv/config';
|
||||
import { BybitService } from './src/services/bybitService';
|
||||
import * as indicatorService from './src/services/indicatorService';
|
||||
import { sendLarkMessage } from './src/services/messageService';
|
||||
import "dotenv/config";
|
||||
import { BybitService } from "./src/services/bybitService";
|
||||
import * as indicatorService from "./src/services/indicatorService";
|
||||
import {
|
||||
analyzeCandleSequence,
|
||||
isHighVolatilityCandle,
|
||||
} from "./src/helpers/candles";
|
||||
|
||||
const bybitService = new BybitService(process.env.BYBIT_API_KEY!, process.env.BYBIT_API_SECRET!, false);
|
||||
const bybitService = new BybitService(
|
||||
process.env.BYBIT_API_KEY!,
|
||||
process.env.BYBIT_API_SECRET!,
|
||||
false
|
||||
);
|
||||
(async () => {
|
||||
const candles = await bybitService.getCandles({ symbol: 'BTCUSDT', interval: '15', category: 'linear', limit: 500 });
|
||||
const candles = await bybitService.getCandles({
|
||||
symbol: "BTCUSDT",
|
||||
interval: "240",
|
||||
category: "linear",
|
||||
limit: 500,
|
||||
});
|
||||
console.log(candles[0], candles[1]);
|
||||
const analysis = indicatorService.analyze(candles);
|
||||
console.log(analysis);
|
||||
const message = JSON.stringify(analysis);
|
||||
await sendLarkMessage('oc_f9b2e8f0309ecab0c94e3e134b0ddd29', message);
|
||||
})();
|
||||
const cA = analyzeCandleSequence([candles[2], candles[1], candles[0]]);
|
||||
const isH = isHighVolatilityCandle(candles.reverse());
|
||||
console.log(cA);
|
||||
console.log("isHighVolatilityCandle", isH);
|
||||
})();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue