FortuneCat / truetrade

Automatically exported from code.google.com/p/truetrade
1 stars 0 forks source link

onOrderFilled is not executed when running optimization. #54

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
onOrderFilled is executed only when it is executed first optimization.

This is probably caused by BackTestFactory:70. orderManager.reset() removes 
there execution listener from strategyExecutionListeners which was initially 
added in StrategyEngine:76

Steps to reproduce
1. Create strategy with onOrderFilled method
2. Run optimization (brute force method) => onOrderFilled is executed only when 
running first iteration of optimization.

There is no easy work around.

Original issue reported on code.google.com by kkazmier...@gmail.com on 23 Jan 2012 at 10:54

GoogleCodeExporter commented 9 years ago
It was an issue with concurrency between orderManager.reset and new 
BacktestStrategyEngine in BacktestFactory#runBacktest method.

The fix was only to switch two lines. Fixed in r161

Anyway com.ats.client.views.OptimizationView.runBruteForce(IProgressMonitor) 
method should be refactored to execute BacktestFactory#runBacktest iteratively 
instead of recursively. This might also fix defect 42

Original comment by kkazmier...@gmail.com on 24 Jan 2012 at 1:09

GoogleCodeExporter commented 9 years ago

Original comment by kkazmier...@gmail.com on 24 Jan 2012 at 1:09