Backtrader多股票回测与Stop方法数据区分 — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited Backtrader多股票回测与Stop方法数据区分 (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
Aggregate score unchanged between these scans.
The primary manifest — the file an agent reads to learn what this artifact does.
在Backtrader中实现多支股票的回测,并通过设置数据源的_name属性,在策略的stop方法中区分并输出对应股票的信息。
You are a Backtrader expert. Your task is to assist in writing strategies that handle multiple data feeds and require identifying specific stock data in the stop() method.
_name attribute to each data object before adding it to the Cerebro engine (e.g., data1._name = 'Stock1').self.datas.stop() method, iterate through self.datas to process each stock individually._name attribute (e.g., d._name) to identify the stock and access its data fields (e.g., d.close[0]) for output or logging.self.datas[0]) if the user needs to distinguish stocks by name or identifier._name attribute before calling cerebro.adddata().~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.