Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the crash when running live trade mode #456

Closed
wants to merge 1 commit into from
Closed

Fix the crash when running live trade mode #456

wants to merge 1 commit into from

Conversation

minfawang
Copy link
Collaborator

@minfawang minfawang commented May 23, 2024

In live trade mode, we have the following call stack:

strategy_executor.py : on_strategy_end() -> self.strategy._dump_stats()
_strategy.py : _dump_stats() -> self._backtesting_start is not None and self._backtesting_end is not None

It triggers the crash that says the object does not have _backtesting_start attribute. Because at l195 - l198, these attributes are only initialized when the strategy is running in backtest.

This PR fixes the crash by checking if the strategy is running in backtesting mode first.

@minfawang minfawang requested a review from grzesir as a code owner May 23, 2024 04:33
Copy link
Contributor

korbit-ai bot commented May 23, 2024

My review is in progress 📖 - I will have feedback for you in a few minutes!

Copy link
Contributor

@korbit-ai korbit-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have reviewed your code and did not find any issues!


Please note that I can make mistakes, and you should still encourage your team to review your code as well.

@jimwhite
Copy link
Collaborator

I already fixed this in #453

@grzesir grzesir closed this May 23, 2024
@grzesir
Copy link
Contributor

grzesir commented May 23, 2024

Closed because this was already fixed in another PR. Please pull the latest version of dev

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants