Python 量化(二)分析股票涨停前的换手率之和
有这样一种股票,沉寂好久突然拉涨停,一飞冲天,但是不禁要问,好久要等到多久才能起飞.如下图.
我分析了十一只涨停股票,统计了涨停前的换手率之和.如下
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Apr 13 21:32:25 2018
@author: luogan
"""
import tushare as ts
#this example is very special
import matplotlib.pyplot as plt
def potential_vocanol(name,sta,ed):
#name='600354'
df=ts.get_hist_data(name,start=sta,end=ed)
a=df['turnover'].sum()
print(name,int(a))
return a
name='600354'
b1=potential_vocanol(name,'2017-11-14','2018-02-14')
#b2=potential_vocanol(name,'2018-02-14','2018-04-13')
#this stock will grow up again
name='600354'
c1=potential_vocanol(name,'2018-02-06','2018-04-09')
#c2=potential_vocanol(name,'2018-04-09','2018-04-13')
name='600778'
d1=potential_vocanol(name,'2017-04-18','2018-04-10')
#d2=potential_vocanol(name,'2018-04-11','2018-04-13')
name='300621'
e1=potential_vocanol(name,'2018-01-30','2018-04-09')
#e2=potential_vocanol(name,'2018-04-10','2018-04-13')
name='600778'
f1=potential_vocanol(name,'2017-10-19','2018-04-10')
#f2=potential_vocanol(name,'2018-04-11','2018-04-13')
name='600973'
g1=potential_vocanol(name,'2017-10-31','2018-04-10')
#g2=potential_vocanol(name,'2018-04-11','2018-04-13')
name='600973'
h1=potential_vocanol(name,'2017-08-04','2018-04-11')
#h2=potential_vocanol(name,'2018-04-12','2018-04-13')
name='600590'
i1=potential_vocanol(name,'2017-08-04','2018-02-11')
#i2=potential_vocanol(name,'2018-02-12','2018-04-13')
name='002771'
j1=potential_vocanol(name,'2017-10-12','2018-02-14')
#j2=potential_vocanol(name,'2018-02-15','2018-04-13')
name='600397'
k1=potential_vocanol(name,'2017-05-03','2017-12-28')
#k2=potential_vocanol(name,'2017-12-28','2018-04-14')
600354 146
600354 272
600778 199
300621 192
600778 78
600973 45
600973 103
600590 159
002771 150
600397 185
从结果上看,涨停前的换手率之和在150~200是潜力无限的股票