通达信zig函数的python实现

本文介绍了如何使用Python实现通达信ZIG转向点函数,详细展示了代码实现过程,以及计算得到的转向点数值和对应的日期,为金融数据分析提供了一种工具。

通达信zig函数的python实现

代码


# coding: utf-8 
"""
Created on Sat Jan 05 18:53:39 2019
http://www.pianshen.com/article/363258879/
@author: duanqs
"""

import numpy as np
import tushare as ts

import matplotlib.pyplot as plt
 
ZIG_STATE_START = 0
ZIG_STATE_RISE = 1
ZIG_STATE_FALL = 2
 
 
def zig(x=0.055):
    #ts.set_token("此处放入tushare的token!!!")
    #pro = ts.pro_api()
    #df = pro.daily(ts_code="603297.SH")
    # print(list(df["close"]))
    # df = ts.get_hist_data('000069')
    # df = df[::-1]
    # 获取股票交易数据的Tushare的使用方法 - 蜗牛爬行ing - 博客园  
    # https://www.cnblogs.com/DreamRJF/p/8660630.html
    # posted on 2018-03-28 15:18 蜗牛爬行ing 
    
    #df = ts.get_k_data('000069')
    # df = ts.get_k_data('600535')
    # df = ts.get_k_data('512040')  # 富国国信价值 etf 基金
    # df = ts.get_h_data('000051', index=True)   # 上证180等权指数 index 参数必须指定为T
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值