我想使用ta lib的以下函数。在
我想理解periods
的含义。
MAVP
MAVP([input_arrays], [minperiod=2], [maxperiod=30], [matype=0])
Moving average with variable period (Overlap Studies)
Inputs:
price: (any ndarray) periods: (any ndarray)
Parameters:
minperiod: 2 maxperiod: 30 matype: 0 (Simple Moving Average)
Outputs:
real
当periods
的长度与price
的长度不同时,它将返回一个错误(另外:如果{
原始文件: https://mrjbq7.github.io/ta-lib/func_groups/overlap_studies.html
参考一些(自动生成的)文档: https://www.backtrader.com/docu/talibindautoref.html
编辑: 下面是基本的c代码: http://svn.code.sf.net/p/ta-lib/code/trunk/ta-lib/c/src/ta_func/ta_MAVP.c
如https://github.com/mrjbq7/ta-lib/issues/175#issuecomment-356042378所示:
这就是函数的作用。 它得到一个输入价格数组和一个长度相同的periods数组。 输出价格数组是在该点使用指定期间的移动平均值。 所以,如果你有一个数组[1,5,3,8]并且你指定了句点[2,3,3,2],那么输出将是:
除了它在前面放上nan的maxperiods数之外,出于某种原因,您需要将其称为:
^{pr2}$相关问题 更多 >
编程相关推荐