hikyuu 2.5.1__py3-none-win_amd64.whl → 2.5.3__py3-none-win_amd64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- hikyuu/__init__.py +5 -1
- hikyuu/__init__.pyi +522 -505
- hikyuu/analysis/__init__.pyi +489 -478
- hikyuu/analysis/analysis.pyi +490 -479
- hikyuu/core.pyi +491 -480
- hikyuu/cpp/__init__.pyi +3 -0
- hikyuu/cpp/core310.pyd +0 -0
- hikyuu/cpp/core310.pyi +13154 -0
- hikyuu/cpp/core311.pyd +0 -0
- hikyuu/cpp/core311.pyi +13154 -0
- hikyuu/cpp/core312.pyd +0 -0
- hikyuu/cpp/core312.pyi +13154 -0
- hikyuu/cpp/core313.pyd +0 -0
- hikyuu/cpp/core313.pyi +13132 -0
- hikyuu/cpp/core38.pyd +0 -0
- hikyuu/cpp/core38.pyi +13154 -0
- hikyuu/cpp/core39.pyd +0 -0
- hikyuu/cpp/core39.pyi +13154 -0
- hikyuu/cpp/hikyuu.dll +0 -0
- hikyuu/cpp/hikyuu.lib +0 -0
- hikyuu/data/mysql_upgrade/0027.sql +6 -0
- hikyuu/data/pytdx_to_h5.py +7 -4
- hikyuu/data/pytdx_to_mysql.py +7 -4
- hikyuu/data/sqlite_upgrade/0027.sql +8 -0
- hikyuu/draw/drawplot/__init__.py +8 -1
- hikyuu/draw/drawplot/__init__.pyi +11 -7
- hikyuu/draw/drawplot/bokeh_draw.pyi +510 -495
- hikyuu/draw/drawplot/common.pyi +1 -1
- hikyuu/draw/drawplot/echarts_draw.pyi +512 -497
- hikyuu/draw/drawplot/matplotlib_draw.py +134 -12
- hikyuu/draw/drawplot/matplotlib_draw.pyi +571 -509
- hikyuu/draw/elder.pyi +11 -11
- hikyuu/draw/kaufman.pyi +18 -18
- hikyuu/draw/volume.pyi +10 -10
- hikyuu/extend.py +0 -24
- hikyuu/extend.pyi +500 -506
- hikyuu/hub.py +154 -9
- hikyuu/hub.pyi +51 -13
- hikyuu/include/hikyuu/DataType.h +1 -2
- hikyuu/include/hikyuu/StockManager.h +2 -1
- hikyuu/include/hikyuu/StrategyContext.h +12 -3
- hikyuu/include/hikyuu/indicator/Indicator.h +24 -0
- hikyuu/include/hikyuu/indicator/Indicator2InImp.h +1 -0
- hikyuu/include/hikyuu/indicator/build_in.h +2 -0
- hikyuu/include/hikyuu/indicator/crt/ATR.h +2 -13
- hikyuu/include/hikyuu/indicator/crt/KALMAN.h +30 -0
- hikyuu/include/hikyuu/indicator/crt/TR.h +32 -0
- hikyuu/include/hikyuu/indicator/imp/IAtr.h +3 -1
- hikyuu/include/hikyuu/indicator/imp/IKalman.h +27 -0
- hikyuu/include/hikyuu/indicator/imp/ITr.h +35 -0
- hikyuu/include/hikyuu/python/convert_any.h +299 -0
- hikyuu/include/hikyuu/trade_manage/PositionRecord.h +8 -2
- hikyuu/include/hikyuu/trade_sys/allocatefunds/crt/AF_MultiFactor.h +1 -1
- hikyuu/include/hikyuu/trade_sys/allocatefunds/imp/MultiFactorAllocaterFunds.h +3 -0
- hikyuu/include/hikyuu/trade_sys/condition/ConditionBase.h +4 -1
- hikyuu/include/hikyuu/trade_sys/condition/imp/{SubCondition.h → logic/SubCondition.h} +1 -1
- hikyuu/include/hikyuu/trade_sys/environment/EnvironmentBase.h +20 -6
- hikyuu/include/hikyuu/trade_sys/environment/build_in.h +1 -0
- hikyuu/include/hikyuu/trade_sys/environment/crt/EV_Logic.h +35 -0
- hikyuu/include/hikyuu/trade_sys/environment/imp/logic/AddEnvironment.h +42 -0
- hikyuu/include/hikyuu/trade_sys/environment/imp/logic/AndEnvironment.h +42 -0
- hikyuu/include/hikyuu/trade_sys/environment/imp/logic/DivEnvironment.h +42 -0
- hikyuu/include/hikyuu/trade_sys/environment/imp/logic/MultiEnvironment.h +42 -0
- hikyuu/include/hikyuu/trade_sys/environment/imp/logic/OrEnvironment.h +42 -0
- hikyuu/include/hikyuu/trade_sys/environment/imp/logic/SubEnvironment.h +42 -0
- hikyuu/include/hikyuu/trade_sys/environment/imp/logic/__init__.py +1 -0
- hikyuu/include/hikyuu/trade_sys/portfolio/Portfolio.h +0 -4
- hikyuu/include/hikyuu/trade_sys/signal/SignalBase.h +1 -7
- hikyuu/include/hikyuu/trade_sys/signal/crt/SG_Logic.h +94 -4
- hikyuu/include/hikyuu/trade_sys/signal/crt/SG_OneSide.h +10 -0
- hikyuu/include/hikyuu/trade_sys/signal/imp/logic/AndSignal.h +19 -0
- hikyuu/include/hikyuu/trade_sys/signal/imp/logic/OperatorSignal.h +3 -1
- hikyuu/include/hikyuu/trade_sys/signal/imp/logic/OperatorValueSignal.h +1 -0
- hikyuu/include/hikyuu/trade_sys/signal/imp/logic/OrSignal.h +19 -0
- hikyuu/include/hikyuu/version.h +4 -4
- hikyuu/indicator/indicator.py +1 -0
- hikyuu/trade_manage/__init__.pyi +506 -495
- hikyuu/trade_manage/broker.pyi +3 -3
- hikyuu/trade_manage/broker_easytrader.pyi +1 -1
- hikyuu/trade_manage/trade.pyi +506 -495
- hikyuu/trade_sys/trade_sys.py +4 -3
- hikyuu/util/__init__.pyi +2 -2
- hikyuu/util/singleton.pyi +1 -1
- {hikyuu-2.5.1.dist-info → hikyuu-2.5.3.dist-info}/METADATA +3 -2
- {hikyuu-2.5.1.dist-info → hikyuu-2.5.3.dist-info}/RECORD +89 -65
- {hikyuu-2.5.1.dist-info → hikyuu-2.5.3.dist-info}/top_level.txt +1 -0
- {hikyuu-2.5.1.dist-info → hikyuu-2.5.3.dist-info}/LICENSE +0 -0
- {hikyuu-2.5.1.dist-info → hikyuu-2.5.3.dist-info}/WHEEL +0 -0
- {hikyuu-2.5.1.dist-info → hikyuu-2.5.3.dist-info}/entry_points.txt +0 -0
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2025 hikyuu.org
|
|
3
|
+
*
|
|
4
|
+
* Created on: 2025-03-06
|
|
5
|
+
* Author: fasiondog
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include "hikyuu/trade_sys/environment/EnvironmentBase.h"
|
|
11
|
+
|
|
12
|
+
namespace hku {
|
|
13
|
+
|
|
14
|
+
class HKU_API MultiEnvironment : public EnvironmentBase {
|
|
15
|
+
public:
|
|
16
|
+
MultiEnvironment();
|
|
17
|
+
MultiEnvironment(const EnvironmentPtr& ev1, const EnvironmentPtr& ev2);
|
|
18
|
+
virtual ~MultiEnvironment();
|
|
19
|
+
|
|
20
|
+
virtual void _calculate() override;
|
|
21
|
+
virtual void _reset() override;
|
|
22
|
+
virtual EnvironmentPtr _clone() override;
|
|
23
|
+
|
|
24
|
+
private:
|
|
25
|
+
EnvironmentPtr m_ev1;
|
|
26
|
+
EnvironmentPtr m_ev2;
|
|
27
|
+
|
|
28
|
+
//============================================
|
|
29
|
+
// 序列化支持
|
|
30
|
+
//============================================
|
|
31
|
+
#if HKU_SUPPORT_SERIALIZATION
|
|
32
|
+
friend class boost::serialization::access;
|
|
33
|
+
template <class Archive>
|
|
34
|
+
void serialize(Archive& ar, const unsigned int version) {
|
|
35
|
+
ar& BOOST_SERIALIZATION_BASE_OBJECT_NVP(EnvironmentBase);
|
|
36
|
+
ar& BOOST_SERIALIZATION_NVP(m_ev1);
|
|
37
|
+
ar& BOOST_SERIALIZATION_NVP(m_ev2);
|
|
38
|
+
}
|
|
39
|
+
#endif
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
} // namespace hku
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2025 hikyuu.org
|
|
3
|
+
*
|
|
4
|
+
* Created on: 2025-03-06
|
|
5
|
+
* Author: fasiondog
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include "hikyuu/trade_sys/environment/EnvironmentBase.h"
|
|
11
|
+
|
|
12
|
+
namespace hku {
|
|
13
|
+
|
|
14
|
+
class HKU_API OrEnvironment : public EnvironmentBase {
|
|
15
|
+
public:
|
|
16
|
+
OrEnvironment();
|
|
17
|
+
OrEnvironment(const EnvironmentPtr& ev1, const EnvironmentPtr& ev2);
|
|
18
|
+
virtual ~OrEnvironment();
|
|
19
|
+
|
|
20
|
+
virtual void _calculate() override;
|
|
21
|
+
virtual void _reset() override;
|
|
22
|
+
virtual EnvironmentPtr _clone() override;
|
|
23
|
+
|
|
24
|
+
private:
|
|
25
|
+
EnvironmentPtr m_ev1;
|
|
26
|
+
EnvironmentPtr m_ev2;
|
|
27
|
+
|
|
28
|
+
//============================================
|
|
29
|
+
// 序列化支持
|
|
30
|
+
//============================================
|
|
31
|
+
#if HKU_SUPPORT_SERIALIZATION
|
|
32
|
+
friend class boost::serialization::access;
|
|
33
|
+
template <class Archive>
|
|
34
|
+
void serialize(Archive& ar, const unsigned int version) {
|
|
35
|
+
ar& BOOST_SERIALIZATION_BASE_OBJECT_NVP(EnvironmentBase);
|
|
36
|
+
ar& BOOST_SERIALIZATION_NVP(m_ev1);
|
|
37
|
+
ar& BOOST_SERIALIZATION_NVP(m_ev2);
|
|
38
|
+
}
|
|
39
|
+
#endif
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
} // namespace hku
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2025 hikyuu.org
|
|
3
|
+
*
|
|
4
|
+
* Created on: 2025-03-06
|
|
5
|
+
* Author: fasiondog
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include "hikyuu/trade_sys/environment/EnvironmentBase.h"
|
|
11
|
+
|
|
12
|
+
namespace hku {
|
|
13
|
+
|
|
14
|
+
class HKU_API SubEnvironment : public EnvironmentBase {
|
|
15
|
+
public:
|
|
16
|
+
SubEnvironment();
|
|
17
|
+
SubEnvironment(const EnvironmentPtr& ev1, const EnvironmentPtr& ev2);
|
|
18
|
+
virtual ~SubEnvironment();
|
|
19
|
+
|
|
20
|
+
virtual void _calculate() override;
|
|
21
|
+
virtual void _reset() override;
|
|
22
|
+
virtual EnvironmentPtr _clone() override;
|
|
23
|
+
|
|
24
|
+
private:
|
|
25
|
+
EnvironmentPtr m_ev1;
|
|
26
|
+
EnvironmentPtr m_ev2;
|
|
27
|
+
|
|
28
|
+
//============================================
|
|
29
|
+
// 序列化支持
|
|
30
|
+
//============================================
|
|
31
|
+
#if HKU_SUPPORT_SERIALIZATION
|
|
32
|
+
friend class boost::serialization::access;
|
|
33
|
+
template <class Archive>
|
|
34
|
+
void serialize(Archive& ar, const unsigned int version) {
|
|
35
|
+
ar& BOOST_SERIALIZATION_BASE_OBJECT_NVP(EnvironmentBase);
|
|
36
|
+
ar& BOOST_SERIALIZATION_NVP(m_ev1);
|
|
37
|
+
ar& BOOST_SERIALIZATION_NVP(m_ev2);
|
|
38
|
+
}
|
|
39
|
+
#endif
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
} // namespace hku
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -165,10 +165,6 @@ private:
|
|
|
165
165
|
#endif /* HKU_SUPPORT_SERIALIZATION */
|
|
166
166
|
};
|
|
167
167
|
|
|
168
|
-
#if HKU_SUPPORT_SERIALIZATION
|
|
169
|
-
BOOST_SERIALIZATION_ASSUME_ABSTRACT(Portfolio)
|
|
170
|
-
#endif
|
|
171
|
-
|
|
172
168
|
#define PORTFOLIO_IMP(classname) \
|
|
173
169
|
public: \
|
|
174
170
|
virtual PortfolioPtr _clone() const override { \
|
|
@@ -107,9 +107,6 @@ public:
|
|
|
107
107
|
void startCycle(const Datetime& start, const Datetime& end);
|
|
108
108
|
const Datetime& getCycleStart() const;
|
|
109
109
|
const Datetime& getCycleEnd() const;
|
|
110
|
-
bool ignoreCycle() const {
|
|
111
|
-
return m_ignore_cycle;
|
|
112
|
-
}
|
|
113
110
|
|
|
114
111
|
/** 复位操作 */
|
|
115
112
|
void reset();
|
|
@@ -146,13 +143,12 @@ protected:
|
|
|
146
143
|
/* 空头持仓 */
|
|
147
144
|
bool m_hold_short;
|
|
148
145
|
|
|
149
|
-
// 用 map
|
|
146
|
+
// 用 map 保存,以便获取时能保持顺序
|
|
150
147
|
std::map<Datetime, double> m_buySig;
|
|
151
148
|
std::map<Datetime, double> m_sellSig;
|
|
152
149
|
|
|
153
150
|
Datetime m_cycle_start;
|
|
154
151
|
Datetime m_cycle_end;
|
|
155
|
-
bool m_ignore_cycle{false}; // 特殊用途,用于 OperatorSignal
|
|
156
152
|
|
|
157
153
|
//============================================
|
|
158
154
|
// 序列化支持
|
|
@@ -168,7 +164,6 @@ private:
|
|
|
168
164
|
ar& BOOST_SERIALIZATION_NVP(m_hold_short);
|
|
169
165
|
ar& BOOST_SERIALIZATION_NVP(m_buySig);
|
|
170
166
|
ar& BOOST_SERIALIZATION_NVP(m_sellSig);
|
|
171
|
-
ar& BOOST_SERIALIZATION_NVP(m_ignore_cycle);
|
|
172
167
|
// m_kdata都是系统运行时临时设置,不需要序列化
|
|
173
168
|
// ar & BOOST_SERIALIZATION_NVP(m_kdata);
|
|
174
169
|
// ar & BOOST_SERIALIZATION_NVP(m_calculated);
|
|
@@ -182,7 +177,6 @@ private:
|
|
|
182
177
|
ar& BOOST_SERIALIZATION_NVP(m_hold_short);
|
|
183
178
|
ar& BOOST_SERIALIZATION_NVP(m_buySig);
|
|
184
179
|
ar& BOOST_SERIALIZATION_NVP(m_sellSig);
|
|
185
|
-
ar& BOOST_SERIALIZATION_NVP(m_ignore_cycle);
|
|
186
180
|
// m_kdata都是系统运行时临时设置,不需要序列化
|
|
187
181
|
// ar & BOOST_SERIALIZATION_NVP(m_kdata);
|
|
188
182
|
// ar & BOOST_SERIALIZATION_NVP(m_calculated);
|
|
@@ -26,12 +26,102 @@ HKU_API SignalPtr operator-(double value, const SignalPtr& sg);
|
|
|
26
26
|
HKU_API SignalPtr operator*(double value, const SignalPtr& sg);
|
|
27
27
|
HKU_API SignalPtr operator/(double value, const SignalPtr& sg);
|
|
28
28
|
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
HKU_API SignalPtr operator&(const SignalPtr& sg1, const SignalPtr& sg2);
|
|
30
|
+
HKU_API SignalPtr operator|(const SignalPtr& sg1, const SignalPtr& sg2);
|
|
31
|
+
|
|
32
|
+
//------------------------------------------------------------------
|
|
33
|
+
// 由于 SG 的 alternate 默认为 True, 在使用如 "sg1 + sg2 + sg3"
|
|
34
|
+
// 的形式时,容易忽略 sg1 + sg2 的 alternate 属性,故添加 SG_Add 等函数
|
|
35
|
+
// 建议使用: SG_Add(sg1, sg2, False) + sg3 来避免 alternate 的问题
|
|
36
|
+
//------------------------------------------------------------------
|
|
37
|
+
inline SignalPtr SG_Add(const SignalPtr& sg1, const SignalPtr& sg2, bool alternate) {
|
|
38
|
+
auto sg = sg1 + sg2;
|
|
39
|
+
sg->setParam<bool>("alternate", alternate);
|
|
40
|
+
return sg;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
inline SignalPtr SG_Add(const vector<SignalPtr> sg_list, bool alternate) {
|
|
44
|
+
HKU_CHECK(sg_list.size() >= 2, "sg_list is empty!");
|
|
45
|
+
SignalPtr tmp = SG_Add(sg_list[0], sg_list[1], alternate);
|
|
46
|
+
for (size_t i = 2; i < sg_list.size(); ++i) {
|
|
47
|
+
tmp = SG_Add(tmp, sg_list[i], alternate);
|
|
48
|
+
}
|
|
49
|
+
return tmp;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
inline SignalPtr SG_Sub(const SignalPtr& sg1, const SignalPtr& sg2, bool alternate) {
|
|
53
|
+
auto sg = sg1 - sg2;
|
|
54
|
+
sg->setParam<bool>("alternate", alternate);
|
|
55
|
+
return sg;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
inline SignalPtr SG_Sub(const vector<SignalPtr> sg_list, bool alternate) {
|
|
59
|
+
HKU_CHECK(sg_list.size() >= 2, "sg_list is empty!");
|
|
60
|
+
SignalPtr tmp = SG_Sub(sg_list[0], sg_list[1], alternate);
|
|
61
|
+
for (size_t i = 2; i < sg_list.size(); ++i) {
|
|
62
|
+
tmp = SG_Sub(tmp, sg_list[i], alternate);
|
|
63
|
+
}
|
|
64
|
+
return tmp;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
inline SignalPtr SG_Mul(const SignalPtr& sg1, const SignalPtr& sg2, bool alternate) {
|
|
68
|
+
auto sg = sg1 * sg2;
|
|
69
|
+
sg->setParam<bool>("alternate", alternate);
|
|
70
|
+
return sg;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
inline SignalPtr SG_Mul(const vector<SignalPtr> sg_list, bool alternate) {
|
|
74
|
+
HKU_CHECK(sg_list.size() >= 2, "sg_list is empty!");
|
|
75
|
+
SignalPtr tmp = SG_Mul(sg_list[0], sg_list[1], alternate);
|
|
76
|
+
for (size_t i = 2; i < sg_list.size(); ++i) {
|
|
77
|
+
tmp = SG_Mul(tmp, sg_list[i], alternate);
|
|
78
|
+
}
|
|
79
|
+
return tmp;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
inline SignalPtr SG_Div(const SignalPtr& sg1, const SignalPtr& sg2, bool alternate) {
|
|
83
|
+
auto sg = sg1 / sg2;
|
|
84
|
+
sg->setParam<bool>("alternate", alternate);
|
|
85
|
+
return sg;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
inline SignalPtr SG_Div(const vector<SignalPtr> sg_list, bool alternate) {
|
|
89
|
+
HKU_CHECK(sg_list.size() >= 2, "sg_list is empty!");
|
|
90
|
+
SignalPtr tmp = SG_Div(sg_list[0], sg_list[1], alternate);
|
|
91
|
+
for (size_t i = 2; i < sg_list.size(); ++i) {
|
|
92
|
+
tmp = SG_Div(tmp, sg_list[i], alternate);
|
|
93
|
+
}
|
|
94
|
+
return tmp;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
inline SignalPtr SG_And(const SignalPtr& sg1, const SignalPtr& sg2, bool alternate) {
|
|
98
|
+
auto sg = sg1 & sg2;
|
|
99
|
+
sg->setParam<bool>("alternate", alternate);
|
|
100
|
+
return sg;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
inline SignalPtr SG_And(const vector<SignalPtr> sg_list, bool alternate) {
|
|
104
|
+
HKU_CHECK(sg_list.size() >= 2, "sg_list is empty!");
|
|
105
|
+
SignalPtr tmp = SG_And(sg_list[0], sg_list[1], alternate);
|
|
106
|
+
for (size_t i = 2; i < sg_list.size(); ++i) {
|
|
107
|
+
tmp = SG_And(tmp, sg_list[i], alternate);
|
|
108
|
+
}
|
|
109
|
+
return tmp;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
inline SignalPtr SG_Or(const SignalPtr& sg1, const SignalPtr& sg2, bool alternate) {
|
|
113
|
+
auto sg = sg1 | sg2;
|
|
114
|
+
sg->setParam<bool>("alternate", alternate);
|
|
115
|
+
return sg;
|
|
31
116
|
}
|
|
32
117
|
|
|
33
|
-
inline SignalPtr
|
|
34
|
-
|
|
118
|
+
inline SignalPtr SG_Or(const vector<SignalPtr> sg_list, bool alternate) {
|
|
119
|
+
HKU_CHECK(sg_list.size() >= 2, "sg_list is empty!");
|
|
120
|
+
SignalPtr tmp = SG_Or(sg_list[0], sg_list[1], alternate);
|
|
121
|
+
for (size_t i = 2; i < sg_list.size(); ++i) {
|
|
122
|
+
tmp = SG_Or(tmp, sg_list[i], alternate);
|
|
123
|
+
}
|
|
124
|
+
return tmp;
|
|
35
125
|
}
|
|
36
126
|
|
|
37
127
|
} // namespace hku
|
|
@@ -23,6 +23,16 @@ namespace hku {
|
|
|
23
23
|
*/
|
|
24
24
|
SignalPtr HKU_API SG_OneSide(const Indicator& ind, bool is_buy);
|
|
25
25
|
|
|
26
|
+
/** 生成单边买入信号 */
|
|
27
|
+
inline SignalPtr SG_Buy(const Indicator& ind) {
|
|
28
|
+
return SG_OneSide(ind, true);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/** 生成单边卖出信号 */
|
|
32
|
+
inline SignalPtr SG_Sell(const Indicator& ind) {
|
|
33
|
+
return SG_OneSide(ind, false);
|
|
34
|
+
}
|
|
35
|
+
|
|
26
36
|
} /* namespace hku */
|
|
27
37
|
|
|
28
38
|
#endif /* TRADE_SYS_SIGNAL_CRT_SG_ONESIDE_H_ */
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2025 hikyuu.org
|
|
3
|
+
*
|
|
4
|
+
* Created on: 2025-02-08
|
|
5
|
+
* Author: fasiondog
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include "OperatorSignal.h"
|
|
11
|
+
|
|
12
|
+
namespace hku {
|
|
13
|
+
|
|
14
|
+
class AndSignal : public OperatorSignal {
|
|
15
|
+
OPERATOR_SIGNAL_IMP(AndSignal, "SG_And")
|
|
16
|
+
OPERATOR_SIGNAL_NO_PRIVATE_MEMBER_SERIALIZATION
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
} /* namespace hku */
|
|
@@ -18,7 +18,8 @@ public:
|
|
|
18
18
|
OperatorSignal(const string& name, const SignalPtr& sg1, const SignalPtr& sg2);
|
|
19
19
|
virtual ~OperatorSignal();
|
|
20
20
|
|
|
21
|
-
virtual void _reset() override;
|
|
21
|
+
virtual void _reset() override final;
|
|
22
|
+
|
|
22
23
|
virtual SignalPtr _clone() override;
|
|
23
24
|
virtual void _calculate(const KData& kdata) override {}
|
|
24
25
|
|
|
@@ -59,6 +60,7 @@ private: \
|
|
|
59
60
|
friend class boost::serialization::access; \
|
|
60
61
|
template <class Archive> \
|
|
61
62
|
void serialize(Archive& ar, const unsigned int version) { \
|
|
63
|
+
ar& BOOST_SERIALIZATION_BASE_OBJECT_NVP(SignalBase); \
|
|
62
64
|
ar& BOOST_SERIALIZATION_BASE_OBJECT_NVP(OperatorSignal); \
|
|
63
65
|
}
|
|
64
66
|
#else
|
|
@@ -58,6 +58,7 @@ private: \
|
|
|
58
58
|
friend class boost::serialization::access; \
|
|
59
59
|
template <class Archive> \
|
|
60
60
|
void serialize(Archive& ar, const unsigned int version) { \
|
|
61
|
+
ar& BOOST_SERIALIZATION_BASE_OBJECT_NVP(SignalBase); \
|
|
61
62
|
ar& BOOST_SERIALIZATION_BASE_OBJECT_NVP(OperatorValueSignal); \
|
|
62
63
|
}
|
|
63
64
|
#else
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2025 hikyuu.org
|
|
3
|
+
*
|
|
4
|
+
* Created on: 2025-02-08
|
|
5
|
+
* Author: fasiondog
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include "OperatorSignal.h"
|
|
11
|
+
|
|
12
|
+
namespace hku {
|
|
13
|
+
|
|
14
|
+
class OrSignal : public OperatorSignal {
|
|
15
|
+
OPERATOR_SIGNAL_IMP(OrSignal, "SG_Or")
|
|
16
|
+
OPERATOR_SIGNAL_NO_PRIVATE_MEMBER_SERIALIZATION
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
} /* namespace hku */
|
hikyuu/include/hikyuu/version.h
CHANGED
|
@@ -12,13 +12,13 @@
|
|
|
12
12
|
#define HKU_VERSION_H
|
|
13
13
|
|
|
14
14
|
// clang-format off
|
|
15
|
-
#define HKU_VERSION "2.5.
|
|
15
|
+
#define HKU_VERSION "2.5.3"
|
|
16
16
|
#define HKU_VERSION_MAJOR 2
|
|
17
17
|
#define HKU_VERSION_MINOR 5
|
|
18
|
-
#define HKU_VERSION_ALTER
|
|
19
|
-
#define HKU_VERSION_BUILD
|
|
18
|
+
#define HKU_VERSION_ALTER 3
|
|
19
|
+
#define HKU_VERSION_BUILD 202503071538
|
|
20
20
|
#define HKU_VERSION_MODE "RELEASE"
|
|
21
|
-
#define HKU_VERSION_GIT "2.5.
|
|
21
|
+
#define HKU_VERSION_GIT "2.5.3 release.204e0fc6 (RELEASE)"
|
|
22
22
|
// clang-format on
|
|
23
23
|
|
|
24
24
|
#endif /* HKU_VERSION_H */
|
hikyuu/indicator/indicator.py
CHANGED