using GenericCSVData class or any class inherited from it in strategy optimization may result in pickle error:
AttributeError: Can't pickle local object 'GenericCSVData.start.<locals>.<lambda>'
This happens in case the CSV file contains the timestemps in a datetime column. Looking at the code it appears that GenericCSVData is using lambdas for converting the timestamps to the UTC time. Unfortunately lambda functions could not be
serialized by pickle package and thus can not be used during optimization with multiple CPUs.
Community discussion:
https://community.backtrader.com/topic/2919/error-in-multi-core-optimization
Description:
using GenericCSVData class or any class inherited from it in strategy optimization may result in pickle error:
This happens in case the CSV file contains the timestemps in a datetime column. Looking at the code it appears that GenericCSVData is using lambdas for converting the timestamps to the UTC time. Unfortunately lambda functions could not be serialized by pickle package and thus can not be used during optimization with multiple CPUs.