[Mod] reduce duplicate code line

This commit is contained in:
vn.py 2019-06-30 17:17:46 +08:00 committed by GitHub
parent 85c72c51bd
commit 20a7648622
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -229,20 +229,22 @@ class BacktestingEngine:
progress = 0
while start < self.end:
end = min(end, self.end) # Make sure end time stays within set range
if self.mode == BacktestingMode.BAR:
data = load_bar_data(
self.symbol,
self.exchange,
self.interval,
start,
min(end, self.end)
end
)
else:
data = load_tick_data(
self.symbol,
self.exchange,
start,
min(end, self.end)
end
)
self.history_data.extend(data)