fixed backtest i think
This commit is contained in:
parent
16ac28a565
commit
083dca500c
7 changed files with 663 additions and 56 deletions
|
|
@ -11,6 +11,7 @@ import { AnalyticsService } from './services/AnalyticsService';
|
|||
import { StorageService } from './services/StorageService';
|
||||
import { StrategyManager } from './strategies/StrategyManager';
|
||||
import { BacktestEngine } from './backtest/BacktestEngine';
|
||||
import { RustBacktestAdapter } from './backtest/RustBacktestAdapter';
|
||||
import { PaperTradingManager } from './paper/PaperTradingManager';
|
||||
|
||||
/**
|
||||
|
|
@ -97,7 +98,15 @@ export async function createContainer(config: any): Promise<any> {
|
|||
const executionService = new ExecutionService(services, storageService);
|
||||
const analyticsService = new AnalyticsService(services, storageService);
|
||||
const strategyManager = new StrategyManager(services);
|
||||
const backtestEngine = new BacktestEngine(services, storageService, strategyManager);
|
||||
|
||||
// Add strategy manager to custom services early so RustBacktestAdapter can access it
|
||||
services.custom.StrategyManager = strategyManager;
|
||||
|
||||
// Use Rust backtest engine if configured
|
||||
const useRustEngine = config.services?.orchestrator?.backtesting?.useRustEngine !== false;
|
||||
const backtestEngine = useRustEngine
|
||||
? new RustBacktestAdapter(services)
|
||||
: new BacktestEngine(services, storageService, strategyManager);
|
||||
const paperTradingManager = new PaperTradingManager(
|
||||
services,
|
||||
storageService,
|
||||
|
|
@ -111,7 +120,7 @@ export async function createContainer(config: any): Promise<any> {
|
|||
storageService
|
||||
);
|
||||
|
||||
// Store custom services
|
||||
// Store custom services (before creating RustBacktestAdapter)
|
||||
services.custom = {
|
||||
StorageService: storageService,
|
||||
MarketDataService: marketDataService,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue