"""Created on Tue May 23 08:57:02 @author: yunjinqi E-mail:yunjinqi@ Differentiate yourself in the world from anyone else."""import pandas as pdimport numpy as npimport datetimeimport time#获取数据df=pd.read_csv('C:/Users/HXWD/Desktop/000001.csv',encoding='gbk')df.columns=['date','code','name','close','high','low','open','preclose','change','change_per','volume','amt']df=df[['date','open','high','low','close','volume','amt']]df.head()def get_price_oscillator(df,short=12,long=26):df['price_oscillator']=100*((df['close'].rolling(short).mean()-df['close'].rolling(long).mean())/df['close'].rolling(short).mean())return dfget_price_oscillator(df)df.tail()
注:需要单独编写文华财经,金字塔,大智慧,通达信,TB,Python平台的指标、策略等,请联系扣扣1733505732,兼职时间:工作日下午18:00-22:00,节假日。
注:计算大量数据,请修改算法。
如果觉得《python-大智慧price_oscillator指标》对你有帮助,请点赞、收藏,并留下你的观点哦!