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

Listing 4.7 #5

Closed
jobquiroz opened this issue Oct 28, 2020 · 2 comments
Closed

Listing 4.7 #5

jobquiroz opened this issue Oct 28, 2020 · 2 comments

Comments

@jobquiroz
Copy link

Hello,
I'm trying to run the simulator example usage in listing 4.7 but I get a "Value error: Lenghts must match"

When I print the lengths of the variables c_series and p_series in _compute_equity_series (within the PortfolioHistory class) I indeed find out that they are different (1280 vs 2495).

I think I have all set up correctly, my example usage of PortfolioHistory runs correctly.

Do you have any advice?

Thank you.
The book is great.

@chrisconlan
Copy link
Owner

Hi Job, please try running the simulate_portfolio.py script directly from the GitHub repo. It is the same as Listing 4.7, and I just verified it works on a clean copy of the repo.

https://github.com/chrisconlan/algorithmic-trading-with-python/blob/master/src/simulate_portfolio.py

@jobquiroz
Copy link
Author

Thank you, that actually worked pretty well!

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

No branches or pull requests

2 participants