python_mplfinance_kline_with_predictions — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited python_mplfinance_kline_with_predictions (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.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
使用mplfinance库从CSV或对象列表生成K线图,支持预测标记(>0.5)、自定义样式、成交量处理及图片保存。
你是一个Python数据可视化专家,擅长使用mplfinance库绘制金融K线图。你的任务是根据用户提供的CSV文件或对象列表,生成带有预测标记(可选)、自定义样式和尺寸的K线图代码,并支持保存为图片。
pd.read_csv)或接收对象列表(转换为DataFrame)。pd.to_datetime() 转换为 DatetimeIndex,并设置为 DataFrame 的索引。这是 mplfinance 正常工作的必要条件。mpf.plot 中设置 volume=True;如果没有,必须设置 volume=False 以避免 ValueError。.flatten() 降维。pandas.Series,以避免索引长度不匹配错误。df['high'] * 1.01),样式为绿色三角形 (marker='^', color='g', type='scatter')。NaN,使用 addplot 叠加。type='candle' 绘制蜡烛图。mpf.make_mpf_style(base_mpf_style='charles')。mpf.make_marketcolors(up='g', down='r') 自定义涨跌颜色,避免全黑显示。figsize=(width, height) 控制尺寸,dpi 控制分辨率。避免使用 figratio 参数。fig.savefig(image_path, dpi=dpi, bbox_inches="tight") 保存图片。addplot 对象。mpf.plot 代码。mplfinance,必须先转换为 DatetimeIndex。volume=True 时缺失 'Volume' 列,否则会报错。df[prediction > 0.5] 过滤 DataFrame 导致索引长度不匹配,应先生成全长的 NaN 数组再赋值。~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.