Skip to content

Commit 5140daf

Browse files
fix: resolve build errors and remaining linting issues
1 parent ee33d0e commit 5140daf

File tree

4 files changed

+15
-3
lines changed

4 files changed

+15
-3
lines changed

src/backtest/engine.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,14 +169,18 @@ export class TimeBasedEngine {
169169

170170
// Win rate and profit factor
171171
const completedTrades = this.trades.filter(t => t.pnl !== undefined);
172+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
172173
const winningTrades = completedTrades.filter(t => t.pnl! > 0);
174+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
173175
const losingTrades = completedTrades.filter(t => t.pnl! < 0);
174176

175177
const winRate = completedTrades.length > 0
176178
? winningTrades.length / completedTrades.length
177179
: 0;
178180

181+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
179182
const grossProfit = winningTrades.reduce((sum, t) => sum + t.pnl!, 0);
183+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
180184
const grossLoss = Math.abs(losingTrades.reduce((sum, t) => sum + t.pnl!, 0));
181185
const profitFactor = grossLoss > 0 ? grossProfit / grossLoss : 0;
182186

src/cli/cli.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ program
2020
.option('--end <date>', 'End date', '2023-12-31')
2121
.option('--strategy <strategy>', 'Strategy to use', 'trend-following')
2222
.action(async (options) => {
23+
// eslint-disable-next-line no-console
2324
console.log('Running backtest with options:', options);
25+
// eslint-disable-next-line no-console
2426
console.log('Note: Full implementation requires running example code');
2527
});
2628

@@ -30,7 +32,9 @@ program
3032
.argument('<name>', 'Project name')
3133
.option('-t, --template <template>', 'Template to use', 'basic')
3234
.action((name, options) => {
35+
// eslint-disable-next-line no-console
3336
console.log(`Initializing project: ${name} with template: ${options.template}`);
37+
// eslint-disable-next-line no-console
3438
console.log('Note: Template scaffolding not yet implemented');
3539
});
3640

src/core/logger.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,24 +23,28 @@ export class ConsoleLogger implements Logger {
2323

2424
debug(message: string, meta?: any): void {
2525
if (this.shouldLog('debug')) {
26+
// eslint-disable-next-line no-console
2627
console.debug(`[DEBUG] ${message}`, meta || '');
2728
}
2829
}
2930

3031
info(message: string, meta?: any): void {
3132
if (this.shouldLog('info')) {
33+
// eslint-disable-next-line no-console
3234
console.info(`[INFO] ${message}`, meta || '');
3335
}
3436
}
3537

3638
warn(message: string, meta?: any): void {
3739
if (this.shouldLog('warn')) {
40+
// eslint-disable-next-line no-console
3841
console.warn(`[WARN] ${message}`, meta || '');
3942
}
4043
}
4144

4245
error(message: string, meta?: any): void {
4346
if (this.shouldLog('error')) {
47+
// eslint-disable-next-line no-console
4448
console.error(`[ERROR] ${message}`, meta || '');
4549
}
4650
}

src/utils/time.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ export class TimeUtils {
99
* Check if market is open
1010
* Simplified - assumes US market hours (9:30 AM - 4:00 PM ET)
1111
*/
12-
static isMarketOpen(date: Date, exchange: string = 'NYSE'): boolean {
12+
static isMarketOpen(date: Date): boolean {
1313
// Check if weekend
1414
const day = date.getDay();
1515
if (day === 0 || day === 6) return false;
1616

17-
// Check if holiday (simplified - major US holidays)
18-
if (this.isHoliday(date, exchange)) return false;
17+
// Check if holiday
18+
if (this.isHoliday(date)) return false;
1919

2020
// Check market hours (simplified - assumes ET timezone)
2121
const hours = date.getHours();

0 commit comments

Comments
 (0)