[Mod] reduce duplicate code line
This commit is contained in:
parent
85c72c51bd
commit
20a7648622
@ -229,20 +229,22 @@ class BacktestingEngine:
|
|||||||
progress = 0
|
progress = 0
|
||||||
|
|
||||||
while start < self.end:
|
while start < self.end:
|
||||||
|
end = min(end, self.end) # Make sure end time stays within set range
|
||||||
|
|
||||||
if self.mode == BacktestingMode.BAR:
|
if self.mode == BacktestingMode.BAR:
|
||||||
data = load_bar_data(
|
data = load_bar_data(
|
||||||
self.symbol,
|
self.symbol,
|
||||||
self.exchange,
|
self.exchange,
|
||||||
self.interval,
|
self.interval,
|
||||||
start,
|
start,
|
||||||
min(end, self.end)
|
end
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
data = load_tick_data(
|
data = load_tick_data(
|
||||||
self.symbol,
|
self.symbol,
|
||||||
self.exchange,
|
self.exchange,
|
||||||
start,
|
start,
|
||||||
min(end, self.end)
|
end
|
||||||
)
|
)
|
||||||
|
|
||||||
self.history_data.extend(data)
|
self.history_data.extend(data)
|
||||||
|
Loading…
Reference in New Issue
Block a user