好公式网用指标公式为投资注入科技力量!
您的位置:好公式网飞狐公式试验操盘系统公式 飞狐试验系统指标 源码

试验操盘系统公式 飞狐试验系统指标 源码

  • 指标公式类型:飞狐公式
  • 公式推荐星级:
  • 指标公式安全:已通过5款杀毒软件查杀,请放心下载!
  • 公式更新时间:2018-07-11 22:33:07
  • 指标公式标签:操盘 系统
  • 公式运行环境: WinXP/Win7/Win8/Win10/Win All
  • 指标公式语言:用简体中文编写

指标公式详细说明

好公式网(www.goodgongshi.com)告诉您:当前正要下载:试验操盘系统公式 飞狐试验系统指标 源码

领涨版块部分需要安装千钧老师“涨幅引用”的引用公式,有些部分自行选用。

input:n(21,1,999),n1(8,1,256),n2(64,1,256),k1(3,0,3),线数(3,1,8),nn(3,1,20);

drawgbk(1>0,colorrgb(0,0,0) ,colorrgb(0,0,0),1);
//drawgbk(close,colorrgb(36,68,36),colorrgb(60,80,80),1);
//drawgbk(c,colorrgb(20,1,14),colorrgb(100,50,60),1);
drawtextex(1,1,0,0,'■所属板块:'+blkname),colorwhite;
drawtextex(1,1,680,60,'市盈率:'+numtostr(dynainfo(39),2)+'     净资产: '+numtostr(finance(34),2)),color0f7ac5;
drawtextex(1,1,680,100,'收 益:'+numtostr(finance(33),2)+' '+'利 润: '+numtostr(finance(54),0)+' %'),color0f7ac5;
星期数字:=weekday,linethick0;
星期x:=' 星期';
星期j:=if(星期数字=5 ,星期x+'五',if(星期数字=4 ,星期x+'四',
if(星期数字=3 ,星期x+'三',if(星期数字=2 ,星期x+'二',if(星期数字=1 ,星期x+'一',星期x)))));
农历月:=lmonth;
农历日:=lday;
农历:=if( barstatus=2 ,' 农历 '+numtostr(农历月,0)+'月 '+numtostr(农历日,0)+'日',' ');
drawtextex(1,1,400,40,星期j+农历),linethick3,colorffff80;
ema5:=ema(close,5);
ema10:=ema(close,10);
ema20:=ema(close,20);
ema30:=ema(close,30);
ema60:=ema(close,60);
ema128:=ema(close,128);
ema256:=ema(close,256);
//均线系统解盘
explain(1,' '+'均线系统'),colorffff;
explain(close>=ema128,'股价在半年线之上'),linethick2,color6633cc;
explain(close>=ema256,'股价在年线之上'),color6633cc;
explain(close<ema128,'股价在半年线之下'),colorccff99;
explain(close<ema256,'股价在年线之下'),colorccff99;
explain(ema128>=ref(ema128,1),'半年线趋势向上'),color6633cc;
explain(ema256>=ref(ema256,1),'年线趋势向上'),color6633cc;
explain(ema128<ref(ema128,1),'半年线趋势向下'),colorccff99;
explain(ema256<ref(ema256,1),'年线趋势向下'),colorccff99;
explain((ema60>ema128 and ema128>ema256 and ema60>ema256),'60日以上均线多头排列'),color6633cc;
explain((ema60<ema128 and ema128<ema256 and ema60<ema256),'60日以上均线空头排列'),colorccff99;
explain((ema30>ema60 and ema30>ema128 and ema60>ema128),'中期均线多头排列'),color6633cc;
explain((ema30<ema60 and ema30<ema128 and ema60<ema128),'中期均线空头排列'),colorccff99;
explain((cross(c,ema60) and cross(c,ema128) and cross(c,ema256)),'股价一阳上穿三线'),color6633cc;
explain((ema30>ref(ema30,1)),'30日均线向上'),color6633cc;
explain((ema30>ref(ema30,1) and ema30<ref(ema30,1)*1.001),'30日均线走平');
explain((ema30<ref(ema30,1)),'30日均线向下'),colorccff99;
explain((ema5>ref(ema5,1)*1.015),'5日均线强劲向上'),color6633cc;
explain((ema5>ref(ema5,1) and ema5<ref(ema5,1)*1.005),'5日均线方向不明');
explain((ema5<ref(ema5,1)*0.985),'5日均线快速向下'),colorccff99;
explain((cross(ema5,ema10)),'5日10日均线金叉'),color6633cc;
explain((cross(ema10,ema5)),'5日10日均线死叉'),colorccff99;
explain((ema5>ema10 and ema10>ema30 and ema5>ema30),'30日以下均线多头排列'),color6633cc;
explain((ema5<ema10 and ema10<ema30 and ema5<ema30),'30日以下均线空头排列'),colorccff99;

//资金动向解盘
hsl:=vol/capital*100;
ld:=ma(vol/(high-low),5);
dmp:=abs(close-open);
dmm:=vol/(high-low);
explain(1,' '+'资金动向'),colorffff;
explainex(hsl<=1,'地量/换手率=',hsl,2,2),colorwhite;
explainex(hsl>=1 and hsl<2,'无量/换手率=',hsl,2,2),colorcyan;
explainex(hsl>2 and hsl<3,'温和/换手率=',hsl,2,2),colorgray;
explainex(hsl>3 and hsl<5,'活跃/换手率=',hsl,2,2),colorgreen;
explainex(hsl>5 and hsl<8,'带量/换手率=',hsl,2,2),coloryellow;
explainex(hsl>8 and hsl<15,'放量/换手率=',hsl,2,2),colormagenta;
explainex(hsl>15 and hsl<25,'巨量/换手率=',hsl,2,2),colorred;
explainex(hsl>=25,'异常/换手率=',hsl,2,2),colorblue;
explain(dmm<ld and dmp<ma(dmp,5),'资金入场意愿萎缩'), colorffcc33;
explain(dmm<ld and dmp>ma(dmp,5),'场内资金有运作行为'), colorffcc33;
explain(dmm>ld and dmp<ma(dmp,5),'多空双方激烈争夺'), colorffcc33;
explain(dmm>ld and dmp>ma(dmp,5),'场外资金介入(或出局)意愿强烈'), colorffcc33;
explain(cross("vol.ma1","vol.ma2") and "vol.ma2">"vol.ma3" and "vol.ma1">"vol.ma3",'成交量均线金叉.'), colorccff99;
explain("vol.ma1">"vol.ma2" and "vol.ma2">"vol.ma3" and "vol.ma1">"vol.ma3",'成交量均线多头排列.'), colorccff99;

sy:=if(close>=open,high-close,high-open);
xy:=if(close>=open,open-low,close-low);
cd:=2*(sy+xy)+abs(close-open);
syj:=if(close>=open,(high+close)/2,(high+open)/2);
xyj:=if(close>=open,(open+low)/2,(close+low)/2);
maj1:=(syj*2*sy/cd+xyj*2*xy/cd+(close+open)/2*abs(close-open)/cd);
maj:=if(maj1=0,c,maj1);

短趋:=(8*maj+7*ref(maj,1)+6*ref(maj,2)+5*ref(maj,3)+4*ref(maj,4)+3*ref(maj,5)+2*ref(maj,6)+ref(maj,8))/36;
中趋:=(llv(短趋,2)+llv(短趋,4)+llv(短趋,6))/3;
立桩量:=filter(vol=hhv(vol,10) and vol>2*ref(vol,1) and close>短趋,5);
突破:=if(barslast(立桩量)=1 and close>ref(high,1),1,if(barslast(立桩量)=2 and close>ref(high,2),1,if(barslast(立桩量)=3 and close>ref(high,3),1,0)))=1;
三天法则:=if(barslast(立桩量)=1 and close>ref(low,1),1,if(barslast(立桩量)=2 and close>ref(low,2),1,if(barslast(立桩量)=3 and close>ref(low,3),1,0)))=1;
ma5:=ma(c,5);
ma10:=ma(c,10);
ma20:=ma(c,20);
ma30:=ma(c,30);
ma120:=sma(c,120,1);
zh520:=abs(ma5-ma20)/ma20*100<=10;
zh530:=abs(ma5-ma30)/ma30*100<=10;
qsxs1:=ma5>ref(ma5,1);
qsxs2:=ma20>ref(ma20,1);
qsxs3:=ma30>ref(ma30,1);
dtpl:=ma20>ma30 and ma30>ma120;
lyht:=dtpl and qsxs2 and qsxs3 and not(qsxs1) and ref(qsxs1,1);

{三dk线}
tj:=close>open or close=open and close>ref(close,1);
stickline(tj,close,open,7,0),color000045;
stickline(tj,close,open,6,0),color000065;
stickline(tj,close,open,5,0),color000085;
stickline(tj,close,open,4,0),color0000a5;
stickline(tj,close,open,3,0),color0000c5;
stickline(tj,close,open,2,0),color0000e5;
stickline(tj,high,low,1,0),color0000f5;
stickline(not(tj),close,open,7,0),color353500;
stickline(not(tj),close,open,6,0),color454500;
stickline(not(tj),close,open,5,0),color555500;
stickline(not(tj),close,open,4,0),color656500;
stickline(not(tj),close,open,3,0),color757500;
stickline(not(tj),close,open,2,0),color858500;
stickline(not(tj),high,low,1,0),color959500;

