The problem is locked!
1
follow
3000
views

分时线如何获取每分钟DIF和DEA?

Why is it folded? 0 个回复被折叠
大观量化 初级会员 User from: 广东省广州市荔湾区
2024-10-28 20:50

import numpy as np

def initialize(context):
g.security = "600570.XSHG"

def handle_data(context, data):
h1d = get_history(100, '1d', ['close'], security_list=g.security,include=False)
h1m = get_history(1, '1m', ['close'], security_list=g.security,include=True)
close_data = np.array(list(h1d.close)+list(h1m.close))
macdDIF_data, macdDEA_data, macd_data = get_MACD(close_data, 12, 26, 9)
dif = macdDIF_data[-1]
dea = macdDEA_data[-1]
macd = macd_data[-1]


回测周期选择分钟,性能需自行优化

About the author

liycd 注册会员

This guy is lazy,Introduction has not been set

Problem dynamics

Release time
2024-10-28 20:31
Update time
2024-10-28 20:52
Focused
1 people pay attention to

Recommended content

请教下,如何根据集合竞价情况,每天定时实现在9点26分的买入?
如何获取最新买入成交的买入价格?
帮我写一个90%筹码集中度小于5%的选股策略
布林线开口向上或者向下要怎样判断
分批止盈逻辑判断设置
准备开始下个阶段的开发,大家都喜欢什么类型的策略?
分批止盈逻辑判断设置
Ptrade上关于集合竞价怎么实现比较合适?
请教大家:PTrade 竞价的未匹配量红绿柱如何用代码定义出来的?