eslint
This commit is contained in:
parent
d85cd58acd
commit
597c6efc9b
91 changed files with 2224 additions and 1400 deletions
|
|
@ -1,4 +1,3 @@
|
|||
import { create } from 'domain';
|
||||
import { DataFrame } from '@stock-bot/data-frame';
|
||||
import { EventBus } from '@stock-bot/event-bus';
|
||||
import { getLogger } from '@stock-bot/logger';
|
||||
|
|
@ -198,7 +197,7 @@ export class HybridMode extends ExecutionMode {
|
|||
private overrideIndicatorCalculations(eventMode: EventMode): void {
|
||||
// Override the event mode's indicator calculations to use pre-computed values
|
||||
// This is a simplified approach - in production you'd want a more sophisticated interface
|
||||
const originalCalculateIndicators = (eventMode as any).calculateIndicators;
|
||||
const _originalCalculateIndicators = (eventMode as any).calculateIndicators;
|
||||
|
||||
(eventMode as any).calculateIndicators = (symbol: string, index: number) => {
|
||||
const indicators: Record<string, number> = {};
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ export class LiveMode extends ExecutionMode {
|
|||
return new Date(); // Real time
|
||||
}
|
||||
|
||||
async getMarketData(symbol: string): Promise<MarketData> {
|
||||
async getMarketData(_symbol: string): Promise<MarketData> {
|
||||
// TODO: Get live market data
|
||||
throw new Error('Live market data fetching not implemented yet');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@ async function runBacktest(options: CLIBacktestConfig): Promise<void> {
|
|||
|
||||
// Subscribe to progress updates
|
||||
eventBus.subscribe('backtest.update', message => {
|
||||
const { backtestId, progress, ...data } = message.data;
|
||||
const { backtestId: _backtestId, progress, ...data } = message.data;
|
||||
console.log(`Progress: ${progress}%`, data);
|
||||
});
|
||||
|
||||
|
|
@ -172,7 +172,7 @@ async function saveResults(result: any, outputPath: string): Promise<void> {
|
|||
}
|
||||
|
||||
function convertTradesToCSV(trades: any[]): string {
|
||||
if (trades.length === 0) return 'No trades executed\n';
|
||||
if (trades.length === 0) {return 'No trades executed\n';}
|
||||
|
||||
const headers = Object.keys(trades[0]).join(',');
|
||||
const rows = trades.map(trade =>
|
||||
|
|
@ -259,7 +259,7 @@ program
|
|||
const strategies = options.strategies.split(',').map((s: string) => s.trim());
|
||||
console.log(`Comparing strategies: ${strategies.join(', ')}`);
|
||||
|
||||
const results: any[] = [];
|
||||
const _results: any[] = [];
|
||||
|
||||
for (const strategy of strategies) {
|
||||
console.log(`\nRunning ${strategy}...`);
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
*/
|
||||
import { getLogger } from '@stock-bot/logger';
|
||||
|
||||
const logger = getLogger('execution-mode');
|
||||
const _logger = getLogger('execution-mode');
|
||||
|
||||
export interface Order {
|
||||
id: string;
|
||||
|
|
@ -55,7 +55,7 @@ export enum BacktestMode {
|
|||
}
|
||||
|
||||
export class ModeFactory {
|
||||
static create(mode: BacktestMode, config?: any): ExecutionMode {
|
||||
static create(mode: BacktestMode, _config?: any): ExecutionMode {
|
||||
switch (mode) {
|
||||
case BacktestMode.LIVE:
|
||||
// TODO: Import and create LiveMode
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue