注册 登录  
 加关注
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

天意(专注股票)

对股票一往情深,享受成功与失败

 
 
 

日志

 
 
关于我

对股票一往情深,享受成功与失败。 声明: 本博客只是个人的一些看法,不对任何个人和团体构成投资依据和建议,据此操作,风险自担。

网易考拉推荐

缠论买卖点(主图指标)  

2011-11-18 10:41:25|  分类: 股票编程 |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |

通达信:
{N1:1,100,10;N2:1,100,10;DISP:=1,3,2};
N1:=10;N2:=10;DISP:=2;
K:=IF(PERIOD=5,1,{日}
IF(PERIOD=6,1,{周}
IF(PERIOD=7,1,{月}
IF(PERIOD=8,1,{多分钟}
IF(PERIOD=9,1,{多日}
IF(PERIOD=10,1,{季}
IF(PERIOD=11,2,{年}
IF(PERIOD=4,1,{60F}
IF(PERIOD=3,1,{30F}
IF(PERIOD=2,1,{15F}
IF(PERIOD=1,1{5F},1{1F})))))))))))/10;

P1:=PEAK(1,K*N1,1);
P2:=PEAK(1,K*N1,2);
WP1:=PEAKBARS(1,K*N1,1);
WP2:=PEAKBARS(1,K*N1,2);
T1:=TROUGH(2,K*N2,1);
T2:=TROUGH(2,K*N2,2);
WT1:=TROUGHBARS(2,K*N2,1);
WT2:=TROUGHBARS(2,K*N2,2);
TJ1:=P1>T1 AND P2>T2 ;
ZD:=MAX(T1,T2);
ZG:=MIN(P1,P2);
LL:=MIN(T1,T2);
HH:=MAX(P1,P2);
TJ2:=FILTER(ZG>ZD,2);
TJ3:=ZG=REF(ZG,BARSLAST(TJ2)) OR ZD=REF(ZD,BARSLAST(TJ2));
TJ4:=TJ1&&TJ2&&NOT(TJ3);
TJ5:=BETWEEN(ZD,REF(ZD,REF(BARSLAST(TJ4),1)),REF(ZG,REF(BARSLAST(TJ4),1)));
TJ6:=BETWEEN(ZG,REF(ZD,REF(BARSLAST(TJ4),1)),REF(ZG,REF(BARSLAST(TJ4),1)));
TJ7:=ZG>REF(ZG,REF(BARSLAST(TJ4),1))&&ZD<REF(ZD,REF(BARSLAST(TJ4),1));
TJ8:=TJ4&&NOT(TJ5 OR TJ6 OR TJ7);
ZSD:=IF(TJ8,ZD,DRAWNULL);
ZSG:=IF(TJ8,ZG,DRAWNULL);
ZSH:=IF(TJ8,HH,DRAWNULL);
ZSL:=IF(TJ8,LL,DRAWNULL);
STICKLINE(TJ8,ZSH,ZSL,0,-1),COLORMAGENTA;
STICKLINE(TJ8,ZSD,ZSG,IF(DISP=1,3,0),1),COLORMAGENTA;
DRAWTEXT(DISP=2,ZSH,'中枢'),COLORRED;
中枢高:PLOYLINE(DISP=2,REF(ZSD,BARSLAST(TJ8))),CROSSDOT,COLORLIRED;
中枢低:PLOYLINE(DISP=2,REF(ZSG,BARSLAST(TJ8))),CROSSDOT,COLORLIGREEN;

中枢最高:PLOYLINE(DISP=2,REF(ZSH,BARSLAST(TJ8))),POINTDOT,COLORRED;

中枢最低:PLOYLINE(DISP=2,REF(ZSL,BARSLAST(TJ8))),POINTDOT,COLORGREEN;

趋势高:PLOYLINE(DISP=3,ZIG(1,K*N1)),COLORLIBLUE;

趋势低:PLOYLINE(DISP=3,ZIG(2,K*N2)),COLORLIBLUE;

