本文主要是介绍tushare根据日k线选股,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
积分不通,token权限不同,5000积分,所有权限全开
注册tushare,请点击链接:https://tushare.pro/register?reg=301280
根据前复权k线,选取短线股票
选股思路,根据当天收盘价格,10日内新高,并且收盘价格比10日内最高价回撤3%-13%,且在均线之上,筛选出满足上述条件的股票
import tushare as ts
import datetime
now=datetime.date.today()
start_day = (now-datetime.timedelta(days=90)).strftime('%Y%m%d')
end_day =now.strftime('%Y%m%d')
output = open('日k线' + end_day + '.xls','a',encoding='utf-8')
output.write('ts_code\t name\t max\t now_price\t percent\n')
ts.set_token('yourtoken')
def xunhuan():pro = ts.pro_api()dt = pro.stock_basic(exchange='', list_status='L', fields='ts_code,symbol,name,area,industry,list_date')# 获取股票列表code = dt['ts_code']name = dt['name']# long = len(code)for i in ra
这篇关于tushare根据日k线选股的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!