当前位置:首页 » 科技股票 » python股票历史最低点

python股票历史最低点

发布时间: 2025-03-26 18:29:59

1. 如何用python代码判断一段范围内股票最高点

Copyright © 1999-2020, CSDN.NET, All Rights Reserved




登录

python+聚宽 统计A股市场个股在某时间段的最高价、最低价及其时间 原创
2019-10-12 09:20:50

开拖拉机的大宝

码龄4年

关注
使用工具pycharm + 聚宽数据源,统计A股市场个股在某时间段的最高价、最低价及其时间,并打印excel表格输出

from jqdatasdk import *
import pandas as pd
import logging
import sys
logger = logging.getLogger("logger")
logger.setLevel(logging.INFO)

# 聚宽数据账户名和密码设置
auth('username','password')

#获取A股列表,包括代号,名称,上市退市时间等。
security = get_all_securities(types=[], date=None)
pd2 = get_all_securities(['stock'])

# 获取股票代号
stocks = list(get_all_securities(['stock']).index)

# 获取股票名称
stocknames = pd2['display_name']

start_date = '2015-01-01'
end_date = '2018-12-31'
def get_stocks_high_low(start_date,end_date):
# 新建表,表头列
# 为:"idx","stockcode","stockname","maxvalue","maxtime","lowvalue","lowtime"
result = pd.DataFrame(columns=["idx", "stockcode", "stockname", "maxvalue", "maxtime", "lowvalue", "lowtime"])
for i in range(0,stocks.__len__()-1):
pd01 = get_price(stocks[i], start_date, end_date, frequency='daily',
fields=None, skip_paused=False,fq='pre', count=None)
result=result.append(pd.DataFrame({'idx':[i],'stockcode':[stocks[i]],'stockname':
[stocknames[i]],'maxvalue':[pd01['high'].max()],'maxtime':
[pd01['high'].idxmax()],'lowvalue': [pd01['low'].min()], 'lowtime':
[pd01['low'].idxmin()]}),ignore_index=True)

result.to_csv("stock_max_min.csv",encoding = 'utf-8', index = True)
logger.warning("执行完毕!

热点内容
上外金融专硕学费多少 发布:2025-07-16 02:54:43 浏览:445
麒盛科技市值多少 发布:2025-07-16 02:29:50 浏览:139
如何寻找创投基金 发布:2025-07-16 02:29:14 浏览:140
仁东控股市盈率最高是多少 发布:2025-07-16 02:29:09 浏览:104
广州汽车板块基金有多少家 发布:2025-07-16 02:26:23 浏览:894
铁岭如意湖金融会馆在哪个区 发布:2025-07-16 02:26:21 浏览:770
退市股票确权和托管什么意思 发布:2025-07-16 01:42:02 浏览:26
大知慧基金哪里找 发布:2025-07-16 01:24:09 浏览:787
武钢集团股票600005历史成交 发布:2025-07-16 01:05:58 浏览:266
股权出质对质权人有什么要求 发布:2025-07-16 01:05:04 浏览:29