hikyuu2/hikyuu/indicator/indicator_doc.py
2019-04-30 23:20:16 +08:00

566 lines
12 KiB
C++
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/usr/bin/python
# -*- coding: utf8 -*-
# cp936
#
# The MIT License (MIT)
#
# Copyright (c) 2017 fasiondog
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
from .indicator import *
ABS.__doc__ = """
ABS([data])
:param Indicator data:
:rtype: Indicator
"""
AMA.__doc__ = """
AMA([data, n=10, fast_n=2, slow_n=30])
.J Perry J.Kaufman [BOOK1]_
:param Indicator data:
:param int n: 2
:param int fast_n: N
:param int slow_n: EMA线的N值
:return: Indicator
* result(0): AMA
* result(1): ER
"""
IAMO.__doc__ = """
IAMO([data])
KData的成交金额成Indicator
:param data: KData Indicator
:return: Indicator
"""
ICLOSE.__doc__ = """
ICLOSE([data])
KData的收盘价成Indicator
:param data: KData Indicator
:return: Indicator
"""
COUNT.__doc__ = """
COUNT([data, n=20])
COUNT(X,N),N周期中满足X条件的周期数,N=0
COUNT(CLOSE>OPEN,20)20
:param Indicator data:
:param int n:
:rtype: Indicator
"""
CVAL.__doc__ = """
CVAL([data, value=0.0, discard=0])
data Indicator data valuediscard和data一样
:param Indicator data: Indicator实例
:param float value:
:param int len:
:param int discard:
:return: Indicator
"""
DIFF.__doc__ = """
DIFF([data])
data[i] - data[i-1]
:param Indicator data:
:return: Indicator
"""
EMA.__doc__ = """
EMA([data, n=22])
线(Exponential Moving Average)
:param Indicator data:
:param int n: 0
:return: Indicator
"""
EVERY.__doc__ = """
EVERY([data, n=20])
EVERY (X,N) X在N周期一直存在
EVERY(CLOSE>OPEN,10) 10线
:param data:
:param int n: 0
:rtype: Indicator
"""
EXIST.__doc__ = """
, EXIST(X,N) X在N周期有存在
:param data:
:param int n: 0
:rtype: Indicator
"""
EXP.__doc__ = """
EXP([data])
EXP(X)e的X次幂
:param Indicator data:
:rtype: Indicator
"""
HHV.__doc__ = """
HHV([data, n=20])
N日内最高价, N=0
:param Indicator data:
:param int n: N日时间窗口
:return: Indicator
"""
HHVBARS.__doc__ = """
HHVBARS([data, n=20])
HHVBARS(X,N):N周期内X最高值到当前周期数N=0
HHVBARS(HIGH,0)
:param Indicator data:
:param int n: N日时间窗口
:rtype: Indicator
"""
IHIGH.__doc__ = """
IHIGH([data])
KData的最高价成Indicator
:param data: KData Indicator
:return: Indicator
"""
HSL.__doc__ = """
HSL(kdata)
VOL(k) / CAPITAL(k)
:param KData kdata: k线数据
:rtype: Indicator
"""
IF.__doc__ = """
IF(x, a, b)
,
IF(X,A,B)X不为0则返回A,B
IF(CLOSE>OPEN,HIGH,LOW),
:param Indicator x:
:param Indicator a: a
:param Indicator b: b
:rtype: Indicator
"""
INTPART.__doc__ = """
INTPART([data])
()
:param data:
:rtype: Indicator
"""
IKDATA.__doc__ = """
IKDATA([data])
KData成Indicator
:param data: KData 6IndicatorKDATA生成的Indicator
:return: Indicator
"""
KDATA_PART.__doc__ = """
KDATA_PART([data, kpart])
KDATA/OPEN/HIGH/LOW/CLOSE/AMO/VOL:KDATA_PART("CLOSE")CLOSE()
:param data: KData Indicator
:param string kpart: KDATA|OPEN|HIGH|LOW|CLOSE|AMO|VOL
:return: Indicator
"""
CAPITAL = LIUTONGPAN
LIUTONGPAN.__doc__ = """
LIUTONGPAN(kdata)
:param KData kdata: k线数据
:rtype: Indicator
"""
LAST.__doc__ = """
LAST([data, m=10, n=5])
LAST (X,M,N) X M N
LAST(CLOSE>OPEN,10,5) 105线
:param data:
:param int m: m周期
:param int n: n周期
:rtype: Indicator
"""
LLV.__doc__ = """
LLV([data, n=20])
N日内最低价, N=0
:param data:
:param int n: N日时间窗口
:return: Indicator
"""
LN.__doc__ = """
LN([data])
, LN(X)e为底的对数
:param data:
:rtype: Indicator
"""
LOG.__doc__ = """
LOG([data])
10
:param data:
:rtype: Indicator
"""
ILOW.__doc__ = """
ILOW([data])
KData的最低价成Indicator
:param data: KData Indicator
:return: Indicator
"""
MA.__doc__ = """
MA([data, n=22, type="SMA"])
:param Indicator data:
:param int n:
:param string type: "EMA"|"SMA"|"AMA"
:return: Indicator
"""
MACD.__doc__ = """
MACD([data, n1=12, n2=26, n3=9])
线
:param Indicator data:
:param int n1: EMA时间窗
:param int n2: EMA时间窗
:param int n3: EMA-EMAEMA平滑时间窗
:return: Indicator
* result(0): MACD_BARMACD直柱MACD快线MACD慢线
* result(1): DIFF: 线,EMA-EMA
* result(2): DEA: 线线n3周期EMA平滑
"""
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])
NOT(X)X,X=010
:param Indicator data:
:rtype: Indicator
"""
IOPEN.__doc__ = """
IOPEN([data])
KData的开盘价成Indicator
:param data: KData Indicator
:return: Indicator
"""
POW.__doc__ = """
POW(data, n)
POW(A,B)A的B次幂
POW(CLOSE,3)3
:param data:
:param int n:
:rtype: Indicator
"""
REF.__doc__ = """
REF([data, n])
REF(XA) A周期前的X值
:param Indicator data:
:param int n: n周期前的值n位
:return: Indicator
"""
ROUND.__doc__ = """
ROUND([data, ndigits=2])
:param data:
:param int ndigits:
:rtype: Indicator
"""
ROUNDDOWN.__doc__ = """
ROUNDDOWN([data, ndigits=2])
10.110
:param data:
:param int ndigits:
:rtype: Indicator
"""
ROUNDUP.__doc__ = """
ROUNDUP([data, ndigits=2])
10.111
:param data:
:param int ndigits:
:rtype: Indicator
"""
SAFTYLOSS.__doc__ = """
SAFTYLOSS([data, n1=10, n2=3, p=2.0])
线 [BOOK2]_
1020穿穿线线N日3
:param Indicator data:
:param int n1:
:param int n2: 线n2日内的最高值
:param float p:
:return: Indicator
"""
SGN.__doc__ = """
SGN([data])
, SGN(X) X>0, X=0, X<0 1, 0, -1
:param Indicator data:
:rtype: Indicator
"""
SMA.__doc__ = """
SMA([data, n=22])
线
:param Indicator data:
:param int n:
:return: Indicator
"""
SQRT.__doc__ = """
SQRT([data])
SQRT(X)X的平方根
SQRT(CLOSE)
:param data:
:rtype: Indicator
"""
STD = STDEV
STDEV.__doc__ = """
STDEV([data, n=10])
N周期内样本标准差
:param Indicator data:
:param int n:
:return: Indicator
"""
STDP.__doc__ = """
STDP([data, n=10])
STDP(X,N)X的N日总体标准差
:param data:
:param int n:
:rtype: Indicator
"""
SUM.__doc__ = """
SUM([data, n=20])
SUM(X,N),N周期中X的总和,N=0
:param Indicator data:
:param int n:
:rtype: Indicator
"""
VIGOR.__doc__ = """
VIGOR([kdata, n=2])
. [BOOK2]_
:param KData data:
:param int n: EMA平滑窗口
:return: Indicator
"""
IVOL.__doc__ = """
IVOL([data])
KData的成交量成Indicator
:param data: KData Indicator
:return: Indicator
"""
WEAVE.__doc__ = """
WEAVE(ind1, ind2)
ind1和ind2的结果组合在一起放在一个Indicator中ind = WEAVE(ind1, ind2), ind包含多个结果ind1ind2的顺序存放
:param Indicator ind1: 1
:param Indicator ind2: 2
:rtype: Indicator
"""