tjts:=backset(islastbar,5);
早晨之星:=ref(close,2)/ref(open,2)<0.95 and ref(open,1)<ref(close,2) and (abs(ref(open,1)-ref(close,1)))/ref(close,1)<0.03 and close/open>1.05 and close>ref(close,2);
黄昏之星:=ref(close,2)/ref(open,2)>1.03 and ref(open,1)>ref(close,2) and (abs(ref(open,1)-ref(close,1)))/ref(close,1)<0.02 and close/open<0.97 and close<ref(close,2);
长十字:=close=open and high/low>1.03;
垂死十字:=close=open and close=low and close<>high;
早晨十字星:=ref(close,2)/ref(open,2)<0.95 and ref(open,1)<ref(close,2) and ref(open,1)=ref(close,1) and close/open>1.05 and close>ref(close,2);
黄昏十字星:=ref(close,2)/ref(open,2)>1.05 and ref(open,1)>ref(close,2) and ref(open,1)=ref(close,1) and close/open<0.95 and close<ref(close,2);
射击之星:=min(open,close)=low and high-low>3*(max(open,close)-low) and close>ma(close,5);
倒转锤头:=min(open,close)=low and high-low>3*(max(open,close)-low) and close<ma(close,5);
锤头:=high=max(open,close) and high-low>3*(high-min(open,close)) and close<ma(close,5);
吊颈:=high=max(open,close) and high-low>3*(high-min(open,close)) and close>ma(close,5);
穿头破脚:=ref(close,1)/ref(open,1)>1.03 and close/open<0.96 and close<ref(open,1) and open>ref(close,1) or ref(close,1)/ref(open,1)<0.97 and close/open>1.04 and close>ref(open,1) and open<ref(close,1);
乌云盖顶:=ref(close,1)/ref(open,1)>1.03 and close/open<0.97 and open>ref(close,1) and close<ref(close,1);
曙光初现:=ref(close,1)/ref(open,1)<0.97 and close/open>1.03 and open<ref(close,1) and close>ref(close,1);
身怀六甲:=(abs(ref(close,1)-ref(open,1)))/ref(close,1)>0.04 and (abs(close-open))/close<0.005 and max(close,open)<max(ref(close,1),ref(open,1)) and min(close,open)>min(ref(close,1),ref(open,1));
十字胎:=(abs(ref(close,1)-ref(open,1)))/ref(close,1)>0.04 and close=open and close<max(ref(close,1),ref(open,1)) and close>min(ref(close,1),ref(open,1));
平顶:=(abs(high-ref(high,1)))/high<0.001;
平底:=(abs(low-ref(low,1)))/low<0.001 and (abs(ref(low,1)-ref(low,2)))/ref(low,1)<=0.001;
大阳烛:=close/open>1.05 and high/low<close/open+0.018;
三个白武士:=ref(close,2)>ref(open,2) and ref(close,1)>ref(open,1) and close>open and ref(close,1)>ref(close,2) and close>ref(close,1);
双飞乌鸦:=ref(close,1)<ref(open,1) and close<open and close/open<0.98;
孕育线:=ref(close,2)>ref(open,2) and (ref(close,2)-ref(open,2))/ref(open,2)>=2/100 and ref(open,1)>=ref(close,1) and (ref(open,1)-ref(close,1))/ref(close,1)<=2/100 and ref(open,1)<=ref(close,2) and ref(close,1)>=ref(open,2) and close>=open and (close-open)/open>=2/100 and close>=ref(open,1) and open<=ref(close,1) and (max(close,ref(close,2))-min(close,ref(close,2)))/min(close,ref(close,2))<=1/100;
多方炮:=ref(close,2)>ref(open,2) and ref(close,1)<ref(open,1) and close>open;
出水芙蓉:=(open<ema(close,20) or open<ema(close,40) or open<ema(close,60)) and close>max(ema(close,20),max(ema(close,40),ema(close,60))) and vol/ma(vol,30)>1.2 and close/ref(close,1)>1.049;
上升三部曲:=ref(close,4)/ref(open,4)>1.03 and ref(close,3)<ref(open,3) and ref(close,2)<ref(open,2) and ref(close,1)<ref(open,1) and ref(low,4)<ref(low,3) and ref(low,4)<ref(low,2) and ref(low,4)<ref(low,1) and ref(high,4)>ref(high,3) and ref(high,4)>ref(high,2) and ref(high,4)>ref(high,1) and close/open>1.03 and close>ref(close,4);
下跌三部曲:=ref(close,4)/ref(open,4)<0.97 and ref(close,3)>ref(open,3) and ref(close,2)>ref(open,2) and ref(close,1)>ref(open,1) and ref(low,4)<ref(low,3) and ref(low,4)<ref(low,2) and ref(low,4)<ref(low,1) and ref(high,4)>ref(high,3) and ref(high,4)>ref(high,2) and ref(high,4)>ref(high,1) and close/open<0.97 and close<ref(close,4);
跳空缺口:=high<ref(low,1) or low>ref(high,1);
三只乌鸦:=ref(close,2)<ref(open,2) and ref(close,1)<ref(open,1) and close<open and ref(close,1)<ref(close,2) and close<ref(close,1);
光脚阴线:=low=close and high<>low;
光头阳线:=high=close and high<>low;
分离:=open=ref(open,1) and (close-open)*(ref(close,1)-ref(open,1))<0;
长下影:=(min(close,open)-low)/(high-low)>0.667;
长上影:=(high-max(close,open))/(high-low)>0.667;
十字星:=close=open and high<>low;
大阴烛:=open/close>1.05 and high/low<open/close+0.018;
好友反攻:=ref(close,1)<ref(open,1) and close>open and (abs(close-ref(close,1)))/close<0.002 or ref(close,1)>ref(open,1) and close<open and (abs(close-ref(close,1)))/close<0.002;
倾盆大雨:=ref(close,1)/ref(open,1)>=1.03 and open<ref(close,1) and open>ref(open,1) and close<ref(open,1);
立桩量k线:=filter(三天法则 and 突破,3);
老鸭回头:=lyht;
∠45升:=filter(atan(ema(maj,13)-ref(ema(maj,13),1))*3.1416*10>1 and ema(maj,13)>ref(ema(maj,8),1),10);
tj1:=if(倾盆大雨 and tjts,'倾盆大雨,见顶信号‖','');
tj2:=if(大阴烛 and tjts,'大阴烛,后市向淡,发生逆转‖','');
tj3:=if(好友反攻 and tjts,'好友反攻,跌势已尽,要展开一段反弹行情‖','');
tj4:=if(跳空缺口 and tjts,'跳空缺口,突破长期盘整,向上跳空,上涨行情开始;向下跳空,下跌行情开始‖','');
tj5:=if(光脚阴线 and tjts,'光脚阴线,下跌信号‖','');
tj6:=if(光头阳线 and tjts,'光头阳线,多方上攻,后市看涨‖','');
tj7:=if(三只乌鸦 and tjts,'三只乌鸦,可能见顶‖','');
tj8:=if(分离 and tjts,'分离,注意看涨和看跌分离‖','');
tj9:=if(长下影 and tjts,'长下影,持续下跌后出现,可能止跌;升势末期,须留意‖','');
tj10:=if(长上影 and tjts,'长上影,上档压力沉重,升势受阻‖','');
tj11:=if(下跌三部曲 and tjts,'下跌三部曲,下跌信号‖','');
tj12:=if(上升三部曲 and tjts,'上升三部曲,上涨信号‖','');
tj13:=if(早晨之星 and tjts,'早晨之星,见底回升‖','');
tj14:=if(黄昏之星 and tjts,'黄昏之星,见顶回落‖','');
tj15:=if(十字星 and tjts,'十字星,重要的警告信号,原趋势停顿或反转‖','');
tj16:=if(长十字 and tjts,'长十字,重要的警告信号,原趋势停顿或反转‖','');
tj17:=if(垂死十字 and tjts,'垂死十字,下跌信号‖','');
tj18:=if(早晨十字星 and tjts,'早晨十字星,上涨信号,见底回升‖','');
tj19:=if(黄昏十字星 and tjts,'黄昏十字星,趋势停顿或反转,下跌信号,见顶回落‖','');
tj20:=if(射击之星 and tjts,'射击之星,出现在短期的上升趋势,表明市场顶部就在眼前,可能见顶回落,可靠性低‖','');
tj21:=if(倒转锤头 and tjts,'倒转锤头构成一个看涨信号,可能见底回升‖','');
tj22:=if(锤头 and tjts,'锤头,可能见底回升,如有量配合,信号强烈‖','');
tj23:=if(吊颈 and tjts,'吊颈,上升行情见顶回落,顶部见顶信号‖','');
tj24:=if(平顶 and tjts,'平顶,摸高见顶,行将反转。但下跌力度较小‖','');
tj25:=if(穿头破脚 and tjts,'穿头破脚,顶部见顶回落‖','');
tj26:=if(乌云盖顶 and tjts,'乌云盖顶,见顶回落‖','');
tj27:=if(曙光初现 and tjts,'曙光初现,行情将演化为v型反转或止跌横盘趋势。后市见底回升‖','');
tj28:=if(身怀六甲 and tjts,'身怀六甲,底部见底回升;顶部见顶回落‖','');
tj29:=if(十字胎 and tjts,'十字胎‖','');
tj30:=if(平底 and tjts,'平底,探低见底,将反转上升,但力度较小‖','');
tj31:=if(大阳烛 and tjts,'大阳烛,上升行情中剧烈向上攀升,下跌行情中剧烈向上反弹‖','');
tj32:=if(三个白武士 and tjts,'三个白武士,收盘价上移,可能见底回升‖','');
tj33:=if(双飞乌鸦 and tjts,'双飞乌鸦,疲软见顶‖','');
tj34:=if(孕育线 and tjts,'孕育线,注意股价位置‖','');
tj35:=if(多方炮 and tjts,'多方炮,底部可能上涨,中间有可能中继上涨,顶部复合见顶‖','');
tj36:=if(出水芙蓉 and tjts,'出水芙蓉,阳线穿过20、40、60日季均线,上攻势头初现‖','');
tj37:=if(立桩量k线 and tjts,'立桩量,启动信号‖','');
tj38:=if(∠45升 and tjts,'∠45升,上攻信号‖','');
tj39:=if(老鸭回头 and tjts,'老鸭回头,上攻信号‖','');
tj:='【k线形态】'+tj1+tj2+tj3+tj4+tj5+tj6+tj7+tj8+tj9+tj10+tj11+tj12+tj13+tj14+tj15+tj16+tj17+tj18+tj19+tj20+tj21+tj22+tj23+tj24+tj25+tj26+tj27+tj28+tj29+tj30+tj31+tj32+tj33+tj34+tj35+tj36+tj37+tj38+tj39;
drawtext(sysparam(2)=barscount(close),close,tj),align5,pxdn6,color5bbbb5;

