开仓,平仓的连线
drawline(holding>0 and ref(holding<0,1) and c-enterprice>0,c,holding<0,c,0,colorred);
drawline(holding>0 and ref(holding<0,1) and c-enterprice<0,c,holding<0,c,0,colorgreen);
drawline(holding<0 and ref(holding>0,1) and c-enterprice>0,c,holding>0,c,0,colorred);
drawline(holding<0 and ref(holding>0,1) and c-enterprice<0,c,holding>0,c,0,colorgreen);
if cross(ma(c,5),ma(c,20)) then BEGIN
sellshort(1,0,market);
buy(holding=0,1,market);
end
if cross(ma(c,20),ma(c,5)) then begin
sell(1,0,market);
buyshort(holding=0,1,market);
end
以简单的MA金死叉反手交易为范例的划线