Open Kerberos007 opened 3 years ago
printed below debug info: c_series index and p_series index were out of sync: len(c_series) = 646 len(p_series) = 2446
===================
c_series = 2010-02-03 0.000000
2010-02-04 0.000000
2010-03-15 0.000000
2010-03-23 12154.805956
2010-03-25 0.000000
...
2019-12-11 0.000000
2019-12-12 0.000000
2019-12-17 0.000000
2019-12-19 0.000000
2019-12-31 49087.152584
Length: 646, dtype: float64
p_series = 2010-02-03 9995.002499
2010-02-04 9697.378387
2010-02-05 9860.704993
2010-02-08 9640.714054
2010-02-09 9625.159139
...
2019-12-24 49012.704994
2019-12-26 49390.718144
2019-12-27 49147.709690
2019-12-30 48934.702281
2019-12-31 0.000000
Length: 2446, dtype: float64
Hi @Kerberos007, please try running the corresponding code in this file: https://github.com/chrisconlan/algorithmic-trading-with-python/blob/master/src/simulate_portfolio.py
It is the similar to listing 4.7 but does not throw the error you described.
Thanks.
I got the same error.
ValueError: Lengths must match.
c_series index and p_series index were out of sync:
len(c_series) = 646 len(p_series) = 2446
I am trying to adapt the same code to my FOREX trades and I am getting all sorts of errors too. "AttributeError: 'NoneType' object has no attribute 'strftime'"
I have change the datetypes and all but still no show. either I get 'str' object has no attribute 'strftime' or I get the above.
I bought the book.
trying to reproduce all the simulator results.
everything looked good with position class & portfolio class, until I encountered the below assertion error, when running the simple_simulator_usage.py.
using all of the csv files you provided. can't continue with this error. I have not even tried my own portfolio simulation yet. Is this a known issue? thanks in advance,