lc:=ref(close,1);
品种强弱:=(sma(max(close-lc,0),n1,1))/(sma(abs(close-lc),n1,1))*100;
cc:="1a0001$close";
ff:="399001$close";
lc1:=ref(if(inblock('深圳a股')=1,ff,cc),1);
指数强弱:=(sma(max((if(inblock('深圳a股')=1,ff,cc))-lc1,0),n1,1))/(sma(abs((if(inblock('深圳a股')=1,ff,cc))-lc1),n1,1))*100;
强弱度:=品种强弱-指数强弱;

涨幅比:=100*(close/ref(close,1)-1);
跌幅比:=100*(1-close/ref(close,1));
explain(1,' '+'图形分析'),colorffff;
早晨之星的中部:=(abs(ref(open,1)-ref(close,1)))/ref(close,1);
早晨两日前倍比:=(ref(open-close,2))/ref(open,2)/早晨之星的中部;
早晨今日倍比:=(close-open)/open/早晨之星的中部;
早晨:=ref(isdown,2) and 早晨两日前倍比>3 and 早晨之星的中部<0.03 and ref(open,1)<ref(close,2) and isup and 早晨今日倍比>3 and close>ref(close,2);
explain(早晨,' '+'早晨之星'),color3300ff;
explain(早晨,'若低位上涨即将启动,若在高位请小心冲高出货'),color6633cc;
explain(早晨,'可靠性排序一');
黄昏之星的中部:=(abs(ref(open,1)-ref(close,1)))/ref(close,1);
黄昏两日前倍比:=(abs(ref(open-close,2)))/ref(open,2)/黄昏之星的中部;
黄昏今日倍比:=(abs(close-open))/open/黄昏之星的中部;
黄昏:=ref(isup,2) and 黄昏两日前倍比>3 and 黄昏之星的中部<0.03 and ref(open,1)>ref(close,2) and isdown and 黄昏今日倍比>3 and close<ref(close,2);
explain(黄昏,' '+'黄昏之星'),colorff00;
explain(黄昏,'进入盘整期或者下跌期,具体视行情而定'),colorccff33;
explain(黄昏,'可靠性排序一');
十字星:=(abs(close-open))/close<0.004 and (abs(low-if(isup,open,close)))/close>0.004 and high>if(isup,close,open);
explain(十字星,' '+'十字星'),colorff6600;
explain(十字星,'转折信号,升势末期效果显著'),colorccff33;
explain(十字星,'其它位置需要配合第二日确认'),colorffcc33;
explain(ref(十字星,1) and isdown,' '+'黄昏十字星'),colorff00;
explain(ref(十字星,1) and isdown,'在上升势头中出现,后市走跌'),colorccff33;
explain(ref(十字星,1) and isdown,'在下跌势头中出现,跌势趋缓'),colorccff99;
explain(ref(十字星,1) and isdown,'在盘整中出现,需要配合周边态势'),colorccff99;
explain(ref(十字星,1) and isup,' '+'早晨十字星'),color3300ff;
explain(ref(十字星,1) and isup,'在下跌势头中出现早晨十字星,后市走高'),color6633cc;
explain(ref(十字星,1) and isup,'在上升势头中出现早晨十字星,涨势趋缓'),colorcccccc;
explain(十字星,'可靠性排序三');
垂死十字:=if(close>20,(abs(close-open))/close<=0.004 and (abs(if(isup,open,close)-low))/close<=0.002 and (high-if(isup,close,open))/close>0.004,close=open and high>open and low=close);
explain(垂死十字,' '+'垂死十字'),colorff00;
explain(垂死十字,'顶部看空,淡气逼人'),colorccff33;
射击之星:=abs(close-open)<abs(high-if(isup,close,open)) and (abs(close-open))/close>0.004 and (abs(if(isup,open,close)-low))/close<=0.004;
非标准射击之星:=(abs(close-open))/close>0.004 and (abs(if(isup,open,close)-low))/close<=0.004 and (abs(high-if(isup,close,open)))/close>0.004;
explain(射击之星,' '+'射击之星'),colorff6600;
explain(射击之星,'升、跌、盘,转折预警'),colorffcc33;
explain(非标准射击之星 and not(射击之星),' '+'非标准射击之星'),colorff6600;
explain(非标准射击之星 and not(射击之星),'非标准的射击之星,但具有参考意义'),colorffcc33;
explain(射击之星,'可靠性排序四');
锤头:=(abs(if(isup,close,open)-high))/close<0.004 and low<if(isup,open,close) and (if(isup,open,close)-low)/(if(isup,close,open)-if(isup,open,close))>=2;
非标准锤头:=(abs(if(isup,close,open)-high))/close>0.004 and (abs(if(isup,close,open)-high))/close<0.001 and low<if(isup,open,close);
explain(锤头,' '+'锤头'),colorff6600;
explain(锤头,'转折信号,上影越短下影越长可靠度越高'),colorffcc33;
explain(锤头,'低谷初阳或者高位初阴可靠度更高'),colorffcc33;
explain(非标准锤头 and not(锤头),' '+'非标准锤头'),colorff6600;
explain(非标准锤头 and not(锤头),'严格地说这不是一个锤头,但具有转折参考意义'),colorffcc33;
explain(锤头,'可靠性排序四');
穿头破脚:=isdown and ref(isup,1) and open>ref(close,1) and close<ref(open,1) or isup and ref(isdown,1) and open<ref(close,1) and close>ref(open,1);
穿两日:=ref(isup,2) and open>ref(close,2) and close<ref(open,2) or ref(isdown,2) and open<ref(close,2) and close>ref(open,2);
explain(穿头破脚,' '+'穿头破脚'),colorff6600;
explain(穿头破脚 and isup,'若低位,收阳,则反转上升'),color6633cc;
explain(穿头破脚 and isup,'若高位,收阳,盘整向下'),color6633cc;
explain(穿头破脚 and isdown,'若高位,收阴,则反转下降'),colorccff33;
explain(穿头破脚,'翌日确认的信号更加可靠'),colorffcc33;
explain(穿头破脚 and vol>ref(vol,1),'配合交易量放大,可靠度较高'),colorffcc33;
explain(穿头破脚 and 穿两日,'今日k线覆盖前两日,反转明显'),colorff6600;
explain(穿头破脚,'可靠性排序二');
乌云盖顶:=ref(isup,1) and isdown and ref(close/open>1.03,1) and close>ref(open,1) and close<ref(close,1) and open>ref(close,1) and open>ref(high,1) and (close-ref(open,1))/(ref(close,1)-close)<1.22;
非标准乌云盖顶:=ref(isup,1) and isdown and ref(close/open>1.03,1) and close>ref(open,1) and open>ref(close,1) and close-ref(open,1)<ref(close,1)-close;
explain(乌云盖顶,' '+'乌云盖顶'),colorff00;
explain(乌云盖顶,'行情见顶回落信号'),colorccff33;
explain(乌云盖顶,'影线越短越好并观察交易量是否存在夺路而逃的放大'),colorccff33;
explain(非标准乌云盖顶 and not(乌云盖顶),' '+'非标准乌云盖顶'),colorff00;
explain(非标准乌云盖顶 and not(乌云盖顶),'不是一个标准的乌云盖顶,若出现在顶部具有参考意义'),colorccff33;
explain(乌云盖顶,'可靠性排序六');
曙光初现:=ref(isdown,1) and isup and ref(close/open<0.97,1) and open<ref(close,1) and close<ref(open,1) and ref(open,1)-close<close-ref(close,1);
explain(曙光初现,' '+'曙光初现'),color3300ff;
explain(曙光初现,'行情见底升信号,影线越短越好'),color6633cc;
explain(曙光初现,'可靠性排序七');
身怀六甲:=ref(isup,1) and ref(close/open>1.03,1) and if(isup,close,open)<ref(close,1) and if(isup,open,close)>ref(open,1) or ref(isdown,1) and ref(close/open<0.97,1) and if(isup,close,open)<ref(open,1) and if(isup,open,close)>ref(close,1);
explain(身怀六甲,' '+'身怀六甲'),colorff6600;
explain(身怀六甲,'力度减弱,行情趋缓或者转势'),colorffcc33;
explain(身怀六甲 and isdown,'高位多为见顶转跌'),colorccff33;
explain(身怀六甲 and isdown,'低位多为缓跌慢升'),colorffcc33;
explain(身怀六甲 and isup,'低位多为见底转升'),color6633cc;
explain(身怀六甲 and isup,'高位多为冲高速降'),colorccff99;
explain(身怀六甲 and close=open,'十字胎趋缓转折'),colorff6600;
explain(身怀六甲,'可靠性排序五');
平顶:=ref(high,1)>ref(high,2) and (ref(high,1)=high or if(isup,close,open)=if(ref(isup,1),ref(close,1),ref(open,1))) and close<hhv(high,2);
平底:=ref(low,1)<ref(low,2) and ref(low,1)=low or if(isup,open,close)=if(ref(isup,1),ref(open,1),ref(close,1));

