请问MACD,5分钟与30分钟共振的指标如何编写,
30分钟金叉后,5分钟金叉买入
新建一个指标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;
MACD代码直接放进去。
然后再新建一个指标作为交易指标,在这指标下进行调用即可:
macd30min:"A.macd1#MIN30";
macd5min:"A.macdjc#MIN5";
kd:macd30min>0 and macd5min;
buy(kd and holding=0,1,market);