Repository navigation
feat(script)!: add maxsum indicators and unify drawing style - #335
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
一、主要功能更新
大功能
ta.maxsum:窗口内最大子段和(Kadane),返回[子段和, 起点偏移, 终点偏移],负偏移与ta.highestbars一致;每 bar O(length),按 bar 缓存。MPR最优单次交易、MDD最大回撤、BIS最强连续区间、MFS最大净流入段;区间框与文字统一画在框下方,文字使用主题前景色。DrawingText不再自带color/size,文字颜色与字号只存DrawingStyle.textColor/fontSize,主题别名在投影阶段统一解析。line.new/box.new/label.new新增LineOptions/BoxOptions/LabelOptions,Pine 顺序的位置参数保留,两者汇入同一构造。@foreground主题别名:浅色主题深色字、深色主题浅色字;19 个别名均走 DTCG 管线并通过对比度审计。设计决策见
docs/design/drawing-text-color.md。二、修复的问题与 UI 优化
修复
drawing.text.color落在主题解析边界之外,别名被原样交给 canvas 后静默沿用上一次填充色。zones的 FVG / OB 标签在深色主题下是黑字、浅色主题下是半透明文字。UI 优化
label.new({ x, y, text, color, offsetY })。重构
box.new/label.new未指定文字颜色时跟随描边,不再默认绝对黑。frameProjection中为文字颜色临时加的解析分支,颜色解析回到resolveDrawingStyle一处。破坏性改动
DrawingText移除color、size;若有持久化文档带这两个字段,需在读取处迁移到style.textColor/style.fontSize。验证
pnpm type-check通过;core 2564、script 513、vue 217 测试通过;pnpm tokens:check、docs:script:check通过。