explain(平顶,' '+'平顶'),colorff6600;
explain(平顶,'转向形态,高位有效'),colorffcc33;
explain(平底,' '+'平底'),colorff6600;
explain(平底,'转向形态,低位有效'),colorffcc33;
explain(平底 or 平顶,'首先准确判断'),colorffcc33;
explain(平底 or 平顶,'是上升初、中、末期'),colorffcc33;
explain(平底 or 平顶,'还是下跌初、中、末期'),colorffcc33;
各种形态:=早晨 or 黄昏 or 十字星 or 射击之星 or 锤头 or 穿头破脚 or 乌云盖顶 or 曙光初现 or 身怀六甲 or 非标准乌云盖顶 or 非标准锤头;
explain(平底 and 各种形态,'平底组合其它形态,可信度高'),colorff6600;
explain(平顶 and 各种形态,'平顶组合其它形态,可信度高'),colorff6600;
好友反攻:=isup and ref(isdown,1) and close=ref(close,1);
explain(好友反攻,' '+'好友反攻'),color3300ff;
explain(好友反攻,'见底反攻形态'),color6633cc;
淡友反攻:=isdown and ref(isup,1) and close=ref(close,1);
explain(淡友反攻,' '+'淡友反攻'),colorff00;
explain(淡友反攻,'见顶反攻形态'),colorccff33;
三兵:=all(isup,3) and all(close>ref(close,1),2) and ref(isdown,3) and all(涨幅比>0.5,3);
大兵:=all(涨幅比>ref(涨幅比,1),2) and 三兵;
小兵:=all(涨幅比<ref(涨幅比,1),2) and 三兵;
explain((小兵 or 大兵),' '+'三兵形态'),colorff6600;
explain(大兵,'放大三阳,后市看好'),color6633cc;
explain(小兵,'缩小三阳,后市看淡,第三k线影线较长,蜡烛部分较短'),colorccff33;
两只乌鸦:=ref(close,1)>ref(if(isup,close,open),2) and open>ref(open,1) and close<ref(close,1) and all(isdown,2);
explain(两只乌鸦,' '+'两只乌鸦'),colorff00;
explain(两只乌鸦,'连续高开却上冲无力'),colorccff33;
explain(两只乌鸦,'特别注意在高位的信号'),colorccff33;
explain(两只乌鸦,'若在中期出现,需要对消息面和人气进行分析'),colorff6600;
explain(两只乌鸦,'若在低位出现说明人气开始回升只是力量还不够,可以在之后的适当价位介入'),colorffcc33;
三只乌鸦:=all(isdown,3) and all(close<ref(close,1),2) and all(open<ref(open,1) and open>ref(close,1),2);
explain(三只乌鸦,' '+'三只乌鸦'),colorff00;
explain(三只乌鸦,'行情严重向淡'),colorccff33;
塔形顶:=跌幅比>3 and barslast(涨幅比>3) and all(if(isup,close,open)>open and if(isup,close,open)>ref(close,barslast(涨幅比>3)),barslast(涨幅比>3));
explain(塔形顶,'塔形顶');
上升三部曲预备:=ref(涨幅比,barslast(isup))>any(跌幅比,barslast(isup)-1) and all(isdown,barslast(isup)-1) and ref(close,barslast(isup))>hhv(open,barslast(isup)-1) and ref(open,barslast(isup))<llv(close,barslast(isup)-1);
explain(上升三部曲预备,'上升三部曲前奏'),color3300ff;
explain(上升三部曲预备,'连续的下跌却一直没有跌破前一根阳线'),color6633cc;
explain(上升三部曲预备,'后期看涨可以介入'),color6633cc;
explain(上升三部曲预备,'建议等待阳线确认上升'),color6633cc;
看好:=早晨 or ref(十字星,1) and isup or 穿头破脚 and isup or 曙光初现 or 平底 and low=llv(low,4) or 好友反攻 or 大兵;
看空:=黄昏 or ref(十字星,1) and isdown or 垂死十字 or 穿头破脚 and isdown or 乌云盖顶 or 非标准乌云盖顶 or 平顶 or 淡友反攻 or 小兵;
中立:=射击之星 or 十字星 or 锤头 or 非标准锤头 or 非标准射击之星 or 身怀六甲;
交易量比较:=vol>ref(vol,2)*1.05;
蜡烛跳空:=if(isup,open,close)>ref(if(isup,close,open),1) or if(isup,close,open)<ref(if(isup,open,close),1);
跳空:=low>ref(high,1) or high<ref(low,1);
连续跳空:=ref(跳空,1) and 跳空;
explain(1,' '+'附加k线确认'),colorffff;
explain(ref(看好,1) and isup,'收阳确认昨日信号'),color3300ff;
explain(ref(看空,1) and isdown,'收阴确认昨日信号'),colorff00;
explain(ref(看空,1) and isup,'收阳降低了昨日信号的向淡强度'),colorccff99;
explain(ref(看好,1) and isdown,'收阴降低了昨日信号的向好强度'),colorccff99;
explain((早晨 or 黄昏),'请自行分析买卖力道是否存在由被动性沽盘到主动性沽盘的转变'),colorffcc33;
explain(跳空 and (看好 or 看空 or 中立),'跳空星体信号,可靠度高,星体越小越可靠'),colorffcc33;
explain(连续跳空 and (ref(看好 or 看空 or 中立,1)),'再次跳空确认昨天的星体信号高度可靠'),colorffcc33;
explain(ref(锤头,1) and isdown and close<ref(low,1),'今日走跌是对昨日锤头见顶信号的确认'),colorccff33;
explain(ref(上升三部曲预备,1) and isup and 涨幅比>3,'阳线收复下跌空间拉升在即'),color3300ff;
explain(close>ref(high,1) and 品种强弱>=ma(品种强弱,5),'多头攻击k线\n做多以当日最低价为止损位'),colorccff99;
explain(close<ref(low,1) and high<ref(high,1) and 品种强弱<ma(品种强弱,8),'空头攻击k线\n多头注意止损'),colorccff33;
explain(high>ref(high,1) and low<ref(low,1) and close>open and 品种强弱>=ma(品种强弱,5),'变盘k线,\n多头设置当日最低点为止损位'),colorccff33;
explain(high>ref(high,1) and low<ref(low,1) and close<=open,'变盘k线,\n多头小心,设置当日最低点为止损位'),colorccff99;
//技术指标;

explain(c,' '+'技术指标'),colorffff;

{kdj}
日k:="kdj.k#day"(20,5,5);
日d:="kdj.d#day"(20,5,5);
周k:="kdj.k#week"(9,3,3);
周d:="kdj.d#week"(9,3,3);
explainex(周k>0 and 周k<=20,'低位/周线k=',周k,2,0);
explainex(周k>0 and 周k>=80,'高位/周线k=',周k,2,0);
explainex(周k>0 and (周k>20 and 周k<50),'中低/周线k=',周k,2,0);
explainex(周k>0 and (周k>50 and 周k<80),'中高/周线k=',周k,2,0);
explainex(日k>0 and 日k<=20,'低位/日线k=',日k,2,0);
explainex(日k>0 and 日k>=80,'高位/日线k=',日k,2,0);
explainex(日k>0 and (日k>20 and 日k<50),'中低/日线k=',日k,2,0);
explainex(日k>0 and (日k>50 and 日k<80),'中高/日线k=',日k,2,0);
explain((cross(日k,日d)),'日k与日d今日金叉');
explain((cross(日d,日k)),'日k与日d今日死叉');
explain((cross(周k,周d)),'周k与周d今日金叉');
explain((cross(周d,周k)),'周k与周d今日死叉');

kdj_a2:=barslast(ref(cross("kdj.k","kdj.d"),1));
kdj_b2:=ref(c,kdj_a2+1)>c and ref("kdj.k", kdj_a2+1)<"kdj.k" and cross("kdj.k","kdj.d");
explain(kdj_b2>0,'kdj底背离');
kdj_c2:=barslast(ref(cross("kdj.d","kdj.k"),1));
kdj_d2:=ref(c,kdj_c2+1)<c and ref("kdj.k",kdj_c2+1)>"kdj.k" and cross("kdj.d","kdj.k");
explain(kdj_d2>0,'kdj顶背离');
explain("kdj.j"<20, 'kdj之j值小于20');
explain("kdj.j">80, 'kdj之j值大于80');
explain("kdj.k">"kdj.d",'kdj之k值大于d值');
explain("kdj.k"<"kdj.d",'kdj之k值小于d值');