局部低点预选A:=BACKSET(LLV(L,5)<REF(LLV(L,4),1),4);
局部低点预选B:=BACKSET(局部低点预选A=0 AND REF(局部低点预选A,1)=1,2);
局部低点预选C:=IF(局部低点预选B=1 AND REF(局部低点预选B,1)=0,-1,0);
局部高点预选A:=BACKSET(HHV(H,5)>REF(HHV(H,4),1),4);
局部高点预选B:=BACKSET(局部高点预选A=0 AND REF(局部高点预选A,1)=1,2);
局部高点预选C:=IF(局部高点预选B=1 AND REF(局部高点预选B,1)=0,1,0);
缺口判断:=IF(L>REF(H,1),1,IF(H<REF(L,1),-1,0));
距前高天:=BARSLAST(局部高点预选C=1);
距前低天:=BARSLAST(局部低点预选C=-1);
小值周期:=LOWRANGE(L);
大值周期:=TOPRANGE(H);
低保留AA:=IF(局部低点预选C=-1 AND REF(距前高天,1)>REF(距前低天,1) AND LLV(L,距前高天+1)<REF(LLV(L,距前高天+1),1),-1,0);
低保留AB:=IF(局部低点预选C=-1 AND REF(距前高天,1)<=REF(距前低天,1) AND (距前高天>=4 OR LLV(缺口判断,距前高天)=-1 OR LLV(L,距前低天+2)<REF(LLV(L,距前低天+1),1)),-1,0);
低保留S:=IF((低保留AA=-1 OR 低保留AB=-1) AND L<REF(H,距前高天+1),-1,0);
预判:=IF((距前低天<4 AND HHV(缺口判断,距前低天)!=1) OR REF(低保留S,距前低天)=0,1,0);
判断:=IF(局部高点预选C=1 AND REF(距前低天,1)<=REF(距前高天,1) AND 预判=1 AND 大值周期>REF(小值周期,距前低天+1) AND 大值周期>REF(小值周期,距前低天) AND 大值周期>REF(大值周期,距前高天),1,0);
高保留A:=IF(局部高点预选C=1 AND REF(距前低天,1)>REF(距前高天,1) AND HHV(H,距前低天+1)>REF(HHV(H,距前低天+1),1),1,0);
高保留B:=IF(局部高点预选C=1 AND REF(距前低天,1)<=REF(距前高天,1) AND REF(低保留S,距前低天)=-1 AND (距前低天>=4 OR HHV(缺口判断,距前低天)=1),1,0);
高保留:=IF((高保留A=1 OR 高保留B=1 OR 判断=1) AND H>REF(L,距前低天+1),1,0);
预判A:=IF((距前高天<4 AND HHV(缺口判断,距前高天)!=1) OR REF(高保留,距前高天)=0,1,0);
判断A:=IF(局部低点预选C=-1 AND REF(距前高天,1)<=REF(距前低天,1) AND 预判A=1 AND 小值周期>REF(大值周期,距前高天+1) AND 小值周期>REF(大值周期,距前高天) AND 小值周期>REF(小值周期,距前低天),-1,0);
低保留A:=IF(局部低点预选C=-1 AND REF(距前高天,1)>REF(距前低天,1) AND LLV(L,距前高天+1)<REF(LLV(L,距前高天+1),1),-1,0);
低保留B:=IF(局部低点预选C=-1 AND REF(距前高天,1)<=REF(距前低天,1) AND (距前高天>=4 OR LLV(缺口判断,距前高天)=-1 OR 判断A=-1),-1,0);
低保留:=IF((低保留A=-1 OR 低保留B=-1) AND L<REF(H,距前高天+1),-1,0);
距前高天A:=BARSLAST(高保留=1);
距前低天A:=BARSLAST(低保留=-1);
预判X:=IF((距前低天A<4 AND HHV(缺口判断,距前低天A)!=1) OR REF(低保留,距前低天A)=0,1,0);
判断X:=IF(局部高点预选C=1 AND REF(距前低天A,1)<=REF(距前高天A,1) AND 预判X=1 AND 大值周期>REF(小值周期,距前低天A+1) AND 大值周期>REF(小值周期,距前低天A) AND 大值周期>REF(大值周期,距前高天A),1,0);
高保留XA:=IF(局部高点预选C=1 AND REF(距前低天A,1)>REF(距前高天A,1) AND HHV(H,距前低天A+1)>REF(HHV(H,距前低天A+1),1),1,0);
高保留XB:=IF(局部高点预选C=1 AND REF(距前低天A,1)<=REF(距前高天A,1) AND REF(低保留,距前低天A)=-1 AND (距前低天A>=4 OR HHV(缺口判断,距前低天A)=1),1,0);
高保留X:=IF((高保留XA=1 OR 高保留XB=1 OR 判断X=1) AND H>REF(L,距前低天A+1),1,0);
预判XA:=IF((距前高天A<4 AND HHV(缺口判断,距前高天A)!=1) OR REF(高保留XA,距前高天A)=0,1,0);
判断XA:=IF(局部低点预选C=-1 AND REF(距前高天A,1)<=REF(距前低天A,1) AND 预判XA=1 AND 小值周期>REF(大值周期,距前高天A+1) AND 小值周期>REF(大值周期,距前高天A) AND 小值周期>REF(小值周期,距前低天A),-1,0);
低保留XA:=IF(局部低点预选C=-1 AND REF(距前高天A,1)>REF(距前低天A,1) AND LLV(L,距前高天A+1)<REF(LLV(L,距前高天A+1),1),-1,0);
低保留XB:=IF(局部低点预选C=-1 AND REF(距前高天A,1)<=REF(距前低天A,1) AND (距前高天A>=4 OR LLV(缺口判断,距前高天A)=-1 OR 判断XA=-1),-1,0);
低保留X:=IF((低保留XA=-1 OR 低保留XB=-1) AND L<REF(H,距前高天A+1),-1,0);
距前高天YA:=BARSLAST(高保留X=1);
距前低天YA:=BARSLAST(低保留X=-1);
预判YX:=IF((距前低天YA<4 AND HHV(缺口判断,距前低天YA)!=1) OR REF(低保留X,距前低天YA)=0,1,0);
判断YX:=IF(局部高点预选C=1 AND REF(距前低天YA,1)<=REF(距前高天YA,1) AND 预判YX=1 AND 大值周期>REF(小值周期,距前低天YA+1) AND 大值周期>REF(小值周期,距前低天YA) AND 大值周期>REF(大值周期,距前高天YA),1,0);
高保留YXA:=IF(局部高点预选C=1 AND REF(距前低天YA,1)>REF(距前高天YA,1) AND HHV(H,距前低天YA+1)>REF(HHV(H,距前低天YA+1),1),1,0);
高保留YXB:=IF(局部高点预选C=1 AND REF(距前低天YA,1)<=REF(距前高天YA,1) AND REF(低保留X,距前低天YA)=-1 AND (距前低天YA>=4 OR HHV(缺口判断,距前低天YA)=1),1,0);
高保留YX:=IF((高保留YXA=1 OR 高保留YXB=1 OR 判断YX=1) AND H>REF(L,距前低天YA+1),1,0);
预判YXA:=IF((距前高天YA<4 AND HHV(缺口判断,距前高天YA)!=1) OR REF(高保留YXA,距前高天YA)=0,1,0);
判断YXA:=IF(局部低点预选C=-1 AND REF(距前高天YA,1)<=REF(距前低天YA,1) AND 预判YXA=1 AND 小值周期>REF(大值周期,距前高天YA+1) AND 小值周期>REF(大值周期,距前高天YA) AND 小值周期>REF(小值周期,距前低天YA),-1,0);
低保留YXA:=IF(局部低点预选C=-1 AND REF(距前高天YA,1)>REF(距前低天YA,1) AND LLV(L,距前高天YA+1)<REF(LLV(L,距前高天YA+1),1),-1,0);
低保留YXB:=IF(局部低点预选C=-1 AND REF(距前高天YA,1)<=REF(距前低天YA,1) AND (距前高天YA>=4 OR LLV(缺口判断,距前高天YA)=-1 OR 判断YXA=-1),-1,0);
低保留YX:=IF((低保留YXA=-1 OR 低保留YXB=-1) AND L<REF(H,距前高天YA+1),-1,0);
AAAD:=IF(高保留YX=1 AND 低保留YX=-1 AND H>REF(H,REF(距前高天YA,1)+2),1,IF(高保留YX=1 AND 低保留YX=-1 AND L<REF(L,REF(距前低天YA,1)+2),-1,0));
极点保留:=IF(AAAD=0,高保留YX+低保留YX,AAAD);
局部极点:IF(极点保留=-1,L,IF(极点保留=1,H,DRAWNULL)) CIRCLEDOT COLORYELLOW;
DRAWLINE(极点保留=-1,局部极点,极点保留=1,局部极点,0)COLORLIRED;
DRAWLINE(极点保留=1,局部极点,极点保留=-1,局部极点,0)COLORYELLOW;
DD1:=BARSLAST(ABS(极点保留)!=1);
DRAWTEXT(极点保留=1,局部极点,'卖'),COLORGREEN;
DRAWTEXT(极点保留=-1,局部极点,'买'),COLORRED;
MA5:MA(CLOSE,5),COLORFF00FF,LINETHICK2;判:IF(MA5<REF(MA5,1),MA5,DRAWNULL),COLORWHITE,LINETHICK2;

大智慧
if DATATYPE<8 then
begin
  fx30:="FENXING#min30";
  fx60:="FENXING#min60";
  {fxday:="FENXING#day";}
  drawtext(barstatus=2,fx30,'-----30底分高'+fx30),colorwhite,align2;
  drawtext(barstatus=2,fx60,'-----60底分高'+fx60),colorgreen,align2;
  {drawtext(barstatus=2,fxday,'--日线底分高')+fx60,colorgreen,align2;}
  end;
var1:="chzhshch@kxian";{处理K线}
var2:="chzhshch@bi";{处理笔关系}
drawline(var2=1,h,var2=-1,l,0),pointdot,coloryellow;
drawline(var2=-1,l,var2=1,h,0),pointdot,coloryellow;
var3:="chzhshch@duan";{处理段关系}
drawtext(var3=1,h,''+h),align0,colormagenta;
drawtext(var3=1,h,'卖'),align2,colorred;
drawtext(var3=-1,l,''+l),colorgreen;
drawtext(var3=-1,l,'买'),align2,colorgreen;
drawline(var3=1,h,var3=-1,l,0),colorff6600;
drawline(var3=-1,l,var3=1,h,0),colorff6600;
{高一级别的段
var4:="[email=chzhshch@duan2]chzhshch@duan2[/email]";
drawline(var4=1,h,var4=-1,l,0),linethick2,colorred;
drawline(var4=-1,l,var4=1,h,0),linethick2,colorred;}
h1:=0;
X1:=BARSLAST(h1);


飞狐
var1:="color=#ff0000]chzhshch@kxian";
var2:="chzhshch@bi";{处理笔关系}
if DATAPERIOD<=8 then
begin
//var2:="[email=chzhshch@duan]chzhshch@duan[/email]";{处理段1分钟的关系}

pre:=3; {设置小数点位数}
if STKTYPE=0 then  pre:=1;
if STKTYPE=11 then pre:=3;
a1:=barslast(var2<>0);
a2:=ref(var2,a1);
aa1:=ref(a1+1,1);
aa2:=ref(a2,1);
aa3:=BARSSINCE(var2<>0);
aa4:=ref(aa3+1,1)+4;//历史总周期数
a3:if (aa2>0,l-ref(h,aa1),h-ref(l,aa1)),linethick0;{计算点位差}
drawnumber(var2=1,h,h,pre),pxup20,color3300ff,align1; {显示数字}
drawnumber(var2=-1,l,l,pre),pxdn5,colorffff00,align1;
//{显示完成笔力度}
//drawtext(var2=1,h,'+'),pxup45,colormagenta,align2;
drawnumber(var2=1,h,a3,pre),align1,colormagenta,pxup65;
drawnumber(var2=-1,l,a3,pre),align1,colormagenta,pxdn50;
//显示完成笔周期
drawtext(var2=1,h,'卖'),pxup45,colorred,align2;
drawtext(var2=1,h,'T:'),pxup45,coloryellow,align2,shift3;
drawnumber(var2=1,h,aa1,0),colormagenta,pxup45,align1,shift3;
//drawnumber(var2=1,h,aa4,0),coloryellow,pxup45,align1,shift6;
drawtext(var2=-1,l,'买'),pxdn30,colorgreen,align2;
drawtext(var2=-1,l,'T:'),pxdn30,coloryellow,align2,shift3;
drawnumber(var2=-1,l,aa1,0),colormagenta,pxdn30,align1,shift3;
//drawnumber(var2=-1,l,aa4,0),coloryellow,pxdn30,align1,shift6;
//显示未完成笔的点位力度
ll:=l-ref(h,barslast(var2<>0));
hh:=h-ref(l,barslast(var2<>0)) ;
a3:= -a3;
//显示未完成笔的收盘数据
drawtext(islastbar and  ref(var2,barslast(var2<>0))=-1 and var2=0,h,numtostr(h,3)),pxup20,color3300ff,align1,shift6;{显示数字}
drawtext(islastbar and  ref(var2,barslast(var2<>0))=1 and var2=0,l,numtostr(l,3)),pxdn5,colorffff00,align1,shift6;
//写在未完成笔低点处的笔的点位力度
drawtext(islastbar and  ref(var2,barslast(var2<>0))=1 and var2=0,L,numtostr(ll,3)),colorgreen,shift6,pxdn30,align1;
//写在未完成笔高点处的笔的点位力度//
drawtext(islastbar and  ref(var2,barslast(var2<>0))=-1 and var2=0,h,'+' + numtostr(hh,3)),align1,colormagenta,pxup45,shift6;
//显示未完成笔的周期,写在低点的
drawtext(islastbar and  ref(var2,barslast(var2<>0))=1 and var2=0,L,'T:'+ numtostr(aa1,0) ),pxdn50,coloryellow,align1,shift6;
//显示未完成笔的周期,写在高点的
drawtext(islastbar and  ref(var2,barslast(var2<>0))=-1 and var2=0,h,'T:'+ numtostr(aa1,0) ),pxup65,coloryellow,align1,shift6;

end;
var1:="[email=chzhshch@kxian]chzhshch@kxian[/email]";{处理K线}
var2:="[email=chzhshch@bi]chzhshch@bi[/email]";{处理笔关系}
drawline(var2=1,h,var2=-1,l,0),linedot,coloryellow;
drawline(var2=-1,l,var2=1,h,0),linedot,coloryellow;
var3:="[email=chzhshch@duan]chzhshch@duan[/email]";{处理段关系,处理前调整笔的高低点,处理后不调整}
drawnumber(var3=1,h,h,2),pxup20,colormagenta,align2;
//drawtext(var3=1,h,'卖'),pxup20,colormagenta,align2;
drawnumber(var3=-1,l,l,2),pxdn5,colorgreen;
drawline(var3=1,h,var3=-1,l,0),colorFF6600;
drawline(var3=-1,l,var3=1,h,0),colorFF6600;
var31:=hhvbars(zig(3, 19)>ref(zig(3,19),1)
            and ref(zig(3,19), 1)<ref(zig(3,19), 2),0);
            stickline(var31=2,l*0.95,l*0.98,8,0),color0000ff;
            drawtext(var31=2,l*0.95,'3天'),coloryellow;
            stickline(var31=4,h*1.05,h*1.02,8,0),color9966ff;
            drawtext(var31=4,h*1.06,'5天'),coloryellow;
            stickline(var31=7,l*0.95,l*0.98,8,0),color00ffff;
            drawtext(var31=7,l*0.95,'8天'),coloryellow;
            stickline(var31=12,h*1.05,h*1.02,8,0),colorff33ff;
            drawtext(var31=12,h*1.06,'13天'),coloryellow;
            stickline(var31=20,l*0.95,l*0.98,8,0),color0066ff;
            drawtext(var31=20,l*0.95,'21天'),coloryellow;
            stickline(var31=33,h*1.05,h*1.02,8,0),colorffff00;
            drawtext(var31=33,h*1.06,'34天'),coloryellow;
            stickline(var31=54,l*0.95,l*0.98,8,0),color006600;
            drawtext(var31=54,l*0.95,'55天'),coloryellow;
            stickline(var31=88,h*1.05,h*1.02,8,0),color00ff00;
            drawtext(var31=88,h*1.06,'89天'),coloryellow;
            stickline(var31=143,l*0.95,l*0.98,8,0),colorccffff;
            drawtext(var31=143,l*0.95,'144天'),coloryellow;
            stickline(var31=232 ,h*1.05,h*1.02,8,0),colorff0033;
            drawtext(var31=232,h*1.06,'233天'),coloryellow;
            stickline(var31=376,l*0.95,l*0.98,8,0),colorff9966;
            drawtext(var31=376,l*0.95,'377天'),coloryellow;

注:有未来函数,
  评论这张
 
阅读(1066)| 评论(1)
推荐 转载

历史上的今天

在LOFTER的更多文章

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2017