请 [注册] 或 [登录]  | 返回主站

量化交易吧 /  量化平台 帖子:3365108 新帖:25

分时走势的黄线

美联储主席发表于:10 月 4 日 23:54回复(1)
df1=get_price('600779.XSHG',end_date='2018-05-19', frequency='1m', fields='avg', skip_paused=False, fq='none', count=240)
df2=get_price('600779.XSHG',end_date='2018-05-19', frequency='1m', fields=['volume','money'], skip_paused=False, fq='none', count=240)
import pandas as pd
series1=df1['avg']
series2=df2['money']/df2['volume']
avg_df=pd.DataFrame({'avg1':series1[:-1],'avg2':series2[:-1]})
avg_df = avg_df.reset_index(drop=True)
avg_df = avg_df.cumsum().apply(lambda x: x/(avg_df.index+1.0))
# avg_df['走势']=df1['avg'].values[:-1]
avg_df.plot()
<matplotlib.axes._subplots.AxesSubplot at 0x7f84843d1e90>
 

全部回复

0/140

量化课程

    移动端课程