{rsi}
rsi_a1:=barslast(ref(cross("rsi.rsi1","rsi.rsi2"),1));
rsi_b1:=ref(c,rsi_a1+1)>c and ref("rsi.rsi1",rsi_a1+1)<"rsi.rsi1" and cross("rsi.rsi1","rsi.rsi2");
explain ("rsi.rsi1"<20, 'rsi超卖');
explain (rsi_b1>0,'rsi底背离');
rsi_a2:=barslast(ref(cross("rsi.rsi2","rsi.rsi1"),1));
rsi_b2:=ref(c, rsi_a2+1)<c and ref("rsi.rsi1", rsi_a2+1)>"rsi.rsi1" and cross("rsi.rsi2","rsi.rsi1");
explain("rsi.rsi1">80, 'rsi超买');
explain(rsi_b2>0,'rsi顶背离');
explain("rsi.rsi1">"rsi.rsi2", 'rsi多头');
explain("rsi.rsi1"<"rsi.rsi2", 'rsi空头');
{macd}
macd_a1:=barslast(ref(cross("macd.diff","macd.dea"),1));
macd_b1:=ref(c, macd_a1+1)>c and ref("macd.diff", macd_a1+1)<"macd.diff" and cross("macd.diff","macd.dea");
explain(macd_b1>0,'macd底背离');
macd_a2:=barslast(ref(cross("macd.dea","macd.diff"),1));
macd_b2:=ref(close, macd_a2+1)<close and ref("macd.diff", macd_a2+1)>"macd.diff" and cross("macd.dea","macd.diff");
explain (macd_b2>0,'macd顶背离');
jc:=cross("macd.diff","macd.dea");
sc:=cross("macd.dea","macd.diff");
dcjc:=jc and "macd.dea">0;
explain((jc and "macd.dea">0),'macd在0轴上金叉');
explain((jc and "macd.dea"<0),'macd在0轴下金叉');
explain((sc and "macd.dea">0),'macd在0轴上死叉');
explain((sc and "macd.dea"<0),'macd在0轴下死叉');
explain(("macd.macd">0 and "macd.macd">ref("macd.macd",1)),'macd红柱增长');
explain(("macd.macd">0 and "macd.macd"<ref("macd.macd",1)),'macd红柱缩短');
explain(("macd.macd"<0 and abs("macd.macd")>ref(abs("macd.macd"),1)),'macd绿柱增长');
explain(("macd.macd"<0 and abs("macd.macd")<ref(abs("macd.macd"),1)),'macd绿柱缩短');
explain((count(dcjc,20)=2 and jc and "macd.dea">0),'0轴上2次金叉');
explain((count(dcjc,20)=3 and jc and "macd.dea">0),'0轴上3次金叉');
explain((count(dcjc,20)=4 and jc and "macd.dea">0),'0轴上4次金叉');

{dmi}
pdi:=sum(max(max(high-low,abs(high-ref(close,1))),abs(low-ref(close,1))),14);
mdi:=high-ref(high,1);
adx:=ref(low,1)-low;
adxr:=sum(if(mdi>0 and mdi>adx,mdi,0),14);
typ:=sum(if(adx>0 and adx>mdi,adx,0),14);
cci:=adxr*100/pdi;
wr:=typ*100/pdi;
mtm:=ma((abs(wr-cci))/(wr+cci)*100,6);
mtmma:=(mtm+ref(mtm,6))/2;
explain(cross(cci,wr),'pdi向上突破mdi,新多头进场,买进信号'),colorff;
explain(cross(wr,cci),'pdi向下跌破mdi,新空头进场,卖出信号'),colorff00;
explain(mtm>ref(mtm,1),'adx值持续高于前一日,行情将维持原趋势'),colorffff00;
explain(mtm<ref(mtm,1) and mtm<20,'adx值递减,降到20以下,且横向行进,市场盘整'),colorffff;
explain(mtm<ref(mtm,1) and ref(mtm,1)<ref(mtm,2) and ref(mtm,2)>ref(mtm,3) and ref(mtm,3)>ref(mtm,4),'adx值上升倾向转为下降,行情即将反转'),color99ff;
{boll}
psy:=close-ref(close,6);
布尔1:=ma(psy,6);
explain(cross(psy,布尔1) and 布尔1<-0.8,'mtm突破mtmma,买入信号'),colorff;
explain(cross(布尔1,psy) and 布尔1>0.8,'mtm跌破mtmma,卖出信号'),colorff00;
布尔2:=ref(close,1);
布尔3:=(sma(max(close-布尔2,0),6,1))/(sma(abs(close-布尔2),6,1))*100;
布尔4:=(sma(max(close-布尔2,0),12,1))/(sma(abs(close-布尔2),12,1))*100;
explain(布尔3>85,'6日rsi突破85超买,防回挡,卖出信号'),colorffff00;
explain(布尔3<15,'6日rsi跌破15超卖,可能反弹,买进信号'),colorffff;
布尔5:=(count(close>ref(close,1),12))/12*100;
布尔6:=(ma(close,3)+ma(close,6)+ma(close,12)+ma(close,24))/4;
布尔7:=布尔6+3*std(布尔6,10);
xx:=布尔6-3*std(布尔6,10);
a001:=(布尔7-xx)/布尔7<0.03;
a002:=(布尔7-xx)/布尔7>0.18;
a003:=(ma(close,60)-ma(close,5))/ma(close,60)>0.15;
a004:=(ma(close,5)-ma(close,60))/ma(close,5)>0.15;
explain(a001,'多空布尔收敛中,有变盘可能'),colorffff00;
explain(a003 and a002 and close>open,'布尔上下乖离太大,有反弹可能'),colorffff;
explain(a004 and a002 and close<open,'布尔上下乖离太大,有回落可能'),colorff00;

var01:=(2*close+high+low)/4;
var02:=wma(wma(wma(var01,4),4),4);
j:=(var02-ref(var02,1))/ref(var02,1)*100;
d:=ma(j,3);
k:=ma(j,1);
高级macd出现:=any(cross(k,d),3) and not(any(cross(d,k),3)) and 看好 or any(cross(d,k),3) and not(any(cross(k,d),3)) and 看空;
explain(高级macd出现,' '+'高级macd'),colorff6600;
//explainicon(any(cross(k,d),2) and not(any(cross(d,k),2)) and 看好,2);
//explainicon(any(cross(d,k),2) and not(any(cross(k,d),2)) and 看空,1);
explain(高级macd出现,'中低参考');
var002:=ref(low,1);
var003:=(sma(abs(low-var002),13,1))/(sma(max(low-var002,0),13,1))*100;
var004:=ema(if(close*1.2,var003*13,var003/13),13);
var005:=llv(low,34);
var006:=hhv(var004,34);
var007:=if(llv(low,56),1,0);
var008:=(ema(if(low<=var005,(var004+var006*2)/2,0),3))/(618)*var007;
var009:=ema(close,5);
var0010:=(close-ma(close,34))/ma(close,34)*(-10);
xl1:=ma(low,2)*0.96;
xl2:=ma(low,26)*0.85;
抄底:=ref(xl1,1)<xl2 and ref(xl1,1)<xl1 and ref(xl1,1)<ref(xl1,2);
跟进:=var008>ref(var008,1);
explain((any(跟进 or 抄底,3)) and 看好,' '+'跟庄抄底'),colorff6600;
explainicon((any(跟进 or 抄底,3)) and 看好,3);
explain((any(跟进 or 抄底,3)) and 看好,'形态位置好配合信号介入成功率极高‖中高参考');
//drawicon((any(跟进 or 抄底,3)) and 看好,2,1);
线1:=(ma(close,5)+ma(close,10)+ma(close,25))/3;
线2:=(ma(close,5)+ma(close,10)+ma(close,20)+ma(close,30)+ma(close,60)+ma(close,120))/6;
线3:=(ma(close,20)+ma(close,60)+ma(close,120))/3;
线4:=(ma(close,13)+ma(close,34)+ma(close,55))/3;
explain(cross(线1,线4),' '+'跟进买入‖高度参考'),colorff;
explainicon(cross(线1,线4),4);

//drawicon(cross(线1,线4),4,3);
varl1:=100-90*(hhv(high,21)-close)/(hhv(high,21)-llv(low,21));
varl2:=100-90*(hhv(high,21)-close)/(hhv(high,21)-llv(low,21));
varl3:=100-ma(100*(hhv(high,6)-close)/(hhv(high,6)-llv(low,6)),34);
//drawicon(cross(varl2,ma(varl3,6)) and 看好,6,6);
//explain(if(not(高级macd出现) and not((any(跟进 or 抄底,3)) and 看好) and not(cross(线1,线4)),1,0),' '+'无'),colorff6600;
//drawicon(看好,10,6);
//drawicon(看空,10,7);
varl3:=ref(hhv(h,3)/llv(l,3)<=1.06,1) and c=hhv(c,4) and vol=hhv(vol,4);
explain((any(varl3,1)),'升浪中盘整突破、配合信号介入成功率高');

