//以下代码在1分钟上计算有效,其他周期请跨周期调用 结算价。
n1:=todaybar;
dm:=4-INTPART(LOG(C));
结算价:ROUNDS(IF(sum(vol,n1)=0,C,sum(C*vol,n1)/sum(vol,n1)),2+dm),colorred;//分时图上黄线
cd1:cross(c,结算价);//白线上穿黄线开多
cd2:cross(结算价,c);
buy(cd1 and holding=0,1,market);
sell(cd2 and holding>0,1,market);