mirror of
https://gitee.com/fasiondog/hikyuu.git
synced 2024-12-02 11:58:21 +08:00
release 1.1.1
This commit is contained in:
parent
df6ae00d23
commit
3f94f9b5e0
@ -205,6 +205,24 @@
|
||||
* result(2): DEA: 慢线,即快线的n3周期EMA平滑
|
||||
|
||||
|
||||
.. py:function:: MAX(ind1, ind2)
|
||||
|
||||
求最大值, MAX(A,B)返回A和B中的较大值。
|
||||
|
||||
:param Indicator ind1: A
|
||||
:param Indicator ind2: B
|
||||
:rtype: Indicator
|
||||
|
||||
|
||||
.. py:function:: MIN(ind1, ind2)
|
||||
|
||||
求最小值, MIN(A,B)返回A和B中的较小值。
|
||||
|
||||
:param Indicator ind1: A
|
||||
:param Indicator ind2: B
|
||||
:rtype: Indicator
|
||||
|
||||
|
||||
.. py:function:: NOT([data])
|
||||
|
||||
求逻辑非。NOT(X)返回非X,即当X=0时返回1,否则返回0。
|
||||
|
@ -6,7 +6,7 @@
|
||||
|
||||
1. HikyuuTDX 新增当前财务信息及历史财务信息下载
|
||||
2. Stock 新增 getFinanceInfo、getHistoryFinanceInfo 支持当前及历史财务信息
|
||||
3. 新增 LIUTONGPAN(流通盘)、HSL(换手率)、COUNT、IF、SUM、NOT、EXP、SGN、ABS指标
|
||||
3. 新增 LIUTONGPAN(流通盘)、HSL(换手率)、COUNT、IF、SUM、NOT、EXP、SGN、ABS、MAX、MIN指标
|
||||
4. Kdata添加便捷方法获取OPEN/CLOSE等基本行情数据,如::
|
||||
|
||||
k = sm['sh000001'].getKData(Query(-100))
|
||||
@ -33,7 +33,7 @@
|
||||
C = CLOSE()
|
||||
H = HIGH()
|
||||
L = LOW()
|
||||
MTR =SUM(H-L > ABS(H - REF(C,1) > ABS(REF(C,1) - L)),N);
|
||||
MTR = SUM(MAX(MAX(H-L,ABS(H-REF(C,1))),ABS(REF(C,1)-L)),N);
|
||||
HD = H-REF(H,1)
|
||||
LD = REF(L,1)-L
|
||||
DMP = SUM(IF(HD>0 & HD>LD, HD, 0), N)
|
||||
|
@ -261,6 +261,28 @@ MACD([data, n1=12, n2=26, n3=9])
|
||||
"""
|
||||
|
||||
|
||||
MAX.__doc__ = """
|
||||
MAX(ind1, ind2)
|
||||
|
||||
求最大值, MAX(A,B)返回A和B中的较大值。
|
||||
|
||||
:param Indicator ind1: A
|
||||
:param Indicator ind2: B
|
||||
:rtype: Indicator
|
||||
"""
|
||||
|
||||
|
||||
MIN.__doc__ = """
|
||||
MIN(ind1, ind2)
|
||||
|
||||
求最小值, MIN(A,B)返回A和B中的较小值。
|
||||
|
||||
:param Indicator ind1: A
|
||||
:param Indicator ind2: B
|
||||
:rtype: Indicator
|
||||
"""
|
||||
|
||||
|
||||
NOT.__doc__ = """
|
||||
NOT([data])
|
||||
|
||||
|
@ -24,6 +24,8 @@
|
||||
#include "crt/LIUTONGPAN.h"
|
||||
#include "crt/MA.h"
|
||||
#include "crt/MACD.h"
|
||||
#include "crt/MAX.h"
|
||||
#include "crt/MIN.h"
|
||||
#include "crt/NOT.h"
|
||||
#include "crt/POS.h"
|
||||
#include "crt/PRICELIST.h"
|
||||
|
40
hikyuu_cpp/hikyuu/indicator/crt/MAX.h
Normal file
40
hikyuu_cpp/hikyuu/indicator/crt/MAX.h
Normal file
@ -0,0 +1,40 @@
|
||||
/*
|
||||
* MAX.h
|
||||
*
|
||||
* Created on: 2019年4月8日
|
||||
* Author: fasiondog
|
||||
*/
|
||||
|
||||
#ifndef INDICATOR_CRT_MAX_H_
|
||||
#define INDICATOR_CRT_MAX_H_
|
||||
|
||||
#include "CVAL.h"
|
||||
|
||||
namespace hku {
|
||||
|
||||
Indicator MAX(const Indicator&, const Indicator&);
|
||||
Indicator MAX(const Indicator&, price_t val);
|
||||
Indicator MAX(price_t val, const Indicator& ind);
|
||||
|
||||
inline Indicator MAX(const Indicator& ind1, const Indicator& ind2) {
|
||||
Indicator result = IF(ind1 > ind2, ind1, ind2);
|
||||
result.name("MAX");
|
||||
return result;
|
||||
}
|
||||
|
||||
inline Indicator MAX(const Indicator& ind, price_t val) {
|
||||
Indicator result = IF(ind > val, ind, val);
|
||||
result.name("MAX");
|
||||
return result;
|
||||
}
|
||||
|
||||
inline Indicator MAX(price_t val, const Indicator& ind) {
|
||||
Indicator result = IF(val > ind, val, ind);
|
||||
result.name("MAX");
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
#endif /* INDICATOR_CRT_MAX_H_ */
|
40
hikyuu_cpp/hikyuu/indicator/crt/MIN.h
Normal file
40
hikyuu_cpp/hikyuu/indicator/crt/MIN.h
Normal file
@ -0,0 +1,40 @@
|
||||
/*
|
||||
* MIN.h
|
||||
*
|
||||
* Created on: 2019年4月8日
|
||||
* Author: fasiondog
|
||||
*/
|
||||
|
||||
#ifndef INDICATOR_CRT_MIN_H_
|
||||
#define INDICATOR_CRT_MIN_H_
|
||||
|
||||
#include "CVAL.h"
|
||||
|
||||
namespace hku {
|
||||
|
||||
Indicator MIN(const Indicator&, const Indicator&);
|
||||
Indicator MIN(const Indicator&, price_t val);
|
||||
Indicator MIN(price_t val, const Indicator& ind);
|
||||
|
||||
inline Indicator MIN(const Indicator& ind1, const Indicator& ind2) {
|
||||
Indicator result = IF(ind1 < ind2, ind1, ind2);
|
||||
result.name("MIN");
|
||||
return result;
|
||||
}
|
||||
|
||||
inline Indicator MIN(const Indicator& ind, price_t val) {
|
||||
Indicator result = IF(ind < val, ind, val);
|
||||
result.name("MIN");
|
||||
return result;
|
||||
}
|
||||
|
||||
inline Indicator MIN(price_t val, const Indicator& ind) {
|
||||
Indicator result = IF(val < ind, val, ind);
|
||||
result.name("MIN");
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
#endif /* INDICATOR_CRT_MIN_H_ */
|
@ -117,6 +117,13 @@ Indicator (*SGN_2)(const Indicator&) = SGN;
|
||||
Indicator (*EXP_1)() = EXP;
|
||||
Indicator (*EXP_2)(const Indicator&) = EXP;
|
||||
|
||||
Indicator (*MAX_1)(const Indicator&, const Indicator&) = MAX;
|
||||
Indicator (*MAX_2)(const Indicator&, price_t) = MAX;
|
||||
Indicator (*MAX_3)(price_t, const Indicator&) = MAX;
|
||||
|
||||
Indicator (*MIN_1)(const Indicator&, const Indicator&) = MIN;
|
||||
Indicator (*MIN_2)(const Indicator&, price_t) = MIN;
|
||||
Indicator (*MIN_3)(price_t, const Indicator&) = MIN;
|
||||
|
||||
void export_Indicator_build_in() {
|
||||
def("KDATA", KDATA1);
|
||||
@ -217,6 +224,14 @@ void export_Indicator_build_in() {
|
||||
|
||||
def("EXP", EXP_1);
|
||||
def("EXP", EXP_2);
|
||||
|
||||
def("MAX", MAX_1);
|
||||
def("MAX", MAX_2);
|
||||
def("MAX", MAX_3);
|
||||
|
||||
def("MIN", MIN_1);
|
||||
def("MIN", MIN_2);
|
||||
def("MIN", MIN_3);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user