hikyuu 2.5.2__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 +520 -510
- hikyuu/analysis/__init__.pyi +489 -485
- hikyuu/analysis/analysis.pyi +490 -486
- hikyuu/core.pyi +491 -487
- hikyuu/cpp/__init__.pyi +2 -2
- hikyuu/cpp/core310.pyd +0 -0
- hikyuu/cpp/core310.pyi +231 -26
- hikyuu/cpp/core311.pyd +0 -0
- hikyuu/cpp/core311.pyi +231 -26
- hikyuu/cpp/core312.pyd +0 -0
- hikyuu/cpp/core312.pyi +231 -26
- hikyuu/cpp/core313.pyd +0 -0
- hikyuu/cpp/core313.pyi +225 -26
- hikyuu/cpp/core38.pyd +0 -0
- hikyuu/cpp/core38.pyi +231 -26
- hikyuu/cpp/core39.pyd +0 -0
- hikyuu/cpp/core39.pyi +231 -26
- 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/__init__.pyi +1 -1
- hikyuu/draw/drawplot/__init__.py +8 -1
- hikyuu/draw/drawplot/__init__.pyi +12 -8
- hikyuu/draw/drawplot/bokeh_draw.pyi +508 -500
- hikyuu/draw/drawplot/common.pyi +1 -1
- hikyuu/draw/drawplot/echarts_draw.pyi +510 -502
- hikyuu/draw/drawplot/matplotlib_draw.py +129 -8
- hikyuu/draw/drawplot/matplotlib_draw.pyi +570 -515
- hikyuu/draw/elder.pyi +11 -11
- hikyuu/draw/kaufman.pyi +18 -18
- hikyuu/draw/volume.pyi +10 -10
- hikyuu/extend.pyi +500 -495
- hikyuu/hub.py +112 -6
- hikyuu/hub.pyi +39 -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 +5 -4
- 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/crt/SG_Logic.h +68 -7
- hikyuu/include/hikyuu/trade_sys/signal/imp/logic/AndSignal.h +19 -0
- hikyuu/include/hikyuu/trade_sys/signal/imp/logic/OperatorSignal.h +1 -0
- 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 +505 -499
- hikyuu/trade_manage/broker.pyi +3 -3
- hikyuu/trade_manage/broker_easytrader.pyi +1 -1
- hikyuu/trade_manage/trade.pyi +505 -499
- hikyuu/trade_sys/trade_sys.py +4 -3
- hikyuu/util/__init__.pyi +2 -2
- hikyuu/util/singleton.pyi +1 -1
- {hikyuu-2.5.2.dist-info → hikyuu-2.5.3.dist-info}/METADATA +3 -2
- {hikyuu-2.5.2.dist-info → hikyuu-2.5.3.dist-info}/RECORD +87 -70
- {hikyuu-2.5.2.dist-info → hikyuu-2.5.3.dist-info}/top_level.txt +1 -0
- {hikyuu-2.5.2.dist-info → hikyuu-2.5.3.dist-info}/LICENSE +0 -0
- {hikyuu-2.5.2.dist-info → hikyuu-2.5.3.dist-info}/WHEEL +0 -0
- {hikyuu-2.5.2.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 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 { \
|
|
@@ -26,13 +26,8 @@ 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
|
-
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
inline SignalPtr operator|(const SignalPtr& sg1, const SignalPtr& sg2) {
|
|
34
|
-
return sg1 + sg2;
|
|
35
|
-
}
|
|
29
|
+
HKU_API SignalPtr operator&(const SignalPtr& sg1, const SignalPtr& sg2);
|
|
30
|
+
HKU_API SignalPtr operator|(const SignalPtr& sg1, const SignalPtr& sg2);
|
|
36
31
|
|
|
37
32
|
//------------------------------------------------------------------
|
|
38
33
|
// 由于 SG 的 alternate 默认为 True, 在使用如 "sg1 + sg2 + sg3"
|
|
@@ -45,22 +40,88 @@ inline SignalPtr SG_Add(const SignalPtr& sg1, const SignalPtr& sg2, bool alterna
|
|
|
45
40
|
return sg;
|
|
46
41
|
}
|
|
47
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
|
+
|
|
48
52
|
inline SignalPtr SG_Sub(const SignalPtr& sg1, const SignalPtr& sg2, bool alternate) {
|
|
49
53
|
auto sg = sg1 - sg2;
|
|
50
54
|
sg->setParam<bool>("alternate", alternate);
|
|
51
55
|
return sg;
|
|
52
56
|
}
|
|
53
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
|
+
|
|
54
67
|
inline SignalPtr SG_Mul(const SignalPtr& sg1, const SignalPtr& sg2, bool alternate) {
|
|
55
68
|
auto sg = sg1 * sg2;
|
|
56
69
|
sg->setParam<bool>("alternate", alternate);
|
|
57
70
|
return sg;
|
|
58
71
|
}
|
|
59
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
|
+
|
|
60
82
|
inline SignalPtr SG_Div(const SignalPtr& sg1, const SignalPtr& sg2, bool alternate) {
|
|
61
83
|
auto sg = sg1 / sg2;
|
|
62
84
|
sg->setParam<bool>("alternate", alternate);
|
|
63
85
|
return sg;
|
|
64
86
|
}
|
|
65
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;
|
|
116
|
+
}
|
|
117
|
+
|
|
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;
|
|
125
|
+
}
|
|
126
|
+
|
|
66
127
|
} // namespace hku
|
|
@@ -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 */
|
|
@@ -60,6 +60,7 @@ private: \
|
|
|
60
60
|
friend class boost::serialization::access; \
|
|
61
61
|
template <class Archive> \
|
|
62
62
|
void serialize(Archive& ar, const unsigned int version) { \
|
|
63
|
+
ar& BOOST_SERIALIZATION_BASE_OBJECT_NVP(SignalBase); \
|
|
63
64
|
ar& BOOST_SERIALIZATION_BASE_OBJECT_NVP(OperatorSignal); \
|
|
64
65
|
}
|
|
65
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