塔利布:在MAVP(可变周期移动平均)中,周期的概念是什么?

2024-10-17 08:18:24 发布

您现在位置:Python中文网/ 问答频道 /正文

我想使用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的长度不同时,它将返回一个错误(另外:如果{}是>;=0且<;=8,则返回一个nparray,否则将引发错误)。在

原始文件: 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


Tags: httpsgithublib错误anypricendarrayta
1条回答
网友
1楼 · 发布于 2024-10-17 08:18:24

https://github.com/mrjbq7/ta-lib/issues/175#issuecomment-356042378所示:

这就是函数的作用。 它得到一个输入价格数组和一个长度相同的periods数组。 输出价格数组是在该点使用指定期间的移动平均值。 所以,如果你有一个数组[1,5,3,8]并且你指定了句点[2,3,3,2],那么输出将是:

[SMA(2)[0], SMA(3)[1], SMA(3)[2], SMA(2)[3]]

除了它在前面放上nan的maxperiods数之外,出于某种原因,您需要将其称为:

^{pr2}$

相关问题 更多 >