 
等级: 超级版主
- 注册:
- 2021-5-18
- 曾用名:
|
就是上面新建一个公式A然后贴这个代码
// MACD指标
DIFF :EMA(CLOSE,12) - EMA(CLOSE,26);
DEA :EMA(DIFF,9);
MACD :2 * (DIFF - DEA),COLORSTICK;
//新建公式A
ll:=ref(llv(low,barslast(cross(macd,0))),barslast(cross(0,macd)));
hh:=ref(hhv(high,barslast(cross(0,macd))),barslast(cross(macd,0)));
cond1:macd<0 and high>ll;
cond2:macd>0 and low<hh;
其他地方通过stkindi引用
//然后其他地方用stkindi跨周期调用A指标的cond1和cond2
if DATATYPE = 1 then a:=1;
if DATATYPE = 2 then a:=5;
if stkindi('','A.cond1',0,1,0) then DRAWTEXT(1,0,'向上'&numtostr(a,0));
if stkindi('','A.cond2',0,1,0) then DRAWTEXT(1,0,'向下'&numtostr(a,0));
下面的stkind不是调用的?不太会哦。 |
|