等级: 新手上路
- 注册:
- 2021-10-1
- 曾用名:
|
{自适应均线}
DIRECTION:=CLOSE-REF(CLOSE,10);
VOLATILITY1:=SUM(ABS((CLOSE-REF(CLOSE,1))),10);
ER:=ABS(DIRECTION/VOLATILITY1);
FASTSC:=2/(2+1);
SLOWSC:=2/(30+1);
SSC:=ER*(FASTSC-SLOWSC)+SLOWSC;
CONSTANT:=SSC*SSC;
AMA1:=EMA(DMA(CLOSE,CONSTANT),2),COLORWHITE;
FIL:=STD(AMA1-REF(AMA1,1),30);
//DRAWLINE3(AMA1-LLV(AMA1,3)>FIL*0.1,AMA1,0,1,REF(AMA1,1),1,0),COLORMAGENTA,LINETHICK3;
//DRAWLINE3(AMA1-LLV(AMA1,3)=FIL*0.1,AMA1,0,1,REF(AMA1,1),1,0),COLORWHITE,LINETHICK3;
//DRAWLINE3(AMA1-LLV(AMA1,3)<FIL*0.1,AMA1,0,1,REF(AMA1,1),1,0),COLORGREEN,LINETHICK3;
{各周期连续}
日:=HHV(DAYBARPOS,0);
周:=HHV(BARSLAST(WEEKDAY<REF(WEEKDAY,1))+1,0);
H3:HHV(H,3),COLORGREEN;
日内最高:=HHV(H,DAYBARPOS),COLORGREEN;
连日最高:HHV(H,日),COLORGREEN,LINETHICK2;
周最高价:=HHV(H,周),COLORGREEN,LINETHICK3;
L3:LLV(L,3),COLORRED;
日内最低:=LLV(L,DAYBARPOS),COLORRED;
连日最低:LLV(L,日),COLORRED,LINETHICK2;
周最低价:=LLV(L,周),COLORRED,LINETHICK3;
{各周期连续加权均价}
日均价:=SUM(AVPRICE*V,DAYBARPOS)/SUM(V,DAYBARPOS);
日加:=EMA2(AVPRICE,日);
周加:=EMA2(AVPRICE,周);
FILLRGN1(V>0,连日最高,日加),RGB(71,12,16);
FILLRGN1(V>0,连日最低,日加),RGB(6,55,13);
{多空判断}
今日高:=HHV(H,DAYBARPOS),COLORMAGENTA;
今日低:=LLV(L,DAYBARPOS),COLORGREEN;
昨日收:=REF(C,DAYBARPOS);
前日收:=REF(昨日收,DAYBARPOS);
昨日结:=REF(SETTLE,DAYBARPOS);
前日结:=REF(昨日结,DAYBARPOS);
昨日高:=REF(今日高,DAYBARPOS),COLORMAGENTA,DASH;
昨日低:=REF(今日低,DAYBARPOS),COLORGREEN,DASH;
前日高:=REF(昨日高,DAYBARPOS);
前日低:=REF(昨日低,DAYBARPOS);
{趋势分类}
ZRXGXDDPS:=昨日收>=前日收&&昨日高>前日高&&昨日低<前日低;//新高又新低收高或收平
ZRXGXDPDS:=昨日收<=前日收&&昨日高>前日高&&昨日低<前日低;//新高又新低收低或收平
ZRBGXDGPS:=昨日收>=前日收&&昨日高<=前日高&&昨日低<前日低;//不新高新低收高或收平
ZRXGBDDPS:=昨日收<=前日收&&昨日高>前日高&&昨日低>=前日低;//新高不新低收低或收平
ZRBGBDGPS:=昨日收>=前日收&&昨日高<=前日高&&昨日低>=前日低;//不新高不新低收高或收平
ZRBGBDDPS:=昨日收<=前日收&&昨日高<=前日高&&昨日低>=前日低;//不新高不新低收低或收平
ZRSGJDJGSD:=昨日收>=前日收&&昨日结<=前日结 OR 昨日收<=前日收&&昨日结>=前日结;//收高结低或收低结高
{趋势预判}
昨日震荡:=ZRXGXDDPS OR ZRXGXDPDS OR ZRBGXDGPS OR ZRXGBDDPS OR ZRBGBDGPS OR ZRBGBDDPS OR ZRSGJDJGSD;//七种震荡
昨日涨:=昨日收>前日收&&昨日低>=前日低&&昨日高>=前日高;//不新低平新高高收结
昨日跌:=昨日收<前日收&&昨日高<=前日高&&昨日低<=前日低;//不新高平新低低收结
{日加趋势和反转}
今日震荡:=昨日震荡 OR 昨日涨&&C<=日加 OR 昨日跌&&C>=日加;
今看涨:=昨日涨 &&C>昨日收&&今日低>昨日低;
今看跌:=昨日跌&&C<昨日收&&今日高<昨日高;
突破昨日震荡日看涨:=昨日震荡&&C>MIN(昨日收,昨日结);
突破昨日震荡日看跌:=昨日震荡&&C<MAX(昨日收,昨日结);
V型反转日看涨:=昨日跌&&C>MIN(昨日收,昨日结);
V型反转日看跌:=昨日涨&&C<MAX(昨日收,昨日结);
{确定日势}
日势震荡:=今日震荡;
日势看涨:=(昨日涨 OR 今看涨 OR 突破昨日震荡日看涨 OR V型反转日看涨)&&C>日加;
日势看跌:=(昨日跌 OR 今看跌 OR 突破昨日震荡日看跌 OR V型反转日看跌)&&C<日加;
DRAWLINE3(日势震荡,日加,0,1,REF(日加,1),1,0),COLORBLUE,LINETHICK2;
DRAWLINE3(日势看涨,日加,0,1,REF(日加,1),1,0),COLORRED,LINETHICK2;
DRAWLINE3(日势看跌,日加,0,1,REF(日加,1),1,0),COLORGREEN,LINETHICK2;
{周趋势和反转}
周震荡:=昨日震荡 OR 昨日涨&&C<=周加 OR 昨日跌&&C>=周加;
周看涨:=昨日涨 &&C>昨日收&&今日低>昨日低;
周看跌:=昨日跌&&C<昨日收&&今日高<昨日高;
突破昨日震荡周看涨:=昨日震荡&&C>MIN(昨日收,昨日结);
突破昨日震荡周看跌:=昨日震荡&&C<MAX(昨日收,昨日结);
V型反转周看涨:=昨日跌&&C>MIN(昨日收,昨日结);
V型反转周看跌:=昨日涨&&C<MAX(昨日收,昨日结);
{确定周势}
周势震荡:=周震荡;
周势看涨:=(昨日涨 OR 周看涨 OR 突破昨日震荡周看涨 OR V型反转周看涨)&&C>周加;
周势看跌:=(昨日跌 OR 周看跌 OR 突破昨日震荡周看跌 OR V型反转周看跌)&&C<周加;
DRAWLINE3(周势震荡,周加,0,1,REF(周加,1),1,0),COLORLIGHTBLUE,LINETHICK3;
DRAWLINE3(周势看涨,周加,0,1,REF(周加,1),1,0),COLORLIGHTRED,LINETHICK3;
DRAWLINE3(周势看跌,周加,0,1,REF(周加,1),1,0),COLORLIGHTGREEN,LINETHICK3;
{周势日内信号}
周势N:=周震荡;
周势B:=周势看涨&&日势看涨&&C>日均价;
周势S:=周势看跌&&日势看跌&&C<日均价;
//DRAWICON(CROSS(周势B,0.5)&&COUNT(CROSS(周势B,0.5),BARSLAST(CROSS(周势S,0.5))+1)=1,H,'ICO130');
//DRAWICON(CROSS(周势S,0.5)&&COUNT(CROSS(周势S,0.5),BARSLAST(CROSS(周势B,0.5))+1)=1,L,'ICO131'),VALIGN0;
昨震荡:IF(昨日震荡,0,NULL),NODRAW,COLORWHITE;
昨涨:IF(昨日涨,1,NULL),NODRAW,COLORMAGENTA;
昨跌:IF(昨日跌,-1,NULL),NODRAW,COLORGREEN;
//DRAWGBK1(昨日涨,RGB(70,70,70));
//DRAWGBK1(昨日跌,RGB(40,40,40));
{成交秘码}
买:=SCALE*VOL,NODRAW,COLORRED;
卖:=(1-SCALE)*VOL,NODRAW,COLORGREEN;
总:=买+卖,NODRAW,COLORYELLOW;
差:=买-卖,NODRAW,COLORWHITE;
DRAWCOLORKLINE(ISUP,COLORRED,1);//收盘价大于开盘价,绘制红色空心K线
DRAWCOLORKLINE(ISDOWN,COLORCYAN,1);//收盘价小于开盘价,绘制青色实心K线
DRAWCOLORKLINE(ISEQUAL,COLORWHITE,1);//收盘价等于开盘价,绘制白色十字线
STICKLINE(OPI>REF(OPI,1) AND 总>REF(总,1) AND C>O,O,O+(C-O)/2,COLORRED,0);//放量增仓上行
STICKLINE(OPI>REF(OPI,1) AND 总>REF(总,1) AND C<O,O,O-(O-C)/2,COLORCYAN,0);//放量增仓下行
STICKLINE(OPI<REF(OPI,1) AND 总>REF(总,1) AND C>O,O,O+(C-O)/2,COLORMAGENTA,0);//放量减仓上行
STICKLINE(OPI<REF(OPI,1) AND 总>REF(总,1) AND C<O,O,O-(O-C)/2,COLORGREEN,0);//放量减仓下行
STICKLINE(OPI>REF(OPI,1) AND 总<REF(总,1) AND C>O,O,O+(C-O)/4,COLORLIGHTRED,0);//缩量增仓上行
STICKLINE(OPI>REF(OPI,1) AND 总<REF(总,1) AND C<O,O,O-(O-C)/4,COLORGRAY,0);//缩量增仓下行
//STICKLINE(OPI<REF(OPI,1) AND 总<REF(总,1) AND C>O,O,O+(C-O)/4,RGB(128,0,64),0);//缩量减仓上行
//STICKLINE(OPI<REF(OPI,1) AND 总<REF(总,1) AND C<O,O,O-(O-C)/4,COLORLIGHTGREEN,0);//缩量减仓下行
倍量:=VOL>REF(VOL,1)*1.9;
STICKLINE( C>O AND 倍量,O,O+(C-O)/6,COLORYELLOW,0);//倍量上行
STICKLINE(C<O AND 倍量,O,O-(O-C)/6,COLORYELLOW,0);//倍量下行
DRAWTEXT(CROSS(ISNEARHOLIDAY=1,0.5),H,'假'),FONTSIZE20;//满足下一个交易日是节假日的第一根K线进行标记。
|
|