Skip to content

Commit ecda87f

Browse files
committed
Change default value of same_bar_execution to True
Signed-off-by: Nikola Losic <nikolalosic@protonmail.ch>
1 parent c2331cf commit ecda87f

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

ziplime/core/run_simulation.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ async def run_simulation(
4848
future_commission: FutureCommissionModel | None = None,
4949
clock: TradingClock | None = None,
5050
max_leverage: float = 1.0,
51-
same_bar_execution: bool = False,
51+
same_bar_execution: bool = True,
5252
price_used_in_order_execution: Literal["open", "close", "low", "high"] = "close"
5353
) -> TradingAlgorithmExecutionResult:
5454
"""
@@ -162,7 +162,7 @@ async def run_simulation_iter(
162162
future_commission: FutureCommissionModel | None = None,
163163
clock: TradingClock | None = None,
164164
max_leverage: float = 1.0,
165-
same_bar_execution: bool = False,
165+
same_bar_execution: bool = True,
166166
price_used_in_order_execution: Literal["open", "close", "low", "high"] = "close"
167167
) -> AsyncIterator[TradingAlgorithmExecutionStatus]:
168168
"""

ziplime/trading/trading_algorithm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ def __init__(
194194
get_pipeline_loader=None,
195195
create_event_context=None,
196196
stop_on_error: bool = False,
197-
same_bar_execution: bool = False,
197+
same_bar_execution: bool = True,
198198
):
199199
self.algorithm = algorithm
200200
self.config = algorithm.config

ziplime/utils/run_algo.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ async def run_algorithm(
4949
benchmark_asset_symbol: str | None = None,
5050
benchmark_returns: pl.Series | None = None,
5151
max_leverage: float = 1.0,
52-
same_bar_execution: bool = False,
52+
same_bar_execution: bool = True,
5353
price_used_in_order_execution: Literal["open", "close", "low", "high"] = "close"
5454
) -> TradingAlgorithmExecutionResult:
5555
"""Run a backtest for the given algorithm.
@@ -84,7 +84,7 @@ async def run_algorithm_iter(
8484
benchmark_asset_symbol: str | None = None,
8585
benchmark_returns: pl.Series | None = None,
8686
max_leverage: float = 1.0,
87-
same_bar_execution: bool = False,
87+
same_bar_execution: bool = True,
8888
price_used_in_order_execution: Literal["open", "close", "low", "high"] = "close"
8989
) -> AsyncIterator[TradingAlgorithmExecutionStatus]:
9090
"""Run a backtest for the given algorithm.
@@ -118,7 +118,7 @@ async def _prepare_algorithm(
118118
benchmark_asset_symbol: str | None = None,
119119
benchmark_returns: pl.Series | None = None,
120120
max_leverage: float = 1.0,
121-
same_bar_execution: bool = False,
121+
same_bar_execution: bool = True,
122122
price_used_in_order_execution: Literal["open", "close", "low", "high"] = "close"
123123
) -> TradingAlgorithmExecutionResult:
124124
"""Run a backtest for the given algorithm.

0 commit comments

Comments
 (0)