Skip to content

Commit 31e2294

Browse files
committed
Fix comments
1 parent a343982 commit 31e2294

File tree

1 file changed

+11
-7
lines changed
  • investing_algorithm_framework/app

1 file changed

+11
-7
lines changed

investing_algorithm_framework/app/app.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -721,8 +721,7 @@ def run_backtest(
721721
Run a backtest for an algorithm.
722722
723723
Args:
724-
backtest_date_range: The date range to run the backtest for
725-
(instance of BacktestDateRange)
724+
backtest_date_range (BacktestDateRange): The date range to run the backtest for
726725
name: The name of the backtest. This is used to identify the
727726
backtest report in the output directory.
728727
initial_amount: The initial amount to start the backtest with.
@@ -732,9 +731,13 @@ def run_backtest(
732731
that needs to be backtested.
733732
strategies (List[TradingStrategy) (Optional): List of strategy
734733
objects that need to be backtested
735-
algorithm:
736-
output_directory: str - The directory to
737-
write the backtest report to
734+
algorithm (Algorithm) (Optional): The algorithm object that
735+
needs to be backtested. If this is provided, then the
736+
strategies and tasks of the algorithm will be used for the
737+
backtest. If this is not provided, then the strategies
738+
and tasks provided in the strategies parameter will be used.
739+
output_directory: str - The directory to write the
740+
backtest report to
738741
save_strategy: bool - Whether to save the strategy
739742
as part of the backtest report. You can only save in-memory
740743
strategies when running multiple backtests. This is because
@@ -756,7 +759,6 @@ def run_backtest(
756759
Returns:
757760
Instance of BacktestReport
758761
"""
759-
760762
# Add backtest configuration to the config
761763
self.set_config_with_dict({
762764
ENVIRONMENT: Environment.BACKTEST.value,
@@ -765,7 +767,9 @@ def run_backtest(
765767
DATABASE_NAME: "backtest-database.sqlite3",
766768
DATABASE_DIRECTORY_NAME: "backtest_databases",
767769
BACKTESTING_INITIAL_AMOUNT: initial_amount,
768-
SNAPSHOT_INTERVAL: snapshot_interval.value,
770+
SNAPSHOT_INTERVAL: SnapshotInterval.from_value(
771+
snapshot_interval
772+
).value
769773
})
770774

771775
self.initialize_config()

0 commit comments

Comments
 (0)