Skip to content

cerebro.resampledata() failure #15

@quachbq

Description

@quachbq

The following call to backtrader.Cerebro.resampledata() failed, which works with the original Backtrader:

data_hour = cerebro.resampledata(
    dataname=data,
    name='hour',
    timeframe=bt.TimeFrame.Minutes,
    compression=60,  # 60 minutes = 1 hour
    bar2edge=True
)

ERROR:

File "/Users/test/strategy/live/sig_gen.py", line 96, in sig_gen
data_hour = cerebro.resampledata(
dataname=data,
...<3 lines>...
bar2edge=True
)
File "/Users/test/bt-env-p3.14.5/lib/python3.14/site-packages/backtrader/cerebro.py", line 1124, in resampledata
dataname = dataname.clone()
File "/Users/test/bt-env-p3.14.5/lib/python3.14/site-packages/backtrader/feed.py", line 507, in clone
return DataClone(dataname=self, **kwargs)
File "/Users/test/bt-env-p3.14.5/lib/python3.14/site-packages/backtrader/metabase.py", line 1307, in patched_init
return original_init(self, *args, **other_kwargs)
File "/Users/test/bt-env-p3.14.5/lib/python3.14/site-packages/backtrader/feed.py", line 1293, in init
raise ValueError("DataClone requires 'dataname' parameter")
ValueError: DataClone requires 'dataname' parameter

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions