M3:=MA(CLOSE,3);
M7:=MA(CLOSE,7);
M13:=MA(CLOSE,13);
S13:=STD(CLOSE,13);
转:=C>=M3 AND C>=M7 AND C>=M13;
MK:=(HIGH+LOW+2*CLOSE+OPEN/2)/4.5;
凤1:=MK*MA(MK,2)/REF(MK,6);
STICKLINE(凤1>=REF(凤1,1),REFDATE(HHV(H,60),DATE),REFDATE(LLV(L,60),DATE),6,0),COLOR404050;
XS1:=MA(HIGH,30)*(1+13/100);
XS2:=MA(LOW,30)*(1-13/100);
XS3:=(XS1+XS2)/2;
XS4:=(XS1+XS3)/2;
XS5:=(XS2+XS3)/2;
STICKLINE(转>0,REFDATE((HHV(H,60)+LLV(L,60))/2,DATE),REFDATE(LLV(L,60),DATE),6,0),
COLOR202050;
XS01:=MA(HIGH,3)*(1+3/100);
XS02:=MA(HIGH,3)*(1-3/100);
XS03:=(XS01+XS02)/2;
道:XS01,COLOR0088FF,LINETHICK1;
云:REF(HHV(H,30),1),COLORFFFFAA,LINETHICK1;
{龙:XS1,DOTLINE,COLORWHITE,LINETHICK1;}
妖:XS03,COLORYELLOW,LINETHICK3;
魔1:=M13+2*S13;
{魔大:=魔1>REF(魔1,1);
魔上:=REF(魔1,1)=LLV(魔1,3);}
鬼1:=M13-2*S13;
{鬼小:=鬼1<REF(鬼1,1);
鬼下:=REF(鬼1,1)=HHV(鬼1,3);}
虎:(鬼1+魔1)/2,COLORRED,LINETHICK3;
牛:XS3,COLORFFFFAA,LINETHICK3;
轨:=XS02;
{熊:REF(EMA(L,5),1),COLORGREEN;}
{魔:魔1,COLORFF0000,LINETHICK2;
鬼:鬼1,COLORFF6600,LINETHICK2;
顶:(MA(CLOSE,13)+3*STD(CLOSE,13)),COLORFF0000,LINETHICK2;
底:(MA(CLOSE,13)-3*STD(CLOSE,13)),COLORFF6600,LINETHICK2;
STICKLINE(C>0,魔,顶,0.001,0),COLORFF0000;
STICKLINE(C>0,鬼,底,0.001,0),COLORFF6600;}
DRAWTEXT(CROSS(C,道) AND (CROSS(C,妖) OR L<轨) ,LOW*0.98,'★涨停通道'),COLORYELLOW;
每股公积:FINANCE(18)/1,NODRAW,COLORGREEN;
未分利润:FINANCE(32)/1,NODRAW,COLORGREEN;
所属板块:=STRCAT('所属板块: ',STRCAT(STRCAT(STRCAT('[行业]-',HYBLOCK),STRCAT(' [地域]-',
DYBLOCK)),STRCAT(' [概念]-',GNBLOCK)));
总股本:=STRCAT(STRCAT('总股本: ',CON2STR(TOTALCAPITAL/1000000,2)),'亿');
流通盘:=STRCAT(STRCAT(' 流通盘: ',CON2STR(CAPITAL/1000000,2)),'亿');
全流通:=STRCAT(' 全流通: ',CON2STR((CAPITAL/1000000)/(TOTALCAPITAL/1000000),2));
市值:=STRCAT(STRCAT(' 流通市值: ',CON2STR((CAPITAL/1000000)*C,2)),'亿');
股本市值:=STRCAT('股本市值: ',STRCAT(STRCAT(STRCAT(总股本,流通盘),全流通),市值));
{业绩}
净资收益率:=STRCAT(' 净资收益率: ',CON2STR(FINANCE(29)/FINANCE(19)*100,2));
毛利率:=STRCAT(' 毛利率: ',CON2STR((FINANCE(20)-FINANCE(21))/FINANCE(20)*100,2));
主营利润率:=STRCAT(' 主营利润率 ',CON2STR(FINANCE(23)/FINANCE(20)*100,2));
当前业绩:=STRCAT('当前业绩: ',STRCAT(STRCAT(净资收益率,毛利率),主营利润率));
{主图显示}
DRAWTEXT_FIX(ISLASTBAR,0.000,0.00,0,所属板块),COLORRED;
DRAWTEXT_FIX(ISLASTBAR,0.000,0.06,0,股本市值),COLORYELLOW;
DRAWTEXT_FIX(ISLASTBAR,0.000,0.12,0,当前业绩),COLORGREEN;
{该模型为示范模型,仅用于说明算法语法,用户需根据自己交易经验修改后再实际应用}
{变量赋值
NBAR:=BARSLAST(DATE<>REF(DATE,1))+1;
LLN:REF(LLV(L,30),1),LINETHICK3;
MID:(HHN+LLN)/2,LINETHICK3;
T1:=TIME>900 AND TIME <1455;}
{根据品种的交易时间和选择的周期做相应调整}
{T2:=TIME>=1455;根据品种的交易时间和选择的周期做相应调整}
{交易条件
开多条件:=H>HHN AND (HHN-MID)/MID<5/1000 AND NBAR>=30 AND T1;
开空条件:=L<LLN AND (MID-LLN)/MID<5/1000 AND NBAR>=30 AND T1;}
{交易系统
BUY(开多条件,LOW);
SELLSHORT(开空条件,HIGH);
SELL(T2,HIGH);
BUYSHORT(T2,LOW);
AUTOFILTER;}
昨收:=REF(C,1);
LCZT:=昨收*110;
涨停:=IF(FRACPART(LCZT)>=0.4999,(INTPART(LCZT)+1)/100,
INTPART(LCZT)/100)=H OR(REF(C,1)*1.1-H)<0.01;
STICKLINE(CLOSE<OPEN,L,H,0.1,0),COLORFFCC66;
STICKLINE(CLOSE<OPEN,C,O,2.6,0),COLORFFCC66;
STICKLINE(CLOSE>=OPEN,L,H,0.1,0),COLOR0047FF;
STICKLINE(CLOSE>=OPEN,C,O,2.6,0),COLOR0047FF;
STICKLINE(涨停 AND CLOSE>=OPEN,C,H,0,1),COLORYELLOW,LINETHICK2;
STICKLINE(涨停 AND CLOSE<OPEN,O,H,0,1),COLORYELLOW,LINETHICK2;
STICKLINE(涨停,C,O,2.6,1),COLORYELLOW,LINETHICK2;
STICKLINE(涨停 AND CLOSE>=OPEN,O,L,0,1),COLORYELLOW,LINETHICK2;
STICKLINE(涨停 AND CLOSE<OPEN,C,L,0,1),COLORYELLOW,LINETHICK2;
STICKLINE(涨停 AND O=C,O,O,2.6,1),COLORYELLOW,LINETHICK5;