PTrade工具:分享一个计算涨速的易用函数

大观量化
大观量化 以大见小,以小入微

0 People liked this article · 3618 views

涨速是短线追涨常需要参考的指标,get_speed函数可以非常容易地计算股票盘中的涨速(涨速计算公式为(当前价/N周期前的收盘价-1)*100)。


注意:下载文件建议使用电脑浏览器下载,勿用手机下载,否则可能会出现下载不了的情况。

一、简单明了的使用方法
1.首先需要将附件get_speed.txt中的函数代码复制到策略末尾。
2.get_speed函数需要填入2个参数调用,第一个参数是股票代码,第二个参数是需要计算的涨速周期(举例:填1则计算1分钟涨速,填5则计算5分钟涨速)。

二、函数使用方法示例
#函数需要在handle_data中以分钟运行频率调用,举例:get_speed('600000.SS', 1),可获取浦发银行的1分钟涨速。

List of attachments

get_speed.txt

1KB

1.00

线上付款

Published on 2024-08-22 21:33

Disclaimers:

This document is written by 大观量化 Original published on 百果量化交流平台 ,The copyright belongs to the author。

Log in,More exciting content waiting for you to find,Contribute wonderful answers,Participate in comment interaction

go Sign in! No accountgoregister

广告

Included in the column

Recommended content

article prices_df 这个变量,后面的这个DF一般是什么的简写
article PTrade系统回测指标详解
article 在PTrade中TA-Lib注意事项
article 因子检验---alpha001因子有效分析研究科普
article KDJ指标详解及示例
article 基于PTrade的交易策略框架结构(含截图)
article 【实战】量价因子策略
article 集合竞价获取snapshot时间序列