python-大智慧-BIAS乖离率编写
来源:互联网 发布:淘宝直通车创意主图 编辑:程序博客网 时间:2024/06/05 20:07
# -*- coding: utf-8 -*-"""Created on Wed May 24 15:47:51 2017@author: yunjinqi E-mail:yunjinqi@qq.com Differentiate yourself in the world from anyone else."""import pandas as pd import numpy as np import datetime import 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_BIAS(df,L1=6,L2=12,L3=24): ''' 乖离率算法: 当日收盘价与移动平均线之间的差距;用法: 正的乖离率愈大,表示短期获利愈大,则获利回吐的可能性愈高;负的乖离率愈大,则空头回补的可能性愈高。 按个股收盘价与不同天数的平均价之间的差距,可绘制不同的BIAS线。参数: 系统绘制三条BIAS线,分别为收盘价与L1日、L2日、L3日移动平均价的差。''' df['bias1']=100*(df['close']-df['close'].rolling(L1).mean())/df['close'].rolling(L1).mean() df['bias2']=100*(df['close']-df['close'].rolling(L2).mean())/df['close'].rolling(L1).mean() df['bias3']=100*(df['close']-df['close'].rolling(L3).mean())/df['close'].rolling(L1).mean() return dfget_BIAS(df)df.tail()
注:以上代码仅供参考,需要单独编写文华财经,金字塔,大智慧,通达信,TB,Python平台的指标、策略等,请联系扣扣1733505732,兼职时间:工作日下午18:00-22:00,节假日。
阅读全文
0 0
- python-大智慧-BIAS乖离率编写
- 大智慧公式编写教程
- 大智慧公式编写教程
- python-大智慧price_oscillator指标
- 怎样编写大智慧选股公式
- 大智慧公式编写---初学者入门指南
- python_大智慧SAR指标编写
- 乖离率(BIAS)
- BIAS 乖离率
- python-大智慧-ALF过滤指标
- bias
- python——大智慧--三重指数平滑--TRIX
- python-大智慧-VMACD-量指数平滑移动平均线
- python——大智慧——CCI指标
- 乖离率BIAS指标使用详解
- 小动物大智慧
- 大智慧教程
- 小故事大智慧
- STL中查找方法用法总结-adjacent_find, binary_search, includes, lower_bound, upper_bound, equal_range
- BZOJ2038: [2009国家集训队]小Z的袜子(hose)
- Ambari数据库分析-配置相关
- codeforces 793B
- 用一台笔记本跑ROVIO
- python-大智慧-BIAS乖离率编写
- 由传统武术和综合格斗所想到的
- SQL notes
- HAproxy 配置详解
- JSTL日期格式化
- orcale插入数据 返回插入数据的主键
- Activity中多Fragment使用方案1
- POJ 1390 Blocks 笔记
- Google chrome 谷歌浏览器 第三方扩展程序已停用