backtest work

This commit is contained in:
Boki 2025-07-03 11:04:33 -04:00
parent 143e2e1678
commit 55b4ca78c9
6 changed files with 427 additions and 129 deletions

View file

@ -121,6 +121,8 @@ export abstract class BaseStrategy extends EventEmitter {
? currentPos + fill.quantity
: currentPos - fill.quantity;
logger.info(`[BaseStrategy] Position update for ${update.symbol}: ${currentPos} -> ${newPos} (${update.side} ${fill.quantity})`);
if (Math.abs(newPos) < 0.0001) {
this.positions.delete(update.symbol);
} else {