等级: 标准版
- 注册:
- 2023-2-16
- 曾用名:
|
楼主 |
发表于 2024-4-3 14:52
|
显示全部楼层
你试下 能不能对?
PY:
from PythonApi import *
def init(context):
context.code=context.run_info.base_book_id # 获取基准合约代码
def handle_bar(context):
stocklist=get_blocks('连续合约板块',1)
for code_xh in stocklist:
r = get_indicator(code_xh, 'Formula7', 'pp', '0','5m', 1,include_now=True)
print(code_xh)
print(r)
PEL:
input:p(26,5,200,8),s(12,5,200,4),m(9,2,200,6);
diff := ema(close,S) - ema(close,P);
dea := ema(diff,M);
macd1 := 2*(diff-dea);
死叉:=cross(dea,diff);
金叉:=cross(diff,dea);
VARIABLE:rmj:=0;
if diff<dea then rmj:=0;
if diff>dea then rmj:=rmj+macd1;
pp:rmj;
|
|