lc:=ref(close,1);
品种强弱:=(sma(max(close-lc,0),13,1))/(sma(abs(close-lc),13,1))*100;
cc:="1a0001$close";
ff:="399001$close";
lc1:=ref(if(inblock('深圳a股')=1,ff,cc),1);
指数强弱:=(sma(max((if(inblock('深圳a股')=1,ff,cc))-lc1,0),13,1))/(sma(abs((if(inblock('深圳a股')=1,ff,cc))-lc1),13,1))*100;
强弱度:=品种强弱-指数强弱;
explain(close>0,' '+'大盘强弱'),colorffff;
explain(强弱度>0,'现阶段强于大盘指数'),color3300ff;
explain(强弱度=0,'现阶段与大盘指数同步'),colorffcc33;
explain(强弱度<0,'现阶段弱于大盘指数'),colorccff33;
explain(品种强弱>=50,'现阶段属于强势'),color6633cc;
explain(品种强弱<50,'现阶段属于弱势'),colorccff33;
explain(品种强弱>=ma(品种强弱,8),'指标处于多头趋势'),color6633cc;
explain(品种强弱<ma(品种强弱,8),'指标处于空头趋势'),colorccff33;

qs1:=ema((21*ema(maj,3)+13*ema(maj,5)+5*ema(maj,13)+3*ema(maj,21)+8*ema(maj,8))/50,2);
partline(qs1<= ref(qs1,1),qs1),linethick2,colorffff60;
partline((qs1> ref(qs1,1)) or (ref(qs1,1)>ref(qs1,2) and ref(qs1,1)>qs1 and c>qs1),qs1),linethick2,color3200de;

m2:=ema(qs1,5);
m3:=ema(m2,5);
m4:=ema(m3,5);
m5:=ema(m4,5);
{partline(m2,m2),linethick1,colorgreen;
partline(m3,m3),linethick1,colorgreen;
partline(m4,m4),linethick1,colorgreen;
partline(m5,m5),linethick1,colorgreen;
partline(m2>ref(m2,1),m2),,color00b5ff;
partline(m3>ref(m3,1),m3),,color00b5ff;
partline(m4>ref(m4,1),m4),,color00b5ff;
partline(m5>ref(m5,1),m5),,color00b5ff;}

{qsf1:=fft(maj,n2);
partline((qsf1> ref(qsf1,1)),qsf1),linethick1,colorff;
partline((qsf1<= ref(qsf1,1)),qsf1),linethick1,colorgreen;}
{qs2:=fft(maj,n1);
partline((qs2> ref(qs2,1)),qs2),linethick1,color5c97d3;
partline((qs2<= ref(qs2,1)),qs2),linethick1,color5c9713;}
{通道上:=fft(high*0.9,n2);
通道下:=fft(low*1.1,n2);
a2:=通道上-ref(通道上,1);
a3:=通道下-ref(通道下,1);
partline(a2>0,通道上) linethick1 colorred;
partline(a2=0,通道上) linethick1 colorwhite;
partline(a2<0,通道上) linethick1 colorgreen;
partline(a3>0,通道下) linethick1 colorred;
partline(a3=0,通道下) linethick1 colorwhite;
partline(a3<0,通道下) linethick1 colorgreen;}

{bk:='板块指数';stksum:=stkcount(bk);dcount:=datacount;yygs4:='涨幅引用.a0';
variable:dmstr[stksum]='',var_px[stksum]=0,var_indi[stksum]=0;
for k=1 to stksum do
begin
dm:=stkfromblk(bk,k);
dmstr[k]:=dm;
temp1:=stkindi(dm,yygs4,0,-1);
var_px[k]:=temp1[dcount];
var_indi[k]:=temp1[dcount];
end;
num1:=sortpos(var_indi,1,1,stksum);
dm_max1:=var_indi[1]; dm_max2:=var_indi[2];dm_max3:=var_indi[3]; dm_max4:=var_indi[4];dm_max5:=var_indi[5];
max1:=var_px[dm_max1]; max2:=var_px[dm_max2]; max3:=var_px[dm_max3];max4:=var_px[dm_max4]; max5:=var_px[dm_max5];

drawtextex(1,1,500,920,'【领涨版块】'+stknameex(dmstr[dm_max1])+':'+numtostr(max1,2)+' '+stknameex(dmstr[dm_max2])+':'+numtostr(max2,2)+' ' +stknameex(dmstr[dm_max3])+':'+numtostr(max3,2)),color00ffff;
yygs5:='涨幅引用.a0';
variable:dmstr[stksum]='',var_px[stksum]=0,var_indi[stksum]=0;
for k=1 to stksum do
begin
dm:=stkfromblk(bk,k);
dmstr[k]:=dm;
temp1:=stkindi(dm,yygs5,0,-1);
var_px[k]:=temp1[dcount];
var_indi[k]:=temp1[dcount];
end;
num1:=sortpos(var_indi,0,1,stksum);
dm_max1:=var_indi[1];dm_max2:=var_indi[2];dm_max3:=var_indi[3]; dm_max4:=var_indi[4];dm_max5:=var_indi[5];
max1:=var_px[dm_max1]; max2:=var_px[dm_max2]; max3:=var_px[dm_max3];max4:=var_px[dm_max4]; max5:=var_px[dm_max5];
drawtextex(1,1,500,960,'【领跌版块】'+stknameex(dmstr[dm_max1])+':'+numtostr(max1,2)+' '+stknameex(dmstr[dm_max2])+':'+numtostr(max2,2)+' '+stknameex(dmstr[dm_max3])+':'+numtostr(max3,2)),colorffff00;}

//时间窗口
var31:=hhvbars(zig(3, 19)>ref(zig(3,19),1)
and ref(zig(3,19), 1)<ref(zig(3,19), 2),0);
drawtext(var31=2,low*0.98,'↑\n 3天'),align0,coloryellow;
drawtext(var31=4,high*1.06,' 5天\n↓'),align0,coloryellow;
drawtext(var31=7,low*0.98,'↑\n 8天'),align0,coloryellow;
drawtext(var31=12,high*1.06,' 13天\n↓'),align0,coloryellow;
drawtext(var31=20,low*0.98,'↑\n 21天'),align0,coloryellow;
drawtext(var31=33,high*1.06,' 34天\n↓'),align0,coloryellow;
drawtext(var31=54,low*0.98,'↑\n 55天'),align0,coloryellow;
drawtext(var31=88,high*1.06,' 89天\n↓'),align0,coloryellow;
drawtext(var31=143,low*0.98,'↑\n 144天'),align0,coloryellow;
drawtext(var31=232,high*1.06,' 233天\n↓'),align0,coloryellow;
drawtext(var31=376,low*0.98,'↑\n 376天'),align0,coloryellow;

{时段均价计算}
d:=datacount;gb:=sysparam(1);
周期:=d-gb+1,linethick;
额:=refx(sum(amount,周期),d-gb);
量:=refx(sum(vol*100,周期),d-gb);
总换:=refx(sum(vol,周期),d-gb)/capital*100,linethick;
均换:=(refx(sum(vol,周期),d-gb)/capital*100)/周期,linethick;
大盘:=(2*close+high+low)/4;
均价:=if(capital>0,额/量,refx(sum(大盘,周期),d-gb)/周期);
//drawline(barpos=sysparam(1) ,均价,barpos=sysparam(1)+1,ref(均价,1),1),colore1e100,linethick1;

{点石成金}
bc:=barslast(sysparam(1)=barpos)+1;
点石成金h:=if(close>100,sum(high*vol,bc)/sum(vol,bc),sum(amount,bc)/sum(vol,bc)/100*sum(high,bc)/sum(close,bc));
点石成金l:=if(close>100,sum(low*vol,bc)/sum(vol,bc),sum(amount,bc)/sum(vol,bc)/100*sum(low,bc)/sum(close,bc));
点石成金:=if(ref(high,bc-1)>ref(high,bc) and ref(high,bc-1)>ref(high,bc-2) ,点石成金h,点石成金l),color02bbf9,linethick1;
//drawtextex(close,1,800,50,'周 期:'+numtostr(周期,0)+' 天\n'
//+ '点石成金:'+numtostr(点石成金[datacount],2)+'元\n'
//+ '时段均价:'+numtostr(均价[datacount],2)+'元\n'
//+ '时段均换:'+numtostr(均换[datacount],2)+'%'),color00dddd;
drawtextex(1,1,20,50,'【 周 期 】: '+numtostr(周期,0)+' 天'),color0f7ac5;
drawtextex(1,1,20,90,'【时段均价】: '+numtostr(均价[datacount],2)+' 元'),color0f7ac5;
drawtextex(1,1,20,130,'【时段均换】: '+numtostr(均换[datacount],2)+' %'),color0f7ac5;
drawtextex(1,1,20,170,'【点石成金】: '+numtostr(点石成金[datacount],2)+' 元'),color0f7ac5;
drawtextex(1,1,20,210,'【总换手率】: '+numtostr(总换[datacount],0)+' %'),color0f7ac5;

ema30:=ema(close,30);
ema60:=ema(close,60);
ema128:=ema(close,128);
ema256:=ema(close,256);
sjt1:=if(ema30[sysparam(1)]>ema30[sysparam(1)-1],'↑','↓');
sjt2:=if(ema60[sysparam(1)]>ema60[sysparam(1)-1],'↑','↓');
sjt3:=if(ema128[sysparam(1)]>ema128[sysparam(1)-1],'↑','↓');
sjt4:=if(ema256[sysparam(1)]>ema256[sysparam(1)-1],'↑','↓');
drawtextex(1,1,20,300,'【 ema30 】: '+numtostr(ema30[sysparam(1)],2)+' 元 '+sjt1),color0f7ac5;
drawtextex(1,1,20,340,'【 ema60 】: '+numtostr(ema60[sysparam(1)],2)+' 元 '+sjt2),color0f7ac5;
drawtextex(1,1,20,380,'【 ema128 】: '+numtostr(ema128[sysparam(1)],2)+' 元 '+sjt3),color0f7ac5;
drawtextex(1,1,20,420,'【 ema256 】: '+numtostr(ema256[sysparam(1)],2)+' 元 '+sjt4),color0f7ac5;

sat:=if((amount/close)/(hhv(amount,20)/hhv(close,20))*100>100,100,(amount/close)/(hhv(amount,20)/hhv(close,20))*100);
sjt5:=if(sat[sysparam(1)]>sat[sysparam(1)-1],'↑','↓');
drawtextex(1,1,20,500,'【量能饱和度】: '+numtostr(sat[sysparam(1)],0)+' '+sjt5),linethick5,color0f7ac5;

{均价线:=ma(c,1),colordddddd;
expma:=均价线;

k0:=lbound(expma);k2:=ubound(expma);
for i=k0+1 to k2 do begin
expma[i]:(expma[i]-expma[i-1])/(nn+线数/2)+expma[i-1],colorwhite;
end;

if 线数=1 then exit;
expmb:=expma;
for i=k0+1 to k2 do begin
expmb[i]:(expma[i]-expmb[i-1])/(nn+线数/2)+expmb[i-1],colorfd04c5;
end;

if 线数=2 then exit;
expmc:=expmb;
for i=k0+1 to k2 do begin
expmc[i]:(expmb[i]-expmc[i-1])/(nn+线数/2)+expmc[i-1],color00ea00;
end;
if 线数=3 then exit;
expmd:=expmc;
for i=k0+1 to k2 do begin
expmd[i]:(expmc[i]-expmd[i-1])/(nn+线数/2)+expmd[i-1],coloraaffbb;
end;
if 线数=4 then exit;
expme:=expmd;
for i=k0+1 to k2 do begin
expme[i]:(expmd[i]-expme[i-1])/(nn+线数/2)+expme[i-1],coloreeff66;
end;
if 线数=5 then exit;
expmf:=expme;
for i=k0+1 to k2 do begin
expmf[i]:(expme[i]-expmf[i-1])/(nn+线数/2)+expmf[i-1],color00ccff;
end;
if 线数=6 then exit;
expmg:=expmf;
for i=k0+1 to k2 do begin
expmg[i]:(expmf[i]-expmg[i-1])/(nn+线数/2)+expmg[i-1],coloraa00ff,linedot;
end;}

{rsv:=(close-llv(low,13))/(hhv(high,13)-llv(low,13))*100;
k:=sma(rsv,3,1);
d:=sma(k,3,1);
j:=3*k-2*d;
rsv12:=(close-llv(low,34))/(hhv(high,34)-llv(low,34))*100;
k12:=sma(rsv12,3,1);
d12:=sma(k12,3,1);
j12:=3*k12-2*d12;
rsv24:=(close-llv(low,55))/(hhv(high,55)-llv(low,55))*100;
k24:=sma(rsv24,3,1);
d24:=sma(k24,3,1);
j24:=3*k24-2*d24;
压力位:if(cross(j24,j),h,ref(h,barslast(cross(j24,j)))),colorred,pointdot;
支撑位:if(cross(j,j24),l,ref(l,barslast(cross(j,j24)))),color77aaff,pointdot;}

{k_t1:ma(h,5)*(1+5/100);}

{drawtext(sysparam(1)=barpos and ma(c,5)>ref(ma(c,5),1),ma(c,5),' 5-'),pxup8,colorred;
drawtext(sysparam(1)=barpos and ma(c,10)>ref(ma(c,10),1),ma(c,10),' 10-'),pxup8,colorred;
drawtext(sysparam(1)=barpos and ma(c,20)>ref(ma(c,20),1),ma(c,20),' 20-'),pxup8,colorred;
drawtext(sysparam(1)=barpos and ma(c,30)>ref(ma(c,30),1),ma(c,30),' 30-'),pxup8,colorred;
drawtext(sysparam(1)=barpos and ma(c,60)>ref(ma(c,60),1),ma(c,60),' 60-'),pxup8,colorred;
drawtext(sysparam(1)=barpos and ma(c,90)>ref(ma(c,90),1),ma(c,90),' 90-'),pxup8,colorred;
drawtext(sysparam(1)=barpos and ma(c,120)>ref(ma(c,120),1),ma(c,120),'120-'),pxup8,colorred;
drawtext(sysparam(1)=barpos and ma(c,250)>ref(ma(c,250),1),ma(c,250),'250-'),pxup8,colorred;
drawtext(sysparam(1)=barpos and ma(c,5)<ref(ma(c,5),1),ma(c,5),' 5-'),pxup8,colorblue;
drawtext(sysparam(1)=barpos and ma(c,10)<ref(ma(c,10),1),ma(c,10),' 10-'),pxup8,colorblue;
drawtext(sysparam(1)=barpos and ma(c,20)<ref(ma(c,20),1),ma(c,20),' 20-'),pxup8,colorblue;
drawtext(sysparam(1)=barpos and ma(c,30)<ref(ma(c,30),1),ma(c,30),' 30-'),pxup8,colorblue;
drawtext(sysparam(1)=barpos and ma(c,60)<ref(ma(c,60),1),ma(c,60),' 60-'),pxup8,colorblue;
drawtext(sysparam(1)=barpos and ma(c,90)<ref(ma(c,90),1),ma(c,90),' 90-'),pxup8,colorblue;
drawtext(sysparam(1)=barpos and ma(c,120)<ref(ma(c,120),1),ma(c,120),'120-'),pxup8,colorblue;
drawtext(sysparam(1)=barpos and ma(c,250)<ref(ma(c,250),1),ma(c,250),'250-'),pxup8,colorblue;}

