Skip to content

Commit

Permalink
restore
Browse files Browse the repository at this point in the history
  • Loading branch information
Leo4815162342 committed Feb 27, 2024
1 parent e5d0dce commit 537a797
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
9 changes: 1 addition & 8 deletions src/cli/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,12 @@ import { processData } from '../processor';
import { formatBytes } from '../utils/formatBytes';
import chalk from 'chalk';
import debug from 'debug';
// import dayjs from 'dayjs';
// import utc from 'dayjs/plugin/utc';

import { version } from '../../package.json';
import { BatchStreamWriter } from '../stream-writer';
import { BufferObject } from '../buffer-fetcher/types';
import { formatTimeDuration } from '../utils/formatTimeDuration';

// dayjs.extend(utc);

const DEBUG_NAMESPACE = 'dukascopy-node:cli';

export async function run(argv: NodeJS.Process['argv']) {
Expand Down Expand Up @@ -192,10 +188,7 @@ export async function run(argv: NodeJS.Process['argv']) {
ignoreFlats
});

await batchStreamWriter.writeBatch(
processedBatch
// dateFormat ? timeStamp => dayjs(timeStamp).utc().format(dateFormat) : undefined
);
await batchStreamWriter.writeBatch(processedBatch);
}

if (isLastBatch) {
Expand Down
4 changes: 2 additions & 2 deletions src/stream-writer/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ export class BatchStreamWriter {
private initHeaders() {
const bodyHeaders =
this.timeframe === Timeframe.tick
? ['timestamp', 'askPrice', 'bidPrice', 'askVolume', 'bidVolume'] // TODO: add custom header names as cli options
? ['timestamp', 'askPrice', 'bidPrice', 'askVolume', 'bidVolume']
: ['timestamp', 'open', 'high', 'low', 'close', 'volume'];

if (!this.volumes) {
Expand All @@ -115,7 +115,7 @@ export class BatchStreamWriter {
}

public async writeBatch(batch: number[][]) {
const batchWithinRange: (number | string)[][] = [];
const batchWithinRange: number[][] = [];

for (let j = 0; j < batch.length; j++) {
const item = batch[j];
Expand Down

0 comments on commit 537a797

Please sign in to comment.