请编译:
1、当引用的小时周期的macd金叉,且该小时k线收为阳线,并标记该阳线“(收盘价-最低价)/2+最低价”的位置为w;
2、持仓周期为1分钟,在小时周期金叉后的60分钟里,如果在分钟周期的收盘价小于w,则预警;
新建一个指标A:
input:p(26,20,100,8),s(12,5,40,4),m(9,2,60,6);
DIFF :EMA(CLOSE,S) - EMA(CLOSE,P);
DEA :EMA(DIFF,M);
MACD1 :2*(DIFF-DEA), COLORSTICK;
macdjc:cross(diff,dea),NODRAW;//macd金叉
macdsc:cross(dea,diff),NODRAW;
cd:macjc and c>o;
w:(c-l)/2+l;
当前分钟下调用下:
hcd:stkindi('','A.cd',0,5,0);
hw:stkindi('','A.w',0,5,0);
预警条件:hcd and c<hw;