{缺口跟踪--听雪寻股}
{fh:=high;fl:=low;
for p=datacount-1 downto 1 do begin
if fh[p]<fh[p+1] then
fh[p]:=fh[p+1];
if fl[p]>fl[p+1] then
fl[p]:=fl[p+1];
end;
qk:=low>ref(high,1)or high<ref(low,1);
g:=if(low>ref(high,1),low,if(high<ref(low,1),ref(low,1),0));
d:=if(low>ref(high,1),ref(high,1),if(high<ref(low,1),high,0));
s:=if(low>ref(high,1),2,if(high<ref(low,1),1,0));
tjj:=s=2 and fl<=g and fl>=d or s=1 and fh<g and fh>=d ;

w:=barssince(backset(barstatus=2,barslast(tjj*barpos=barpos)+1))+1;
dd:=date;
最近缺口日:ref(dd,w-1)+19000000,linethick0,coloraaff33;
s1:=if(ref(s,w-1)=2,ref(fl,w-1),if(ref(s,w-1)=1,ref(fh,w-1),0));
s2:=if(ref(s,w-1)=2,ref(d,w-1),if(ref(s,w-1)=1,ref(g,w-1),0));
a:=max(s1,s2);
b:=min(s1,s2);
缺口:b[datacount],colorwhite,linethick,,precision2;
→:a[datacount],colorwhite,linethick,precision2;
stickline(w and s1<cost(50) and s1>cost(0),s1,s2,15,0),color8b795e;
//drawtext(barstatus=2,a,numtostr(b,2)+'-'+numtostr(a,2)),color000080,align2;//显示缺口数字 可删除
hh:=high;ll:=low;dd:=date;
gb:=sysparam(1);
上突缺口:=low>ref(high,1),color00eeff,linethick0;
下突缺口:=high<ref(low,1),coloree9933,linethick0;
xqs:=ubound(下突缺口),linethick0;
s111:=sumbars(上突缺口,1);
s211:=sumbars(上突缺口,2);
x111:=sumbars(下突缺口,1);
x211:=sumbars(下突缺口,2);
上突位置1:=gb-s111[gb]+1,linethick0;
下突位置1:=gb-x111[gb]+1,linethick0;
//drawtext(下突缺口,high,'△'),color026dd9,pxup15,align0;
//drawtext(下突缺口,ref(low,1),'▽'),color026dd9,align0;
//drawtext(上突缺口,low,'▽'),color008080,align0;
//drawtext(上突缺口,ref(high,1),'△'),color008080,pxup15,align0;
xq1:=ll[下突位置1-1];
xqd:=dd[下突位置1];
bxq:=count(range(barpos,下突位置1,xqs) and hh>xq1,xqs-下突位置1)=1;
bxq:=filter(bxq,xqs-下突位置1);
sq1:=hh[上突位置1-1];
sqd:=dd[上突位置1];
上缺日:=if(xqd<sqd,sqd+19000000,0),linethick0,color00eeff;
下缺日:=if(sqd<xqd,xqd+19000000,0),linethick0,coloree9933;
bsq:=count(range(barpos,上突位置1,xqs) and ll<sq1,xqs-上突位置1)=1;bsq:=filter(bsq,xqs-上突位置1);
//drawtext(bsq,(open+close)/2,' \n 补'+strright(numtostr(sqd,0),6)+'\n 上突缺口'),colorffffff;
//drawtext(bsq,sq1,'←'),align0,color00eeee;
//drawtext(bxq,(open+close)/2,' \n 补'+strright(numtostr(xqd,0),6)+'\n 下突缺口'),colorffffff;
//drawtext(bxq,xq1,'←'),align0,color00eeee;}

{买:ema(maj,2);
卖:ema(slope(maj,21)*20+maj,42);}

//股价尺
{input:w1(0,-1,1),w2(0.125,-1,1),w3(0.25,-1,1),w4(0.375,-1,1),w5(0.50,-1,1),
w6(0.625,-1,1),w7(0.75,-1,1),w8(0.875,-1,1),w9(1,-1,1);
//////以上参数根据自己需要可调
hhk:=h;
llk:=l;
光标:sysparam(6),linethick,color00aaff;
stickline(barpos=sysparam(1),光标,光标*0.999,600,0),color00aaff;
pp:=sysparam(1);
kk:=光标-c;
if kk[pp]>0 then begin
{光标向上}
起始l:llk[pp],color0066ff,linethick2;
涨幅统计:(光标-起始l)/起始l*100,linethick;

stickline(barpos=sysparam(1),起始l,光标,0.1,0),color00aaff;
drawtext(barpos=sysparam(1),起始l,'∨'),align0,pxup20,color00aaff;
drawtext(barpos=sysparam(1),光标,'∧'),align0,color00aaff;
drawtext(barpos=sysparam(1)-2,光标,numtostr(涨幅统计,3)),align2,pxup20,color00ffff;

x1:起始l*(1+w1),linedot,colorff9966;
x2:起始l*(1+w2),linedot,colorff9966;
x3:起始l*(1+w3),linedot,colorff9966;
x4:起始l*(1+w4),linedot,colorff9966;
x5:起始l*(1+w5),linedot,colorff9966;
x6:起始l*(1+w6),linedot,colorff9966;
x7:起始l*(1+w7),linedot,colorff9966;
x8:起始l*(1+w8),linedot,colorff9966;
x9:起始l*(1+w9),linedot,colorff9966;
drawnumber(barpos=sysparam(3),x1,x1,2),coloraaaaaa,align2,pxup25;
drawnumber(barpos=sysparam(3),x2,x2,2),coloraaaaaa,align2,pxup25;
drawnumber(barpos=sysparam(3),x3,x3,2),coloraaaaaa,align2,pxup25;
drawnumber(barpos=sysparam(3),x4,x4,2),coloraaaaaa,align2,pxup25;
drawnumber(barpos=sysparam(3),x5,x5,2),coloraaaaaa,align2,pxup25;
drawnumber(barpos=sysparam(3),x6,x6,2),coloraaaaaa,align2,pxup25;
drawnumber(barpos=sysparam(3),x7,x7,2),coloraaaaaa,align2,pxup25;
drawnumber(barpos=sysparam(3),x8,x8,2),coloraaaaaa,align2,pxup25;
drawnumber(barpos=sysparam(3),x9,x9,2),coloraaaaaa,align2,pxup25;

drawtext(barpos=sysparam(1)-4,x1,numtostr(w1*100,1)+'%'),coloraaaaaa,align2,pxup25;
drawtext(barpos=sysparam(1)-4,x2,numtostr(w2*100,1)+'%'),coloraaaaaa,align2,pxup25;
drawtext(barpos=sysparam(1)-4,x3,numtostr(w3*100,1)+'%'),coloraaaaaa,align2,pxup25;
drawtext(barpos=sysparam(1)-4,x4,numtostr(w4*100,1)+'%'),coloraaaaaa,align2,pxup25;
drawtext(barpos=sysparam(1)-4,x5,numtostr(w5*100,1)+'%'),coloraaaaaa,align2,pxup25;
drawtext(barpos=sysparam(1)-4,x6,numtostr(w6*100,1)+'%'),coloraaaaaa,align2,pxup25;
drawtext(barpos=sysparam(1)-4,x7,numtostr(w7*100,1)+'%'),coloraaaaaa,align2,pxup25;
drawtext(barpos=sysparam(1)-4,x8,numtostr(w8*100,1)+'%'),coloraaaaaa,align2,pxup25;
drawtext(barpos=sysparam(1)-4,x9,numtostr(w9*100,1)+'%'),coloraaaaaa,align2,pxup25;
end;

else begin
{光标向下}
起始h:hhk[pp],colorff66dd,linethick2;
跌幅统计:(光标-起始h)/起始h*100,linethick;

stickline(barpos=sysparam(1),起始h,光标,0.1,0),color00aaff;
drawtext(barpos=sysparam(1),起始h,'∨'),align0,pxup20,color00aaff;
drawtext(barpos=sysparam(1),光标,'∧'),align0,color00aaff;
drawtext(barpos=sysparam(1)-2,光标,numtostr(跌幅统计,3)),align2,pxup20,color00ffff;

x11:起始h*(1-w1),linedot,colorff9966;
x21:起始h*(1-w2),linedot,colorff9966;
x31:起始h*(1-w3),linedot,colorff9966;
x41:起始h*(1-w4),linedot,colorff9966;
x51:起始h*(1-w5),linedot,colorff9966;
x61:起始h*(1-w6),linedot,colorff9966;
x71:起始h*(1-w7),linedot,colorff9966;
x81:起始h*(1-w8),linedot,colorff9966;
x91:起始h*(1-w9),linedot,colorff9966;
drawnumber(barpos=sysparam(3),x11,x11,2),coloraaaaaa,align2,pxup25;
drawnumber(barpos=sysparam(3),x21,x21,2),coloraaaaaa,align2,pxup25;
drawnumber(barpos=sysparam(3),x31,x31,2),coloraaaaaa,align2,pxup25;
drawnumber(barpos=sysparam(3),x41,x41,2),coloraaaaaa,align2,pxup25;
drawnumber(barpos=sysparam(3),x51,x51,2),coloraaaaaa,align2,pxup25;
drawnumber(barpos=sysparam(3),x61,x61,2),coloraaaaaa,align2,pxup25;
drawnumber(barpos=sysparam(3),x71,x71,2),coloraaaaaa,align2,pxup25;
drawnumber(barpos=sysparam(3),x81,x81,2),coloraaaaaa,align2,pxup25;
drawnumber(barpos=sysparam(3),x91,x91,2),coloraaaaaa,align2,pxup25;

drawtext(barpos=sysparam(1)-4,x11,numtostr(-w1*100,1)+'%'),coloraaaaaa,align2,pxup25;
drawtext(barpos=sysparam(1)-4,x21,numtostr(-w2*100,1)+'%'),coloraaaaaa,align2,pxup25;
drawtext(barpos=sysparam(1)-4,x31,numtostr(-w3*100,1)+'%'),coloraaaaaa,align2,pxup25;
drawtext(barpos=sysparam(1)-4,x41,numtostr(-w4*100,1)+'%'),coloraaaaaa,align2,pxup25;
drawtext(barpos=sysparam(1)-4,x51,numtostr(-w5*100,1)+'%'),coloraaaaaa,align2,pxup25;
drawtext(barpos=sysparam(1)-4,x61,numtostr(-w6*100,1)+'%'),coloraaaaaa,align2,pxup25;
drawtext(barpos=sysparam(1)-4,x71,numtostr(-w7*100,1)+'%'),coloraaaaaa,align2,pxup25;
drawtext(barpos=sysparam(1)-4,x81,numtostr(-w8*100,1)+'%'),coloraaaaaa,align2,pxup25;
drawtext(barpos=sysparam(1)-4,x91,numtostr(-w9*100,1)+'%'),coloraaaaaa,align2,pxup25;
end;}


试验操盘系统 - 精品推荐

  >>>使用本站搜索工具可以找到更多试验操盘系统公式 飞狐试验系统指标 源码

指标公式下载地址

点这下载软件
好公式网提供全网最全的指标公式软件,感谢您的支持!鼠标双击图片可看大图!
下载请点击右侧“立即下载”,如只有源码,请点击本页面右侧的导入方法按图导入!
本站指标基于网友分享,仅供研究自学,勿作他用,本站对下载使用不承担任何责任!

指标公式下载注意

    ☉ 好公式网发布的指标公式主要用于软件技术面分析,仅供参考,勿用于实际操作,据此操作风险自负!

    ☉ 解压密码:www.goodgongshi.com 就是好公式网域名,希望大家看清楚,切勿输错。

    ☉ tnc和tni格式指标公式,仅可以用通达信软件引入使用,例如可以用通达信软件引入使用指标公式;

    ☉ tne格式指标公式,仅可以用通达信软件公式编辑器5.0版导入,高版本兼容低版本;

    ☉ fnc格式指标公式,可以用大智慧软件新一代高速行情分析系统股票软件使用,少部分可以用分析家软件引入使用;

    ☉ alg格式指标公式,仅仅可以用飞狐交易师软件引入使用;exp格式指标公式,仅可以用大智慧经典版软件引入使用;

    ☉ hxf格式指标公式,仅可以用同花顺软件引入使用。

    ☉ 如果您发现下载软件链接错误,请联系管理员报告错误。

    ☉ 好公式网欢迎各位网友帮忙宣传转发本站网址,有您的支持,我们会做得更好!

    ☉ 本文试验操盘系统公式 飞狐试验系统指标 源码仅供学习研究。

猜你喜欢

学了又学