Verify whether the backtest result data frame contains data before attempting to drop the cumulative profit column
This commit is contained in:
parent
ad5bbc3c10
commit
1402ab88cc
@ -50,10 +50,12 @@ def run_backtest(start_date: datetime, end_date: datetime):
|
|||||||
start_date,
|
start_date,
|
||||||
end_date
|
end_date
|
||||||
)
|
)
|
||||||
# TODO: Think of a better way to handle this.
|
|
||||||
backtest_results.drop('Cumulative Profit', axis = 1, inplace = True)
|
if not backtest_results.empty:
|
||||||
print(backtest_results)
|
# TODO: Think of a better way to handle this.
|
||||||
insert(backtest_results)
|
backtest_results.drop('Cumulative Profit', axis = 1, inplace = True)
|
||||||
|
print(backtest_results)
|
||||||
|
insert(backtest_results)
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
# TODO: Update backtest to eliminate the need for setting this to midnight.
|
# TODO: Update backtest to eliminate the need for setting this to midnight.
|
||||||
|
Loading…
Reference in New Issue
Block a user