n1:=todaybar;
dm:=4-INTPART(LOG(C));
ss:=ROUNDS(IF(sum(vol,n1)=0,C,sum(C*vol,n1)/sum(vol,n1)),2+dm);
if cross(close,ss) then begin
sellshort(1,0,thisclose);
buy(holding=0,1,thisclose);
end
if cross(ss,close) then begin
sell(1,0,thisclose);
buyshort(holding=0,1thisclose);
end
謝謝老師,