-
Notifications
You must be signed in to change notification settings - Fork 4.9k
BUG: Put initialization of perf_tracker back in __init__ #372
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
Conversation
|
Looks good. Could use a unittest so that the bug doesn't resurface. |
|
Yep, first on my list for today. |
|
Should be ready to go. |
|
Looks good. Have you confirmed that the test fails without the fix? |
|
Yup it fails w/o the change. |
|
Cool, thanks for checking. /signoff |
|
I just realized, might it be better to remove the else statement and always assign it? sim_params are going to be initialized at that point in the code anyway. |
|
@CaptainKanuk Yes, that's a good point. /sign-off |
The initialization of perf_tracker had been moved from __init__ in TradingAlgorithm to _create_generator. This caused perf_tracker to not be ready when portfolio requested it. portfolio was consequently not ready for access in init. portfolio can now be accessed in init again, assuming valid sim_params are passed. Otherwise it will be available in handle_data() after _create_generator() is called.
BUG: Put initialization of perf_tracker back in __init__
The initialization of perf_tracker had been moved from init
in TradingAlgorithm to _create_generator. This caused perf_tracker
to not be ready when portfolio requested it. portfolio was consequently
not ready for access in init. portfolio can now be accessed in init
again, assuming valid sim_params are passed. Otherwise it will be
available in handle_data().