hikyuu 2.3.0__py3-none-win_amd64.whl → 2.5.0__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 +438 -6
- hikyuu/__init__.pyi +791 -0
- hikyuu/analysis/__init__.pyi +487 -0
- hikyuu/analysis/analysis.pyi +517 -0
- hikyuu/core.pyi +482 -0
- hikyuu/cpp/__init__.pyi +3 -0
- hikyuu/cpp/boost_date_time-mt.dll +0 -0
- hikyuu/cpp/boost_serialization-mt.dll +0 -0
- hikyuu/cpp/boost_wserialization-mt.dll +0 -0
- hikyuu/cpp/core310.pyd +0 -0
- hikyuu/cpp/core311.pyd +0 -0
- hikyuu/cpp/core312.pyd +0 -0
- hikyuu/cpp/core312.pyi +12867 -0
- hikyuu/cpp/core313.pyd +0 -0
- hikyuu/cpp/core38.pyd +0 -0
- hikyuu/cpp/core39.pyd +0 -0
- hikyuu/cpp/hikyuu.dll +0 -0
- hikyuu/cpp/hikyuu.lib +0 -0
- hikyuu/cpp/sqlite3.dll +0 -0
- hikyuu/data/common_mysql.py +24 -7
- hikyuu/data/common_pytdx.py +17 -1
- hikyuu/data/em_block_to_mysql.py +3 -2
- hikyuu/data/em_block_to_sqlite.py +8 -3
- hikyuu/data/mysql_upgrade/0025.sql +61 -0
- hikyuu/data/mysql_upgrade/0026.sql +9 -0
- hikyuu/data/sqlite_upgrade/0025.sql +63 -0
- hikyuu/data/sqlite_upgrade/0026.sql +10 -0
- hikyuu/draw/__init__.pyi +35 -0
- hikyuu/draw/drawplot/__init__.py +3 -0
- hikyuu/draw/drawplot/__init__.pyi +134 -0
- hikyuu/draw/drawplot/bokeh_draw.pyi +796 -0
- hikyuu/draw/drawplot/common.pyi +10 -0
- hikyuu/draw/drawplot/echarts_draw.py +219 -24
- hikyuu/draw/drawplot/echarts_draw.pyi +682 -0
- hikyuu/draw/drawplot/matplotlib_draw.py +18 -3
- hikyuu/draw/drawplot/matplotlib_draw.pyi +1101 -0
- hikyuu/draw/elder.pyi +44 -0
- hikyuu/draw/kaufman.pyi +38 -0
- hikyuu/draw/volume.pyi +31 -0
- hikyuu/examples/notebook/Demo/Demo2.ipynb +1 -1
- hikyuu/extend.py +9 -3
- hikyuu/extend.pyi +636 -0
- hikyuu/fetcher/stock/zh_block_em.py +118 -51
- hikyuu/gui/data/EscapetimeThread.py +4 -4
- hikyuu/gui/data/ImportBlockInfoTask.py +3 -2
- hikyuu/gui/data/ImportHistoryFinanceTask.py +2 -0
- hikyuu/gui/data/MainWindow.py +48 -42
- hikyuu/gui/importdata.py +13 -26
- hikyuu/hub.py +2 -4
- hikyuu/hub.pyi +254 -0
- hikyuu/include/hikyuu/DataType.h +5 -0
- hikyuu/include/hikyuu/Stock.h +7 -0
- hikyuu/include/hikyuu/indicator/Indicator.h +8 -1
- hikyuu/include/hikyuu/indicator/Indicator2InImp.h +65 -0
- hikyuu/include/hikyuu/indicator/IndicatorImp.h +4 -3
- hikyuu/include/hikyuu/indicator/build_in.h +12 -0
- hikyuu/include/hikyuu/indicator/crt/ADVANCE.h +3 -1
- hikyuu/include/hikyuu/indicator/crt/CONTEXT.h +2 -2
- hikyuu/include/hikyuu/indicator/crt/CORR.h +4 -2
- hikyuu/include/hikyuu/indicator/crt/COST.h +3 -0
- hikyuu/include/hikyuu/indicator/crt/CYCLE.h +24 -0
- hikyuu/include/hikyuu/indicator/crt/DECLINE.h +3 -1
- hikyuu/include/hikyuu/indicator/crt/DISCARD.h +27 -0
- hikyuu/include/hikyuu/indicator/crt/DMA.h +2 -1
- hikyuu/include/hikyuu/indicator/crt/HSL.h +1 -13
- hikyuu/include/hikyuu/indicator/crt/INBLOCK.h +31 -0
- hikyuu/include/hikyuu/indicator/crt/INDEX.h +60 -0
- hikyuu/include/hikyuu/indicator/crt/INSUM.h +5 -2
- hikyuu/include/hikyuu/indicator/crt/ISINF.h +28 -0
- hikyuu/include/hikyuu/indicator/crt/ISINFA.h +28 -0
- hikyuu/include/hikyuu/indicator/crt/ISNA.h +29 -0
- hikyuu/include/hikyuu/indicator/crt/JUMPDOWN.h +24 -0
- hikyuu/include/hikyuu/indicator/crt/JUMPUP.h +24 -0
- hikyuu/include/hikyuu/indicator/crt/LASTVALUE.h +29 -0
- hikyuu/include/hikyuu/indicator/crt/LIUTONGPAN.h +1 -0
- hikyuu/include/hikyuu/indicator/crt/REPLACE.h +29 -0
- hikyuu/include/hikyuu/indicator/crt/SPEARMAN.h +3 -2
- hikyuu/include/hikyuu/indicator/crt/WINNER.h +38 -0
- hikyuu/include/hikyuu/indicator/imp/IContext.h +1 -1
- hikyuu/include/hikyuu/indicator/imp/ICorr.h +7 -22
- hikyuu/include/hikyuu/indicator/imp/ICost.h +31 -0
- hikyuu/include/hikyuu/indicator/imp/ICycle.h +30 -0
- hikyuu/include/hikyuu/indicator/imp/IDiscard.h +28 -0
- hikyuu/include/hikyuu/indicator/imp/IDma.h +7 -24
- hikyuu/include/hikyuu/indicator/imp/IHsl.h +30 -0
- hikyuu/include/hikyuu/indicator/imp/IInBlock.h +30 -0
- hikyuu/include/hikyuu/indicator/imp/IIndex.h +26 -0
- hikyuu/include/hikyuu/indicator/imp/IIsInf.h +26 -0
- hikyuu/include/hikyuu/indicator/imp/IIsInfa.h +26 -0
- hikyuu/include/hikyuu/indicator/imp/IIsNa.h +26 -0
- hikyuu/include/hikyuu/indicator/imp/IJumpDown.h +24 -0
- hikyuu/include/hikyuu/indicator/imp/IJumpUp.h +24 -0
- hikyuu/include/hikyuu/indicator/imp/ILastValue.h +26 -0
- hikyuu/include/hikyuu/indicator/imp/IReplace.h +26 -0
- hikyuu/include/hikyuu/indicator/imp/ISpearman.h +6 -21
- hikyuu/include/hikyuu/indicator/imp/IWinner.h +26 -0
- hikyuu/include/hikyuu/indicator_talib/imp/TaMavp.h +6 -20
- hikyuu/include/hikyuu/indicator_talib/imp/ta_defines.h +14 -65
- hikyuu/include/hikyuu/indicator_talib/imp/ta_imp.h +54 -90
- hikyuu/include/hikyuu/indicator_talib/ta_crt.h +11 -9
- hikyuu/include/hikyuu/strategy/RunPortfolioInStrategy.h +3 -4
- hikyuu/include/hikyuu/strategy/Strategy.h +4 -5
- hikyuu/include/hikyuu/trade_manage/TradeRecord.h +5 -1
- hikyuu/include/hikyuu/trade_sys/allocatefunds/build_in.h +1 -0
- hikyuu/include/hikyuu/trade_sys/allocatefunds/crt/AF_FixedWeightList.h +22 -0
- hikyuu/include/hikyuu/trade_sys/allocatefunds/imp/FixedWeightListAllocateFunds.h +25 -0
- hikyuu/include/hikyuu/trade_sys/moneymanager/MoneyManagerBase.h +17 -4
- hikyuu/include/hikyuu/trade_sys/moneymanager/build_in.h +2 -0
- hikyuu/include/hikyuu/trade_sys/moneymanager/crt/MM_FixedCapital.h +6 -0
- hikyuu/include/hikyuu/trade_sys/moneymanager/crt/MM_FixedCapitalFunds.h +26 -0
- hikyuu/include/hikyuu/trade_sys/moneymanager/crt/MM_FixedCountTps.h +27 -0
- hikyuu/include/hikyuu/trade_sys/moneymanager/crt/MM_FixedRisk.h +6 -0
- hikyuu/include/hikyuu/trade_sys/moneymanager/crt/MM_FixedUnits.h +6 -0
- hikyuu/include/hikyuu/trade_sys/moneymanager/crt/MM_WilliamsFixedRisk.h +7 -0
- hikyuu/include/hikyuu/trade_sys/moneymanager/imp/FixedCapitalFundsMM.h +28 -0
- hikyuu/include/hikyuu/trade_sys/moneymanager/imp/FixedCountTpsMM.h +44 -0
- hikyuu/include/hikyuu/trade_sys/multifactor/build_in.h +1 -0
- hikyuu/include/hikyuu/trade_sys/multifactor/crt/MF_Weight.h +30 -0
- hikyuu/include/hikyuu/trade_sys/multifactor/imp/WeightMultiFactor.h +41 -0
- hikyuu/include/hikyuu/trade_sys/portfolio/Portfolio.h +38 -37
- hikyuu/include/hikyuu/trade_sys/portfolio/build_in.h +1 -0
- hikyuu/include/hikyuu/trade_sys/portfolio/crt/PF_Simple.h +25 -1
- hikyuu/include/hikyuu/trade_sys/portfolio/crt/PF_WithoutAF.h +50 -0
- hikyuu/include/hikyuu/trade_sys/portfolio/imp/SimplePortfolio.h +53 -0
- hikyuu/include/hikyuu/trade_sys/portfolio/imp/WithoutAFPortfolio.h +57 -0
- hikyuu/include/hikyuu/trade_sys/selector/imp/MultiFactorSelector.h +7 -0
- hikyuu/include/hikyuu/trade_sys/signal/SignalBase.h +51 -5
- hikyuu/include/hikyuu/trade_sys/signal/build_in.h +2 -0
- hikyuu/include/hikyuu/trade_sys/signal/crt/SG_Bool.h +2 -1
- hikyuu/include/hikyuu/trade_sys/signal/crt/SG_Logic.h +37 -0
- hikyuu/include/hikyuu/trade_sys/signal/crt/SG_OneSide.h +28 -0
- hikyuu/include/hikyuu/trade_sys/signal/imp/OneSideSignal.h +46 -0
- hikyuu/include/hikyuu/trade_sys/signal/imp/logic/AddSignal.h +19 -0
- hikyuu/include/hikyuu/trade_sys/signal/imp/logic/AddValueSignal.h +19 -0
- hikyuu/include/hikyuu/trade_sys/signal/imp/logic/DivSignal.h +19 -0
- hikyuu/include/hikyuu/trade_sys/signal/imp/logic/DivValueSignal.h +22 -0
- hikyuu/include/hikyuu/trade_sys/signal/imp/logic/MulSignal.h +19 -0
- hikyuu/include/hikyuu/trade_sys/signal/imp/logic/MulValueSignal.h +19 -0
- hikyuu/include/hikyuu/trade_sys/signal/imp/logic/OperatorSignal.h +68 -0
- hikyuu/include/hikyuu/trade_sys/signal/imp/logic/OperatorValueSignal.h +67 -0
- hikyuu/include/hikyuu/trade_sys/signal/imp/logic/SubSignal.h +19 -0
- hikyuu/include/hikyuu/trade_sys/signal/imp/logic/SubValueSignal.h +22 -0
- hikyuu/include/hikyuu/trade_sys/signal/imp/logic/__init__.py +1 -0
- hikyuu/include/hikyuu/trade_sys/stoploss/crt/ST_Indicator.h +1 -1
- hikyuu/include/hikyuu/trade_sys/stoploss/imp/IndicatorStoploss.h +3 -4
- hikyuu/include/hikyuu/utilities/FilterNode.h +2 -2
- hikyuu/include/hikyuu/utilities/Log.h +42 -15
- hikyuu/include/hikyuu/utilities/datetime/Datetime.h +1 -1
- hikyuu/include/hikyuu/utilities/datetime/TimeDelta.h +2 -2
- hikyuu/include/hikyuu/utilities/db_connect/DBCondition.h +4 -0
- hikyuu/include/hikyuu/utilities/db_connect/SQLResultSet.h +2 -2
- hikyuu/include/hikyuu/utilities/db_connect/mysql/MySQLConnect.h +5 -1
- hikyuu/include/hikyuu/utilities/node/NodeServer.h +4 -4
- hikyuu/include/hikyuu/utilities/thread/MQStealThreadPool.h +2 -2
- hikyuu/include/hikyuu/utilities/thread/MQThreadPool.h +2 -2
- hikyuu/include/hikyuu/utilities/thread/StealThreadPool.h +5 -5
- hikyuu/include/hikyuu/utilities/thread/ThreadPool.h +2 -2
- hikyuu/include/hikyuu/utilities/thread/algorithm.h +16 -10
- hikyuu/include/hikyuu/version.h +4 -4
- hikyuu/indicator/indicator.py +1 -0
- hikyuu/interactive.py +3 -266
- hikyuu/trade_manage/__init__.pyi +584 -0
- hikyuu/trade_manage/broker.pyi +54 -0
- hikyuu/trade_manage/broker_easytrader.pyi +21 -0
- hikyuu/trade_manage/broker_mail.pyi +55 -0
- hikyuu/trade_manage/trade.pyi +590 -0
- hikyuu/util/__init__.pyi +55 -0
- hikyuu/util/check.pyi +59 -0
- hikyuu/util/mylog.pyi +70 -0
- hikyuu/util/notebook.pyi +23 -0
- hikyuu/util/singleton.pyi +18 -0
- hikyuu/util/slice.pyi +8 -0
- {hikyuu-2.3.0.dist-info → hikyuu-2.5.0.dist-info}/METADATA +3 -2
- {hikyuu-2.3.0.dist-info → hikyuu-2.5.0.dist-info}/RECORD +178 -95
- {hikyuu-2.3.0.dist-info → hikyuu-2.5.0.dist-info}/top_level.txt +1 -0
- hikyuu/deprecated.py +0 -651
- {hikyuu-2.3.0.dist-info → hikyuu-2.5.0.dist-info}/LICENSE +0 -0
- {hikyuu-2.3.0.dist-info → hikyuu-2.5.0.dist-info}/WHEEL +0 -0
- {hikyuu-2.3.0.dist-info → hikyuu-2.5.0.dist-info}/entry_points.txt +0 -0
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2025 hikyuu.org
|
|
3
|
+
*
|
|
4
|
+
* Created on: 2025-01-16
|
|
5
|
+
* Author: fasiondog
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include "../Indicator.h"
|
|
11
|
+
|
|
12
|
+
namespace hku {
|
|
13
|
+
|
|
14
|
+
// 这里的大盘都指 sh000001
|
|
15
|
+
|
|
16
|
+
/** 对应的大盘开盘价,分别是上证指数,深证成指,科创50,创业板指 */
|
|
17
|
+
Indicator HKU_API INDEXO(bool fill_null = true);
|
|
18
|
+
inline Indicator INDEXO(const KData& k, bool fill_null = true) {
|
|
19
|
+
return INDEXO(fill_null)(k);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/** 对应的大盘最高价,分别是上证指数,深证成指,科创50,创业板指 */
|
|
23
|
+
Indicator HKU_API INDEXH(bool fill_null = true);
|
|
24
|
+
inline Indicator INDEXH(const KData& k, bool fill_null = true) {
|
|
25
|
+
return INDEXH(fill_null)(k);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/** 对应的大盘最低价,分别是上证指数,深证成指,科创50,创业板指 */
|
|
29
|
+
Indicator HKU_API INDEXL(bool fill_null = true);
|
|
30
|
+
inline Indicator INDEXL(const KData& k, bool fill_null = true) {
|
|
31
|
+
return INDEXL(fill_null)(k);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/** 对应的大盘收盘价,分别是上证指数,深证成指,科创50,创业板指 */
|
|
35
|
+
Indicator HKU_API INDEXC(bool fill_null = true);
|
|
36
|
+
inline Indicator INDEXC(const KData& k, bool fill_null = true) {
|
|
37
|
+
return INDEXC(fill_null)(k);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/** 对应的大盘成交金额,分别是上证指数,深证成指,科创50,创业板指 */
|
|
41
|
+
Indicator HKU_API INDEXA(bool fill_null = true);
|
|
42
|
+
inline Indicator INDEXA(const KData& k, bool fill_null = true) {
|
|
43
|
+
return INDEXA(fill_null)(k);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/** 对应的大盘成交量,分别是上证指数,深证成指,科创50,创业板指 */
|
|
47
|
+
Indicator HKU_API INDEXV(bool fill_null = true);
|
|
48
|
+
inline Indicator INDEXV(const KData& k, bool fill_null = true) {
|
|
49
|
+
return INDEXV(fill_null)(k);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/** 大盘上涨家数, 使用通达信 SH880005,可能无法用于实盘 */
|
|
53
|
+
Indicator HKU_API INDEXADV();
|
|
54
|
+
Indicator HKU_API INDEXADV(const KQuery& query);
|
|
55
|
+
|
|
56
|
+
/** 大盘下跌家数, 使用通达信 SH880005,可能无法用于实盘 */
|
|
57
|
+
Indicator HKU_API INDEXDEC();
|
|
58
|
+
Indicator HKU_API INDEXDEC(const KQuery& query);
|
|
59
|
+
|
|
60
|
+
} // namespace hku
|
|
@@ -17,17 +17,20 @@ namespace hku {
|
|
|
17
17
|
* @param query 指定范围
|
|
18
18
|
* @param ind 指定指标
|
|
19
19
|
* @param mode 计算类型:0-累加,1-平均数,2-最大值,3-最小值.
|
|
20
|
+
* @param fill_null 日期对齐时缺失数据填充 nan 值。
|
|
20
21
|
* @return Indicator
|
|
21
22
|
*/
|
|
22
|
-
Indicator HKU_API INSUM(const Block& block, const KQuery& query, const Indicator& ind, int mode
|
|
23
|
+
Indicator HKU_API INSUM(const Block& block, const KQuery& query, const Indicator& ind, int mode,
|
|
24
|
+
bool fill_null = true);
|
|
23
25
|
|
|
24
26
|
/**
|
|
25
27
|
* 返回板块各成分该指标相应输出按计算类型得到的计算值.计算类型:0-累加,1-平均数,2-最大值,3-最小值.
|
|
26
28
|
* @param block 指定板块
|
|
27
29
|
* @param ind 指定指标
|
|
28
30
|
* @param mode 计算类型:0-累加,1-平均数,2-最大值,3-最小值.
|
|
31
|
+
* @param fill_null 日期对齐时缺失数据填充 nan 值。
|
|
29
32
|
* @return Indicator
|
|
30
33
|
*/
|
|
31
|
-
Indicator HKU_API INSUM(const Block& block, const Indicator& ind, int mode);
|
|
34
|
+
Indicator HKU_API INSUM(const Block& block, const Indicator& ind, int mode, bool fill_null = true);
|
|
32
35
|
|
|
33
36
|
} // namespace hku
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2025 hikyuu.org
|
|
3
|
+
*
|
|
4
|
+
* Created on: 2025-01-08
|
|
5
|
+
* Author: fasiondog
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
#ifndef INDICATOR_CRT_ISINF_H_
|
|
10
|
+
#define INDICATOR_CRT_ISINF_H_
|
|
11
|
+
|
|
12
|
+
#include "CVAL.h"
|
|
13
|
+
|
|
14
|
+
namespace hku {
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* 是否为正无穷大 (负无穷大使用 ISINFA)
|
|
18
|
+
* @ingroup Indicator
|
|
19
|
+
*/
|
|
20
|
+
Indicator HKU_API ISINF();
|
|
21
|
+
|
|
22
|
+
inline Indicator ISINF(const Indicator& ind) {
|
|
23
|
+
return ISINF()(ind);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
} // namespace hku
|
|
27
|
+
|
|
28
|
+
#endif /* INDICATOR_CRT_ISINF_H_ */
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2025 hikyuu.org
|
|
3
|
+
*
|
|
4
|
+
* Created on: 2025-01-08
|
|
5
|
+
* Author: fasiondog
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
#ifndef INDICATOR_CRT_ISINFA_H_
|
|
10
|
+
#define INDICATOR_CRT_ISINFA_H_
|
|
11
|
+
|
|
12
|
+
#include "CVAL.h"
|
|
13
|
+
|
|
14
|
+
namespace hku {
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* 是否为负无穷大 (正无穷大使用 ISINF)
|
|
18
|
+
* @ingroup Indicator
|
|
19
|
+
*/
|
|
20
|
+
Indicator HKU_API ISINFA();
|
|
21
|
+
|
|
22
|
+
inline Indicator ISINFA(const Indicator& ind) {
|
|
23
|
+
return ISINFA()(ind);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
} // namespace hku
|
|
27
|
+
|
|
28
|
+
#endif /* INDICATOR_CRT_ISINFA_H_ */
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2025 hikyuu.org
|
|
3
|
+
*
|
|
4
|
+
* Created on: 2025-01-08
|
|
5
|
+
* Author: fasiondog
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
#ifndef INDICATOR_CRT_ISNA_H_
|
|
10
|
+
#define INDICATOR_CRT_ISNA_H_
|
|
11
|
+
|
|
12
|
+
#include "CVAL.h"
|
|
13
|
+
|
|
14
|
+
namespace hku {
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* 是否为 NaN 值
|
|
18
|
+
* @param ignore_discard 是否忽略discard值,默认为false
|
|
19
|
+
* @ingroup Indicator
|
|
20
|
+
*/
|
|
21
|
+
Indicator HKU_API ISNA(bool ignore_discard = false);
|
|
22
|
+
|
|
23
|
+
inline Indicator ISNA(const Indicator& ind, bool ignore_discard = false) {
|
|
24
|
+
return ISNA(ignore_discard)(ind);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
} // namespace hku
|
|
28
|
+
|
|
29
|
+
#endif /* INDICATOR_CRT_ISNA_H_ */
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2025 hikyuu.org
|
|
3
|
+
*
|
|
4
|
+
* Created on: 2025-02-10
|
|
5
|
+
* Author: fasiondog
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include "../Indicator.h"
|
|
11
|
+
|
|
12
|
+
namespace hku {
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* 边缘跳变,从大于0.0,跳变到 <= 0.0
|
|
16
|
+
* @ingroup Indicator
|
|
17
|
+
*/
|
|
18
|
+
Indicator HKU_API JUMPDOWN();
|
|
19
|
+
|
|
20
|
+
inline Indicator JUMPDOWN(const Indicator& ind) {
|
|
21
|
+
return JUMPDOWN()(ind);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
} // namespace hku
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2025 hikyuu.org
|
|
3
|
+
*
|
|
4
|
+
* Created on: 2025-02-10
|
|
5
|
+
* Author: fasiondog
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include "../Indicator.h"
|
|
11
|
+
|
|
12
|
+
namespace hku {
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* 边缘跳变,从小于等于0.0,跳变到 > 0.0
|
|
16
|
+
* @ingroup Indicator
|
|
17
|
+
*/
|
|
18
|
+
Indicator HKU_API JUMPUP();
|
|
19
|
+
|
|
20
|
+
inline Indicator JUMPUP(const Indicator& ind) {
|
|
21
|
+
return JUMPUP()(ind);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
} // namespace hku
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2025 hikyuu.org
|
|
3
|
+
*
|
|
4
|
+
* Created on: 2025-02-04
|
|
5
|
+
* Author: fasiondog
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
#ifndef INDICATOR_CRT_LASTVALUE_H_
|
|
10
|
+
#define INDICATOR_CRT_LASTVALUE_H_
|
|
11
|
+
|
|
12
|
+
#include "../Indicator.h"
|
|
13
|
+
|
|
14
|
+
namespace hku {
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* 取输入指标最后值为常数,即结果中所有值均为输入指标的最后值,谨慎使用
|
|
18
|
+
* @note 等同于通达信 CONST 指标, 由于 Windows 下 CONST 命名冲突,取名 LASTVALUE
|
|
19
|
+
* @ingroup Indicator
|
|
20
|
+
*/
|
|
21
|
+
Indicator HKU_API LASTVALUE(bool ignore_discard = false);
|
|
22
|
+
|
|
23
|
+
inline Indicator LASTVALUE(const Indicator& ind, bool ignore_discard = false) {
|
|
24
|
+
return LASTVALUE(ignore_discard)(ind);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
} // namespace hku
|
|
28
|
+
|
|
29
|
+
#endif /* INDICATOR_CRT_LASTVALUE_H_ */
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2025 hikyuu.org
|
|
3
|
+
*
|
|
4
|
+
* Created on: 2025-01-12
|
|
5
|
+
* Author: fasiondog
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include "../Indicator.h"
|
|
11
|
+
|
|
12
|
+
namespace hku {
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* 替换指定数值,通常用于替换 Nan 值
|
|
16
|
+
* @param old_val 要替换的数值
|
|
17
|
+
* @param new_val 替换后的数值
|
|
18
|
+
* @param ignore_discard 忽略 discard,如果替换 nan 值,新discard将被设置为 0
|
|
19
|
+
* @ingroup Indicator
|
|
20
|
+
*/
|
|
21
|
+
Indicator HKU_API REPLACE(double old_val = Null<double>(), double new_val = 0.0,
|
|
22
|
+
bool ignore_discard = false);
|
|
23
|
+
|
|
24
|
+
inline Indicator REPLACE(const Indicator& ind, double old_val = Null<double>(),
|
|
25
|
+
double new_val = 0.0, bool ignore_discard = false) {
|
|
26
|
+
return REPLACE(old_val, new_val, ignore_discard)(ind);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
} // namespace hku
|
|
@@ -17,7 +17,8 @@ namespace hku {
|
|
|
17
17
|
* @param n 滚动窗口(大于2 或 等于0),等于0时,代表 n 实际使用 ind 的长度
|
|
18
18
|
* @ingroup Indicator
|
|
19
19
|
*/
|
|
20
|
-
Indicator HKU_API SPEARMAN(const Indicator& ind, const Indicator& ref_ind, int n = 0
|
|
21
|
-
|
|
20
|
+
Indicator HKU_API SPEARMAN(const Indicator& ind, const Indicator& ref_ind, int n = 0,
|
|
21
|
+
bool fill_null = true);
|
|
22
|
+
Indicator HKU_API SPEARMAN(const Indicator& ref_ind, int n = 0, bool fill_null = true);
|
|
22
23
|
|
|
23
24
|
} // namespace hku
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2025 hikyuu.org
|
|
3
|
+
*
|
|
4
|
+
* Created on: 2025-01-25
|
|
5
|
+
* Author: fasiondog
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
#ifndef INDICATOR_CRT_WINNER_H_
|
|
10
|
+
#define INDICATOR_CRT_WINNER_H_
|
|
11
|
+
|
|
12
|
+
#include "CVAL.h"
|
|
13
|
+
|
|
14
|
+
namespace hku {
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* 获利盘比例
|
|
18
|
+
* @details
|
|
19
|
+
* <pre>
|
|
20
|
+
* 用法: WINNER(CLOSE) 表示以当前收市价卖出的获利盘比例。
|
|
21
|
+
* 例如: 返回0.1表示10%获利盘;WINNER(10.5)表示10.5元价格的获利盘比例
|
|
22
|
+
* 该函数仅对日线分析周期有效。
|
|
23
|
+
* </pre>
|
|
24
|
+
* @ingroup Indicator
|
|
25
|
+
*/
|
|
26
|
+
Indicator HKU_API WINNER();
|
|
27
|
+
|
|
28
|
+
inline Indicator WINNER(const Indicator& ind) {
|
|
29
|
+
return WINNER()(ind);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
inline Indicator WINNER(Indicator::value_t val) {
|
|
33
|
+
return WINNER(CVAL(val));
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
} // namespace hku
|
|
37
|
+
|
|
38
|
+
#endif /* INDICATOR_CRT_WINNER_H_ */
|
|
@@ -7,35 +7,20 @@
|
|
|
7
7
|
|
|
8
8
|
#pragma once
|
|
9
9
|
|
|
10
|
-
#include "../
|
|
10
|
+
#include "../Indicator2InImp.h"
|
|
11
11
|
|
|
12
12
|
namespace hku {
|
|
13
13
|
|
|
14
|
-
class ICorr : public
|
|
14
|
+
class ICorr : public Indicator2InImp {
|
|
15
|
+
INDICATOR2IN_IMP(ICorr)
|
|
16
|
+
INDICATOR2IN_IMP_NO_PRIVATE_MEMBER_SERIALIZATION
|
|
17
|
+
|
|
15
18
|
public:
|
|
16
19
|
ICorr();
|
|
17
|
-
ICorr(const Indicator& ref_ind, int n);
|
|
20
|
+
ICorr(const Indicator& ref_ind, int n, bool fill_null);
|
|
18
21
|
virtual ~ICorr();
|
|
19
22
|
|
|
20
23
|
virtual void _checkParam(const string& name) const override;
|
|
21
|
-
virtual void _calculate(const Indicator& data) override;
|
|
22
|
-
virtual IndicatorImpPtr _clone() override;
|
|
23
|
-
|
|
24
|
-
private:
|
|
25
|
-
Indicator m_ref_ind;
|
|
26
|
-
|
|
27
|
-
//============================================
|
|
28
|
-
// 序列化支持
|
|
29
|
-
//============================================
|
|
30
|
-
#if HKU_SUPPORT_SERIALIZATION
|
|
31
|
-
private:
|
|
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(IndicatorImp);
|
|
36
|
-
ar& BOOST_SERIALIZATION_NVP(m_ref_ind);
|
|
37
|
-
}
|
|
38
|
-
#endif
|
|
39
24
|
};
|
|
40
25
|
|
|
41
|
-
}
|
|
26
|
+
} // namespace hku
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2025 hikyuu.org
|
|
3
|
+
*
|
|
4
|
+
* Created on: 2025-01-22
|
|
5
|
+
* Author: fasiondog
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
#ifndef INDICATOR_IMP_ICOST_H_
|
|
10
|
+
#define INDICATOR_IMP_ICOST_H_
|
|
11
|
+
|
|
12
|
+
#include "../Indicator.h"
|
|
13
|
+
|
|
14
|
+
namespace hku {
|
|
15
|
+
|
|
16
|
+
/* COST(k, X) 表示X%获利盘的价格是多少 */
|
|
17
|
+
class ICost : public IndicatorImp {
|
|
18
|
+
INDICATOR_IMP(ICost)
|
|
19
|
+
INDICATOR_NEED_CONTEXT
|
|
20
|
+
INDICATOR_IMP_NO_PRIVATE_MEMBER_SERIALIZATION
|
|
21
|
+
|
|
22
|
+
public:
|
|
23
|
+
ICost();
|
|
24
|
+
ICost(const KData&, double percent);
|
|
25
|
+
virtual ~ICost();
|
|
26
|
+
virtual void _checkParam(const string& name) const override;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
} /* namespace hku */
|
|
30
|
+
|
|
31
|
+
#endif /* INDICATOR_IMP_ICOST_H_ */
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2025 hikyuu.org
|
|
3
|
+
*
|
|
4
|
+
* Created on: 2025-02-10
|
|
5
|
+
* Author: fasiondog
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include "../Indicator.h"
|
|
11
|
+
|
|
12
|
+
namespace hku {
|
|
13
|
+
|
|
14
|
+
/* 获取换手率,等于 VOL(k) / CAPITAL(k) */
|
|
15
|
+
class ICycle : public IndicatorImp {
|
|
16
|
+
INDICATOR_IMP(ICycle)
|
|
17
|
+
INDICATOR_NEED_CONTEXT
|
|
18
|
+
INDICATOR_IMP_NO_PRIVATE_MEMBER_SERIALIZATION
|
|
19
|
+
|
|
20
|
+
public:
|
|
21
|
+
ICycle();
|
|
22
|
+
explicit ICycle(const KData&);
|
|
23
|
+
virtual ~ICycle();
|
|
24
|
+
virtual void _checkParam(const string& name) const override;
|
|
25
|
+
|
|
26
|
+
private:
|
|
27
|
+
void _initParams();
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
} /* namespace hku */
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2025 hikyuu.org
|
|
3
|
+
*
|
|
4
|
+
* Created on: 2025-01-31
|
|
5
|
+
* Author: fasiondog
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
#ifndef INDICATOR_IMP_IDISCARD_H_
|
|
10
|
+
#define INDICATOR_IMP_IDISCARD_H_
|
|
11
|
+
|
|
12
|
+
#include "../Indicator.h"
|
|
13
|
+
|
|
14
|
+
namespace hku {
|
|
15
|
+
|
|
16
|
+
/* 以指标公式的方式设置抛弃值 */
|
|
17
|
+
class IDiscard : public IndicatorImp {
|
|
18
|
+
INDICATOR_IMP(IDiscard)
|
|
19
|
+
INDICATOR_IMP_NO_PRIVATE_MEMBER_SERIALIZATION
|
|
20
|
+
|
|
21
|
+
public:
|
|
22
|
+
IDiscard();
|
|
23
|
+
virtual ~IDiscard();
|
|
24
|
+
virtual void _checkParam(const string& name) const override;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
} /* namespace hku */
|
|
28
|
+
#endif /* INDICATOR_IMP_IDISCARD_H_ */
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
#pragma once
|
|
9
9
|
|
|
10
|
-
#include "../
|
|
10
|
+
#include "../Indicator2InImp.h"
|
|
11
11
|
|
|
12
12
|
namespace hku {
|
|
13
13
|
|
|
@@ -17,31 +17,14 @@ namespace hku {
|
|
|
17
17
|
* 算法:若Y=DMA(X,A) 则 Y=A*X+(1-A)*Y',其中Y'表示上一周期Y值。
|
|
18
18
|
* 例如:DMA(CLOSE,VOL/CAPITAL)表示求以换手率作平滑因子的平均价
|
|
19
19
|
*/
|
|
20
|
-
class IDma : public
|
|
20
|
+
class IDma : public Indicator2InImp {
|
|
21
|
+
INDICATOR2IN_IMP(IDma)
|
|
22
|
+
INDICATOR2IN_IMP_NO_PRIVATE_MEMBER_SERIALIZATION
|
|
23
|
+
|
|
21
24
|
public:
|
|
22
25
|
IDma();
|
|
23
|
-
explicit IDma(const Indicator& ref_a);
|
|
26
|
+
explicit IDma(const Indicator& ref_a, bool fill_null);
|
|
24
27
|
virtual ~IDma();
|
|
25
|
-
|
|
26
|
-
virtual void _checkParam(const string& name) const override;
|
|
27
|
-
virtual void _calculate(const Indicator& data) override;
|
|
28
|
-
virtual IndicatorImpPtr _clone() override;
|
|
29
|
-
|
|
30
|
-
private:
|
|
31
|
-
Indicator m_ref_a;
|
|
32
|
-
|
|
33
|
-
//============================================
|
|
34
|
-
// 序列化支持
|
|
35
|
-
//============================================
|
|
36
|
-
#if HKU_SUPPORT_SERIALIZATION
|
|
37
|
-
private:
|
|
38
|
-
friend class boost::serialization::access;
|
|
39
|
-
template <class Archive>
|
|
40
|
-
void serialize(Archive& ar, const unsigned int version) {
|
|
41
|
-
ar& BOOST_SERIALIZATION_BASE_OBJECT_NVP(IndicatorImp);
|
|
42
|
-
ar& BOOST_SERIALIZATION_NVP(m_ref_a);
|
|
43
|
-
}
|
|
44
|
-
#endif
|
|
45
28
|
};
|
|
46
29
|
|
|
47
|
-
}
|
|
30
|
+
} // namespace hku
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2025 hikyuu.org
|
|
3
|
+
*
|
|
4
|
+
* Created on: 2025-01-22
|
|
5
|
+
* Author: fasiondog
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
#ifndef INDICATOR_IMP_IHSL_H_
|
|
10
|
+
#define INDICATOR_IMP_IHSL_H_
|
|
11
|
+
|
|
12
|
+
#include "../Indicator.h"
|
|
13
|
+
|
|
14
|
+
namespace hku {
|
|
15
|
+
|
|
16
|
+
/* 获取换手率,等于 VOL(k) / CAPITAL(k) */
|
|
17
|
+
class IHsl : public IndicatorImp {
|
|
18
|
+
INDICATOR_IMP(IHsl)
|
|
19
|
+
INDICATOR_NEED_CONTEXT
|
|
20
|
+
INDICATOR_IMP_NO_PRIVATE_MEMBER_SERIALIZATION
|
|
21
|
+
|
|
22
|
+
public:
|
|
23
|
+
IHsl();
|
|
24
|
+
explicit IHsl(const KData&);
|
|
25
|
+
virtual ~IHsl();
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
} /* namespace hku */
|
|
29
|
+
|
|
30
|
+
#endif /* INDICATOR_IMP_IHSL_H_ */
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2025 hikyuu.org
|
|
3
|
+
*
|
|
4
|
+
* Created on: 2025-01-26
|
|
5
|
+
* Author: fasiondog
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
#ifndef INDICATOR_IMP_IINBLOCK_H_
|
|
10
|
+
#define INDICATOR_IMP_IINBLOCK_H_
|
|
11
|
+
|
|
12
|
+
#include "../Indicator.h"
|
|
13
|
+
|
|
14
|
+
namespace hku {
|
|
15
|
+
|
|
16
|
+
/* 已指标形式返回是否在指定板块中 */
|
|
17
|
+
class IInBlock : public IndicatorImp {
|
|
18
|
+
INDICATOR_IMP(IInBlock)
|
|
19
|
+
INDICATOR_NEED_CONTEXT
|
|
20
|
+
INDICATOR_IMP_NO_PRIVATE_MEMBER_SERIALIZATION
|
|
21
|
+
|
|
22
|
+
public:
|
|
23
|
+
IInBlock();
|
|
24
|
+
explicit IInBlock(const KData& kdata, const string& category, const string& name);
|
|
25
|
+
virtual ~IInBlock();
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
} /* namespace hku */
|
|
29
|
+
|
|
30
|
+
#endif /* INDICATOR_IMP_IINBLOCK_H_ */
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2024 hikyuu.org
|
|
3
|
+
*
|
|
4
|
+
* Created on: 2024-09-09
|
|
5
|
+
* Author: fasiondog
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include "../Indicator.h"
|
|
11
|
+
|
|
12
|
+
namespace hku {
|
|
13
|
+
|
|
14
|
+
class IIndex : public IndicatorImp {
|
|
15
|
+
INDICATOR_IMP(IIndex)
|
|
16
|
+
INDICATOR_IMP_NO_PRIVATE_MEMBER_SERIALIZATION
|
|
17
|
+
|
|
18
|
+
public:
|
|
19
|
+
IIndex();
|
|
20
|
+
IIndex(const string& kpart, bool fill_null);
|
|
21
|
+
virtual ~IIndex();
|
|
22
|
+
|
|
23
|
+
virtual void _checkParam(const string& name) const override;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
} // namespace hku
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2025 hikyuu.org
|
|
3
|
+
*
|
|
4
|
+
* Created on: 2025-01-08
|
|
5
|
+
* Author: fasiondog
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
#ifndef INDICATOR_IMP_IISINF_H_
|
|
10
|
+
#define INDICATOR_IMP_IISINF_H_
|
|
11
|
+
|
|
12
|
+
#include "../Indicator.h"
|
|
13
|
+
|
|
14
|
+
namespace hku {
|
|
15
|
+
|
|
16
|
+
class IIsInf : public IndicatorImp {
|
|
17
|
+
INDICATOR_IMP(IIsInf)
|
|
18
|
+
INDICATOR_IMP_NO_PRIVATE_MEMBER_SERIALIZATION
|
|
19
|
+
|
|
20
|
+
public:
|
|
21
|
+
IIsInf();
|
|
22
|
+
virtual ~IIsInf();
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
} /* namespace hku */
|
|
26
|
+
#endif /* INDICATOR_IMP_IISINF_H_ */
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2025 hikyuu.org
|
|
3
|
+
*
|
|
4
|
+
* Created on: 2025-01-08
|
|
5
|
+
* Author: fasiondog
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
#ifndef INDICATOR_IMP_IISINFA_H_
|
|
10
|
+
#define INDICATOR_IMP_IISINFA_H_
|
|
11
|
+
|
|
12
|
+
#include "../Indicator.h"
|
|
13
|
+
|
|
14
|
+
namespace hku {
|
|
15
|
+
|
|
16
|
+
class IIsInfa : public IndicatorImp {
|
|
17
|
+
INDICATOR_IMP(IIsInfa)
|
|
18
|
+
INDICATOR_IMP_NO_PRIVATE_MEMBER_SERIALIZATION
|
|
19
|
+
|
|
20
|
+
public:
|
|
21
|
+
IIsInfa();
|
|
22
|
+
virtual ~IIsInfa();
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
} /* namespace hku */
|
|
26
|
+
#endif /* INDICATOR_IMP_IISINFA_H_ */
|