Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

PnF Reversal Bug

未关闭
#671 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
35/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
matplotlib, python

调研方向

使用从1到9的反转值重现 PnF 图表并比较结果。检查 utils.py 中的 _pnf_calculator,尤其是第1373行和第1395行,并追踪第1304行附近的 reverse 参数。完成的标准是更改反转阈值后会产生相应不同的 PnF 图表。

由索引模型根据 Issue 内容生成。

描述

bug

Hi,

Firstly thanks for this awesome resource. This is my first time contributing to GitHub (I have much to learn re. push / pull / commit etc. thats for another day) so please be kind.

BUG:
I've been plotting pnf charts and experimenting with different reversal thresholds.
Regardless of variable submitted (tried 1-9) I always produce the same graph. Have tried with differenet slices of my dataframe, different box sizes etc. and the same behavior occurs.

Expected behavior:
Lower reversal thresholds should result in a noisier PnF chart. i.e more columns with less x's o's in the smallest.

Suspected Fix (I'm a noob so maybe way off):
Suspect the issue lies in -utils.py, _pnf_calculator, rows 1373 & 1395 which appear to reset the reverse threshold basd on: current_level +- 3* boxsize, where I think it should be "current_level +-'reverse' *boxsize", where reverse is passed into the function (row 1304 (default 3).

I think you may need to adjust with addition of "current reversal threshold" which calcs each time round the loop, based on retained reverse value (default 3) passed to the function as kwarg, if that makes sense?

Screenshot:
image

Trust this is of value to the community.
(In time I'll learn to contribute directly. One step at a time on my learning journey though...)
Best
W-Smurf

主要语言
Python
星标
4.4k
派生
678
PR 合并指标
30 天内没有已合并 PR

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

matplotlib/mplfinance 的其他 Issue

查看 matplotlib/mplfinance 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。