赞
踩
import os
nZhangTing=0
for root,dirs,files in os.walk(r"..\\txt"):
for file in files:
##strCode=os.path.join(root,file)[-10:-4]
#if(strCode!="000661"):
# continue
date1=""
nStart1=0#第一天开盘价
nEnd1=0#最后一天收盘价
nUpDay=0
nDownDay=0
nTotalDay=0
nTotalMin=999
nTotalMax=0
strMinDate=""
nOldEnd=0
arrLine=[]
for line in open(os.path.join(root,file)):
if(line.find("日线")>0):
arrHead=line.split(" ")
if len(arrHead)>1:
strCode=arrHead[0]
strName=arrHead[1]
arr=line.split(",")
if len(arr)>1:
nTotalDay=nTotalDay+1
nYear=int(line[0:4])
strDate=arr[0]
if(date1==""):
date1=arr[0]
nStart=float(arr[1])#开盘
if(nStart1==0):
nStart1=nStart
nMax=float(arr[2])#最高
nMin=float(arr[3])#最低
nEnd=float(arr[4])#收盘
arr=[nStart,nEnd,nMin,nMax]
arrLine.append(arr)
#涨停板
if( round(nOldEnd*1.1,2)<=nEnd):
bZhangTing=True
else:
bZhangTing=False
nOldEnd=nEnd
if(bZhangTing):
nZhangTing=nZhangTing+1
with open("今日涨停板.txt","a") as file1:
file1.write(os.path.join(root,file)[-10:-4])
file1.write(strName)
file1.write("\n")
with open("今日涨停板.txt","a") as file1:
file1.write("今日涨停股票数量:"+str(nZhangTing))
file1.write("\n")
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。