举例:
input:m(5),n(20);
ma5:ma(c,m);
ma20:ma(c,20);
if cross(c,ma20) then begin
sellshort(holding<0,0,thisclose);
buy(holding=0,1,thisclose);
end
if cross(ma20,c) then begin
sell(holding>0,0,thisclose);
buyshort(holding=0,1,thisclose);
end
说明:20均线和5均线上下穿进行反手,以上是范例