{金牛三色K线}
{主趋势线:EMA(EMA(C,10),10),COLORRED,LINETHICK3;
B:=主趋势线<REF(主趋势线,1);
IF(B-1,主趋势线,DRAWNULL)COLORRED,LINETHICK3;}
主趋势线:EMA(EMA(C,10),10),COLORRED,LINETHICK3;
B:=主趋势线>REF(主趋势线,1);
IF(B-1,主趋势线,DRAWNULL)COLORBLUE,LINETHICK3;
{操盘线:EMA(EMA(C,5),5),COLORRED,LINETHICK2;
Y:=操盘线>REF(操盘线,1);
IF(Y-1,操盘线,DRAWNULL)COLORGREEN,LINETHICK2;}
AA:=EMA(C,5) > EMA(C,20);
BB:=EMA(C,5) < EMA(C,20);
CC:= EMA(C,5) > EMA(C,10);
CC1:=EMA(C,5) < EMA(C,10);
DD:=CLOSE<OPEN;
STICKLINE(AA,H,L,0,0),COLORRED;
STICKLINE(AA,O,C,3,1),COLORRED;
STICKLINE(AA AND DD,O,C,3,0),COLORRED;
STICKLINE(BB,H,L,0,0),COLORGREEN;
STICKLINE(BB,O,C,3,1),COLORGREEN;
STICKLINE(BB AND DD,O,C,3,0),COLORGREEN;
if aa then
BEGIN
sellshort(holding<0,holding,market);
buy(holding=0,1,limit,c);
end
if bb then
BEGIN
sell(holding>0,holding,market);
buyshort(holding=0,1,limit,c);
end
if holding>0 and hhv(h,enterbars+2)>enterprice+10*mindiff and c<= hhv(h,enterbars+2)-3*mindiff then 止盈1:sell(1,0,limitr,enterprice+8*MINDIFF),ignorecheckprice;
if holding<0 and llv(l,enterbars+2)<enterprice-10*mindiff and c>= hhv(h,enterbars+2)+3*mindiff then 止盈2:sellshort(1,0,limitr,enterprice-8*MINDIFF),ignorecheckprice;
if holding>0 and c<=主趋势线-5*MINDIFF then 止损1:sell(1,holding,market);
if holding<0 and c>=主趋势线+5*MINDIFF then 止损2:sellshort(1,holding,market);
EXITBARS=-1 or EXITBARS>=99
主趋势线:EMA(EMA(C,10),10),COLORRED,LINETHICK3;
B:=主趋势线>REF(主趋势线,1);
AA:EMA(C,5) > EMA(C,20);
BB:EMA(C,5) < EMA(C,20);
if holding>0 and c<=主趋势线-5*MINDIFF then 止损1:sell(1,holding,market);
if holding<0 and c>=主趋势线+5*MINDIFF then 止损2:sellshort(1,holding,market);
if holding>0 and enterbars<>-1 and hhv(h,enterbars+1)>enterprice+10*mindiff and c<= hhv(h,enterbars+1)-3*mindiff then 止盈1:sell(1,0,limitr,enterprice+8*MINDIFF),ignorecheckprice;
if holding<0 and enterbars<>-1 and llv(l,enterbars+1)<enterprice-10*mindiff and c>= hhv(h,enterbars+1)+3*mindiff then 止盈2:sellshort(1,0,limitr,enterprice-8*MINDIFF),ignorecheckprice;
if aa then
BEGIN
sellshort(holding<0,holding,market);
buy(holding=0 and (c<=EXITPRICE-
5*MINDIFF or not(EXITPRICE)),1,limit,c);
end
if bb then
BEGIN
sell(holding>0,holding,market);
buyshort(holding=0 and (c>=EXITPRICE+
5*MINDIFF or not(EXITPRICE)),1,limit,c);
end
我设的五个点,你可以自己调整下。