optstrategy trouble with Unix timestamps
My dataset's datetime-stamp is formatted in Unix float notation. I've divided the datetime-stamp by 1000 so it can be passed with GenericCSVData no problem in a normal
addstrategybacktest with the parameter
dtformat=2. However, when trying to optimize with
optstrategy, I get an error:
AttributeError: Can't pickle local object 'GenericCSVData.start.<locals>.<lambda>'
I assume the
dtformat=2parameter I've set is the lambda function so I've just manually converted the Unix datetime-stamps into the %Y-%m-%d %H:%M:%S format and removed the
dtformat=2parameter. However, I then get another error that my format is still incorrect:
ValueError: time data '20/09/01 02:00:00' does not match format '%Y-%m-%d %H:%M:%S'
Is there something I'm missing here?
your date-time format is more
%y/%m/%d %H:%M:%Srather than
%Y-%m-%d %H:%M:%S. or
%d/%m/%y %H:%M:%Ssince it is not clear where the year is shown.
@ab_trader I took another stab and tried making the year more clear and get the same error.
Is there a difference between %y and %Y?
@ab_trader You were right. It was the
-that was throwing it off . Thank you.