mirror of
https://github.com/wassname/catalyst.git
synced 2026-06-28 11:19:32 +08:00
c1280daaa3
MAINT: Remove environment as an argument to benchmark source. To allow the BenchmarkSource class to be more easily used in contexts other than a TradingAlgorithm, remove the TradingEnvironment as an argument to the benchmark source. Instead: - Pass a benchmark Asset, instead of a bencmark sid; so that the asset_finder does not need to be passed to the benchmark source. - Pass the pre-calculated benchmark_returns instead of an env, which contains the benchmark_returns; a consumer can let the benchmark_returns stay as the default of `None` when using an asset. We may want to further refactor and make two different classes, instead of relying on a combination of existence/non-existence of benchmark_asset and benchmark_returns. That refactoring should be easier to do with this change.