【问题标题】:how talib is detecting patterns?talib 如何检测模式?
【发布时间】:2020-01-15 05:56:33
【问题描述】:
sample_data = [
    ['1/22/14', 10, 18, 5, 20],
    ['1/23/14', 12, 21, 7, 22],
    ['1/24/14', 14, 24, 9, 24],
    ['1/25/14', 16, 27, 11, 26],
    ['1/26/14', 18, 30, 13, 28],
    ['1/27/14', 20, 33, 15, 30],
    ['1/28/14', 22, 36, 17, 32],
    ['1/29/14', 24, 39, 19, 34],
    ['1/30/14', 26, 41, 21, 38],
    ['1/31/14', 30, 45, 25, 30],
    ['2/03/14', 241.75, 243.15, 240.65, 241.80],
    ['1/31/14', 30, 45, 25, 30],
]

# convert data to columns
sample_data = np.column_stack(sample_data)

# extract the columns we need, making sure to make them 64-bit floats
o = sample_data[1].astype(float)
h = sample_data[2].astype(float)
l = sample_data[3].astype(float)
c = sample_data[4].astype(float)

print(talib.CDLDOJI(o, h, l, c))

输出为:[0 0 0 0 0 0 0 0 0 0 100 100]

但是如果您查看最后一个数据和倒数第三个数据是相同的,但它仍然没有检测到它,我注意到它仅在 10 根蜡烛过去后才开始检测模式是正确的,或者我错过了一些东西。

【问题讨论】:

    标签: python ta-lib


    【解决方案1】:

    根据代码:

    /* 真实的身体就像十字星的身体,当它短于 10% 时 10 上一个蜡烛的高低范围的平均值 */

    如果检测到蜡烛,函数会返回 0 或 100。 所以前 10 个值必须为 0。

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-07-27
    • 1970-01-01
    • 1970-01-01
    • 2015-01-27
    • 2013-01-23
    • 2019-10-17
    • 1970-01-01
    相关资源
    最近更新 更多