BD:=(CLOSE/MA(CLOSE,28)-1)*100;
STICKLINE (BD>=0, BD,0,1,0),COLORRED;
STICKLINE (BD<=0, 0,BD,1,0),COLORGREEN;
出现红柱且收盘价创出20周期新高 开多
出现绿色平空
出现绿色且收盘创20周期新低 开空
出现红色平空
BD:=(CLOSE/MA(CLOSE,28)-1)*100;
STICKLINE (BD>=0, BD,0,1,0),COLORRED;
STICKLINE (BD<=0, 0,BD,1,0),COLORGREEN;
kd:bd>0 and c=hhv(c,20);//开多条件
kk:bd<0 and c=llv(l,20);//平多条件
pd:bd<0;
pk:bd>0;
sell(pd and holding>0,holding,market);
buy(holding=0 and kd,1,market);
sellshort(holding<0 and pk,holding,market);
buyshort(holding=0 and kk,1,market);