{公式名称:UP商品3号-稳进
//默认周期:15分钟
//默认显示:主图
}
周期锁定:=1;
牛熊线:IFF(周期锁定,MA(C,260),DRAWNULL),COLORWHITE,LINETHICK2;
趋势做多:IFF(C>牛熊线,牛熊线,DRAWNULL),COLORRED,LINETHICK2;
趋势做空:IFF(C<牛熊线,牛熊线,DRAWNULL),COLORFFFF00,LINETHICK2;
MID:=(3*C+H+L+O)/6;
VAR1:=WMA(MID,8);
VAR2:=HHV(VAR1,20);
VAR3:=LLV(VAR1,20);
压力1:=HHV(VAR2,20);
压力2:=HHV(VAR2,10);
支撑1:=LLV(VAR3,20);
支撑2:=LLV(VAR3,10);
买入:=C>压力1 AND C>牛熊线;
平买:=支撑2>L;
卖出:=C<支撑1 AND C<牛熊线;
平卖:=H>压力2;
多开:=TFILTER(买入,平买,0);
平多:=TFILTER(平买,买入,0);
空开:=TFILTER(卖出,平卖,0);
平空:=TFILTER(平卖,卖出,0);
SIGNAL:=多开 OR 平多 OR 空开 OR 平空;
阳线:=C>O;{分析家公式网WWW.70822.COM}
阴线:=C<=O;
STICKLINE(周期锁定 AND 阳线,O,C,2.5,1),COLORWHITE;
STICKLINE(周期锁定 AND 阴线,O,C,2.5,0),COLORWHITE;
STICKLINE(周期锁定 AND 阴线,H,L,0,0),COLORWHITE;
STICKLINE(周期锁定 AND 阳线,H,C,0,0),COLORWHITE;
STICKLINE(周期锁定 AND 阳线,O,L,0,0),COLORWHITE;
持有多单:=(COUNT(多开==1,BARSLAST(SIGNAL)+1)==1) AND (COUNT(平多==1,BARSLAST(SIGNAL)+1)==0),NODRAW,COLORRED;
STICKLINE(周期锁定 AND 持有多单 AND 阴线,O,C,2.5,0),COLORRED;
STICKLINE(周期锁定 AND 持有多单 AND 阴线,L,H,0,0),COLORRED;
STICKLINE(周期锁定 AND 持有多单 AND 阳线,O,C,2.5,1),COLORRED;
STICKLINE(周期锁定 AND 持有多单 AND 阳线,O,L,0,1),COLORRED;
STICKLINE(周期锁定 AND 持有多单 AND 阳线,H,C,0,1),COLORRED;
持有空单:=(COUNT(空开==1,BARSLAST(SIGNAL)+1)==1) AND (COUNT(平空==1,BARSLAST(SIGNAL)+1)==0),NODRAW,COLORGREEN;
STICKLINE(周期锁定 AND 持有空单 AND 阴线,O,C,2.5,0),COLORFFFF00;
STICKLINE(周期锁定 AND 持有空单 AND 阴线,L,H,0,0),COLORFFFF00;
STICKLINE(周期锁定 AND 持有空单 AND 阳线,C,O,2.5,1),COLORFFFF00;
STICKLINE(周期锁定 AND 持有空单 AND 阳线,L,O,0,0),COLORFFFF00;
STICKLINE(周期锁定 AND 持有空单 AND 阳线,C,H,0,0),COLORFFFF00;
动态止损价:IFF(持有空单,压力2,IFF(持有多单,支撑2,DRAWNULL)),NODRAW,COLORYELLOW;
DRAWTEXT(空开==1 AND 周期锁定==1,H*1.002,'空'),COLORFFFF00;
DRAWTEXT(平空==1 AND 周期锁定==1,L*0.999,'平'),COLORWHITE;
DRAWTEXT(多开==1 AND 周期锁定==1,L*0.998,'多'),COLORRED;
DRAWTEXT(平多==1 AND 周期锁定==1,H*1.001,'平'),COLORWHITE;
小周期锁定:=IFF(PERIOD==0 OR PERIOD==1 OR PERIOD==2 OR PERIOD==3,1,0);