hikyuu2/hikyuu/indicator/indicator_doc.py
2019-05-18 21:52:55 +08:00

950 lines
19 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
"""
ACOS.__doc__ = """
ACOS([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
"""
ASIN.__doc__ = """
ASIN([data])
:param Indicator data:
:rtype: Indicator
"""
ATAN.__doc__ = """
ATAN([data])
:param Indicator data:
:rtype: Indicator
"""
AVEDEV.__doc__ = """
AVEDEV(data[, n=22])
X的N日平均绝对偏差
:param Indicator data:
:param int n:
:rtype: Indicator
"""
BACKSET.__doc__ = """
BACKSET([data, n=2])
1
BACKSET(X,N),X非0,N周期前的数值设为1
BACKSET(CLOSE>OPEN,2)1,0
:param Indicator data:
:param int n: N周期
:rtype: Indicator
"""
BARSCOUNT.__doc__ = """
BARSCOUNT([data])
,
BARSCOUNT(X)
BARSCOUNT(CLOSE)线1线
:param Indicator data:
:rtype: Indicator
"""
BARSLAST.__doc__ = """
BARSSINCE([data])
BARSLAST(X): X 0
BARSLAST(CLOSE/REF(CLOSE,1)>=1.1)
:param Indicator data:
:rtype: Indicator
"""
BARSSINCE.__doc__ = """
BARSSINCE([data])
BARSSINCE(X):X不为0到现在的天数
BARSSINCE(HIGH>10)10
:param Indicator data:
:rtype: Indicator
"""
BETWEEN.__doc__ = """
BETWEEN(a, b, c)
()
BETWEEN(A,B,C)A处于B和C之间时返回10
BETWEEN(CLOSE,MA(CLOSE,10),MA(CLOSE,5))5线10线
:param Indicator a: A
:param Indicator b: B
:param Indicator c: C
:rtype: Indicator
"""
ICLOSE.__doc__ = """
ICLOSE([data])
KData的收盘价成Indicator
:param data: KData Indicator
:return: Indicator
"""
COS.__doc__ = """
COS([data])
:param Indicator data:
:rtype: 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
"""
CROSS.__doc__ = """
CROSS(x, y)
:param x: 线
:param y: 线
: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
"""
DEVSQ.__doc__ = """
DEVSQ([data, n=10])
X的N日数据偏差平方和
:param Indicator data:
:param int n:
:rtype: Indicator
"""
DIFF.__doc__ = """
DIFF([data])
data[i] - data[i-1]
:param Indicator data:
:return: Indicator
"""
DMA.__doc__ = """
DIFF(ind, a)
DMA(X,A),X的动态移动平均
Y=DMA(X,A) Y=A*X+(1-A)*Y',Y'Y值
DMA(CLOSE,VOL/CAPITAL)
:param Indicator ind:
:param Indicator a:
:rtype: Indicator
"""
DOWNNDAY.__doc__ = """
DOWNNDAY(data[, n=3])
, DOWNNDAY(CLOSE,M)M个周期
:param Indicator data:
:param int n:
:rtype: 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
"""
FILTER.__doc__ = """
FILTER([data, n=5])
,
FILTER(X,N): X N 0
FILTER(CLOSE>OPEN,5) 线5 线
:param Indicator data:
:param int n:
:rtype: Indicator
"""
FLOOR.__doc__ = """
FLOOR([data])
()
FLOOR(A)沿A数值减小方向最接近的整数
FLOOR(12.3)12
:param 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
"""
LONGCROSS.__doc__ = """
LONGCROSS(a, b[, n=3])
线
LONGCROSS(A,B,N)A在N周期内都小于B穿B时返 10
LONGCROSS(MA(CLOSE,5),MA(CLOSE,10),5)5线510线
:param Indicator a:
:param Indicator b:
:param int n:
:rtype: Indicator
"""
ILOW.__doc__ = """
ILOW([data])
KData的最低价成Indicator
:param data: KData Indicator
:return: Indicator
"""
MA.__doc__ = """
MA([data, n=22])
:param Indicator data:
:param int n:
:rtype: 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
"""
MOD.__doc__ = """
MOD(ind1, ind2)
使 %
MOD(A,B)A对B求模
MOD(26,10) 6
:param Indicator ind1:
:param Indicator ind2:
:rtype: Indicator
"""
NDAY.__doc__ = """
NDAY(x, y[, n=3])
, NDAY(X,Y,N)X>Y持续存在N个周期
:param Indicator x:
:param Indicator y:
:param int n:
: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
"""
REVERSE.__doc__ = """
REVERSE([data])
REVERSE(X)-X
:param Indicator data:
:rtype: Indicator
"""
ROC.__doc__ = """
ROC([data, n=10])
: ((price / prevPrice)-1)*100
:param data:
:param int n:
:rtype: Indicator
"""
ROCP.__doc__ = """
ROCP([data, n=10])
: (price - prevPrice) / prevPrice
:param data:
:param int n:
:rtype: Indicator
"""
ROCR.__doc__ = """
ROCR([data, n=10])
: (price / prevPrice)
:param data:
:param int n:
:rtype: Indicator
"""
ROCR100.__doc__ = """
ROCR([data, n=10])
: (price / prevPrice) * 100
:param data:
:param int n:
:rtype: 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
"""
SIN.__doc__ = """
SIN([data])
:param Indicator data:
:rtype: 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, m=2])
Y=SMA(X,N,M) Y=[M*X+(N-M)*Y')/N,Y'Y值
:param Indicator data:
:param int n:
:param float m:
:rtype: 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
"""
SUMBARS.__doc__ = """
SUMBARS([data,] a)
,
SUMBARS(X,A):X向前累加直到大于等于A,
SUMBARS(VOL,CAPITAL)
:param Indicator data:
:param float a:
:rtype: Indicator
"""
TAN.__doc__ = """
TAN([data])
:param Indicator data:
:rtype: Indicator
"""
TIMELINE.__doc__ = """
TIMELINE([k])
:param KData k:
:rtype: Indicator
"""
TIMELINEVOL.__doc__ = """
TIMELINEVOL([k])
:param KData k:
:rtype: Indicator
"""
UPNDAY.__doc__ = """
UPNDAY(data[, n=3])
, UPNDAY(CLOSE,M)M个周期
:param Indicator data:
:param int n:
:rtype: Indicator
"""
VAR.__doc__ = """
VAR([data, n=2])
, VAR(X,N)X的N日估算样本方差
:param Indicator data:
:param int n:
:rtype: Indicator
"""
VARP.__doc__ = """
VARP([data, n=2])
, VARP(X,N)X的N日总体样本方差
: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
"""