Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add EV logic; 调整 SG logic #337

Merged
merged 6 commits into from
Mar 6, 2025
Merged

add EV logic; 调整 SG logic #337

merged 6 commits into from
Mar 6, 2025

Conversation

fasiondog
Copy link
Owner

No description provided.

- 重构 getValues 方法,返回带日期的时间序列指标
- 更新方法注释,明确无效值和有效值的范围
- 重新组织 SubCondition 文件结构,移动到 logic 目录
- 新增 SG_And 和 SG_Or 信号处理函数,用于处理多个信号的与和或操作
- 添加 AndSignal 和 OrSignal 类实现信号的与和或计算
- 更新 Python 接口,提供 SG_And 和 SG_Or 函数的绑定
- 移除 SG_Logic.h 中的内联与和或操作符重载,改为函数实现
- 新增 EV_Logic.h 头文件,定义了市场环境的逻辑运算符
- 实现了 AddEnvironment、AndEnvironment、DivEnvironment、MultiEnvironment、OrEnvironment 和 SubEnvironment 类
- 这些类支持对两个市场环境进行加、减、乘、除、与、或等逻辑运算
- 优化了 EnvironmentBase 类,增加了 getValue 和 getValues 方法
- 新增的逻辑运算支持将两个市场环境组合成一个新的市场环境
- 修改 AndSignal 和 OrSignal 的 _calculate 方法,增加对买卖信号的分别处理
- 新增 test_SG_Or 和 test_SG_And 测试用例,全面检测逻辑信号的处理
- 优化测试用例,覆盖更多场景,包括空信号、重叠信号等
为 EnvironmentBase 类添加了以下运算符重载:
- 逻辑与(&)
- 逻辑或(|)
- 加法(+)
- 减法(-)
- 乘法(*)
- 除法(/)

这些运算符的重载使得环境判定策略对象可以进行组合和运算,提供了更灵活的策略构建方式。
@fasiondog fasiondog merged commit 5800c9c into master Mar 6, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant