K线64卦副图公式(飞狐)

合集下载
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

input:p1(1,0,1),p2(1,0,1);//P1=0,按常规K线开收定阴阳爻,P1=1,按张东生-常秉义方法定阴阳爻;P2=0,按K线顺序排卦,左为初爻,右为上爻,P2=1,按K线逆序排卦

//在副图上显示证卷代码与证卷名称

DRAWTEXT(sysparam(2)=BARSCOUNT(CLOSE),h*1.10,'证卷代码:'+STKLABEL+';'+'证卷名

称:'+STKNAME),COLORGREEN,ALIGN4;

//副图指标,绘K线

STICKLINE(C>O,H,L,0.4,0),COLORRED;

STICKLINE(C>O,O,C,8,1),COLORRED;

STICKLINE(C<=O,H,L,0.4,0),COLORCYAN;

STICKLINE(C<=O,O,C,8,0),COLORCYAN;

//按不同方法定阴阳爻

aa:=AMOUNT/VOL/100;//均价

ai:=if(c=o,aa-ref(aa,1),c-o);//P1=0,按常规K线开收定阴阳爻

aj:=if(c=ref(c,1),aa-ref(aa,1),c-ref(c,1));//P1=1,按张东生-常秉义方法定阴阳爻

a:=if(p1=0,ai,aj);

//对特殊阴阳爻作出标记

DRAWICON((p1=0 and C=O and ai>0) or (p1=1 and C=ref(c,1) and aj>0),L,1),ALIGN5; DRAWICON((p1=0 and C=O and ai<0) or (p1=1 and C=ref(c,1) and aj<0),L,2),ALIGN5;

//选定6爻,P2=0,按K线顺序排卦,P2=1,按K线逆序排卦

a1:=if(p2=0,ref(a,5),a);

a2:=if(p2=0,ref(a,4),ref(a,1));

a3:=if(p2=0,ref(a,3),ref(a,2));

a4:=if(p2=0,ref(a,2),ref(a,3));

a5:=if(p2=0,ref(a,1),ref(a,4));

a6:=if(p2=0,a,ref(a,5));

//下卦

x1:=a1>0 and a2>0 and a3>0;//下卦乾-阳阳阳

x2:=a1>0 and a2>0 and a3<0;//下卦兑-阳阳阴

x3:=a1>0 and a2<0 and a3>0;//下卦离-阳阴阳

x4:=a1>0 and a2<0 and a3<0;//下卦震-阳阴阴

x5:=a1<0 and a2>0 and a3>0;//下卦巽-阴阳阳

x6:=a1<0 and a2>0 and a3<0;//下卦坎-阴阳阴

x7:=a1<0 and a2<0 and a3>0;//下卦艮-阴阴阳

x8:=a1<0 and a2<0 and a3<0;//下卦坤-阴阴阴

//上卦

s1:=a4>0 and a5>0 and a6>0;//上卦乾-阳阳阳

s2:=a4>0 and a5>0 and a6<0;//上卦兑-阳阳阴

s3:=a4>0 and a5<0 and a6>0;//上卦离-阳阴阳

s4:=a4>0 and a5<0 and a6<0;//上卦震-阳阴阴

s5:=a4<0 and a5>0 and a6>0;//上卦巽-阴阳阳

s6:=a4<0 and a5>0 and a6<0;//上卦坎-阴阳阴

s7:=a4<0 and a5<0 and a6>0;//上卦艮-阴阴阳

s8:=a4<0 and a5<0 and a6<0;//上卦坤-阴阴阴

//乾宫八卦,红色系

DRAWTEXT(x1 and s1,HIGH*1.04,'乾'),ALIGN0,COLOR0000BE;{11乾为天-阳阳阳阳阳阳} DRAWTEXT(x1 and s2,HIGH*1.04,'夬'),ALIGN0,COLOR0000E4;{21泽天夬-阳阳阳阳阳阴} DRAWTEXT(x1 and s3,HIGH*1.08,'大\n有'),ALIGN0,COLOR0000EA;{31火天大有-阳阳阳阳阴阳} DRAWTEXT(x1 and s4,HIGH*1.08,'大\n壮'),ALIGN0,COLOR0000FF;{41雷天大壮-阳阳阳阳阴阴}

DRAWTEXT(x1 and s5,HIGH*1.08,'小\n畜'),ALIGN0,COLOR4441FF;{51风天小畜-阳阳阳阴阳阳} DRAWTEXT(x1 and s6,HIGH*1.04,'需'),ALIGN0,COLOR436FFF;{61水天需-阳阳阳阴阳阴} DRAWTEXT(x1 and s7,HIGH*1.08,'大\n畜'),ALIGN0,COLOR7A7DFF;{71山天大畜-阳阳阳阴阴阳} DRAWTEXT(x1 and s8,HIGH*1.04,'泰'),ALIGN0,COLOR7A91FF;{81地天泰-阳阳阳阴阴阴}

//兑宫八卦,绿色系

DRAWTEXT(x2 and s1,HIGH*1.04,'履'),ALIGN0,COLOR00A300;{12天泽履-阳阳阴阳阳阳} DRAWTEXT(x2 and s2,HIGH*1.04,'兑'),ALIGN0,COLOR00FF00;{22兑为泽-阳阳阴阳阳阴} DRAWTEXT(x2 and s3,HIGH*1.04,'睽'),ALIGN0,COLOR00FF00;{32火泽睽-阳阳阴阳阴阳} DRAWTEXT(x2 and s4,HIGH*1.08,'归\n妹'),ALIGN0,COLOR00FF00;{42雷泽归妹-阳阳阴阳阴阴} DRAWTEXT(x2 and s5,HIGH*1.08,'中\n孚'),ALIGN0,COLOR00FF00;{52风泽中孚-阳阳阴阴阳阳} DRAWTEXT(x2 and s6,HIGH*1.04,'节'),ALIGN0,COLOR00FF00;{62水泽节-阳阳阴阴阳阴} DRAWTEXT(x2 and s7,HIGH*1.04,'损'),ALIGN0,COLOR00FF00;{72山泽损-阳阳阴阴阴阳} DRAWTEXT(x2 and s8,HIGH*1.04,'临'),ALIGN0,COLOR00FF00;{82地泽临-阳阳阴阴阴阴}

//离宫八卦,黄色系

DRAWTEXT(x3 and s1,HIGH*1.08,'同\n人'),ALIGN0,COLOR00FFFF;{13天火同人-阳阴阳阳阳阳} DRAWTEXT(x3 and s2,HIGH*1.04,'革'),ALIGN0,COLOR00FFFF;{23泽火革-阳阴阳阳阳阴} DRAWTEXT(x3 and s3,HIGH*1.04,'离'),ALIGN0,COLOR00FFFF;{33离为火-阳阴阳阳阴阳} DRAWTEXT(x3 and s4,HIGH*1.04,'丰'),ALIGN0,COLOR00FFFF;{43雷火丰-阳阴阳阳阴阴} DRAWTEXT(x3 and s5,HIGH*1.08,'家\n人'),ALIGN0,COLOR00FFFF;{53风火家人-阳阴阳阴阳阳} DRAWTEXT(x3 and s6,HIGH*1.08,'既\n济'),ALIGN0,COLOR00FFFF;{63水火既济-阳阴阳阴阳阴} DRAWTEXT(x3 and s7,HIGH*1.04,'贲'),ALIGN0,COLOR00FFFF;{73火山贲-阳阴阳阴阴阳} DRAWTEXT(x3 and s8,HIGH*1.08,'明\n夷'),ALIGN0,COLOR00FFFF;{83地火明夷-阳阴阳阴阴阴} //震宫八卦,肉粉色系

DRAWTEXT(x4 and s1,HIGH*1.08,'无\n妄'),ALIGN0,COLORCCCCFF;{14天雷无妄-阳阴阴阳阳阳} DRAWTEXT(x4 and s2,HIGH*1.04,'随'),ALIGN0,COLORCCCCFF;{24泽雷随-阳阴阴阳阳阴} DRAWTEXT(x4 and s3,HIGH*1.08,'噬\n嗑'),ALIGN0,COLORCCCCFF;{34火雷噬嗑-阳阴阴阳阴阳} DRAWTEXT(x4 and s4,HIGH*1.04,'震'),ALIGN0,COLORCCCCFF;{44震为雷-阳阴阴阳阴阴} DRAWTEXT(x4 and s5,HIGH*1.04,'益'),ALIGN0,COLORCCCCFF;{54风雷益-阳阴阴阴阳阳} DRAWTEXT(x4 and s6,HIGH*1.04,'屯'),ALIGN0,COLORCCCCFF;{64水雷屯-阳阴阴阴阳阴} DRAWTEXT(x4 and s7,HIGH*1.04,'颐'),ALIGN0,COLORCCCCFF;{74山雷颐-阳阴阴阴阴阳} DRAWTEXT(x4 and s8,HIGH*1.04,'复'),ALIGN0,COLORCCCCFF;{84地雷复-阳阴阴阴阴阴}

//巽宫八卦,紫色系

DRAWTEXT(x5 and s1,HIGH*1.04,'姤'),ALIGN0,COLORFF00FF;{15天风姤-阴阳阳阳阳阳} DRAWTEXT(x5 and s2,HIGH*1.08,'大\n过'),ALIGN0,COLORFF00FF;{25泽风大过-阴阳阳阳阳阴} DRAWTEXT(x5 and s3,HIGH*1.04,'鼎'),ALIGN0,COLORFF00FF;{35火风鼎-阴阳阳阳阴阳} DRAWTEXT(x5 and s4,HIGH*1.04,'恒'),ALIGN0,COLORFF00FF;{45雷风恒-阴阳阳阳阴阴} DRAWTEXT(x5 and s5,HIGH*1.04,'巽'),ALIGN0,COLORFF00FF;{55巽为风-阴阳阳阴阳阳} DRAWTEXT(x5 and s6,HIGH*1.04,'井'),ALIGN0,COLORFF00FF;{65水风井-阴阳阳阴阳阴} DRAWTEXT(x5 and s7,HIGH*1.04,'蛊'),ALIGN0,COLORFF00FF;{75山风蛊-阴阳阳阴阴阳} DRAWTEXT(x5 and s8,HIGH*1.04,'升'),ALIGN0,COLORFF00FF;{85地风升-阴阳阳阴阴阴}

//坎宫八卦,浅灰色系

DRAWTEXT(x6 and s1,HIGH*1.04,'讼'),ALIGN0,COLORFFEADD;{16天水讼-阴阳阴阳阳阳} DRAWTEXT(x6 and s2,HIGH*1.04,'困'),ALIGN0,COLORFFEADD;{26泽水困-阴阳阴阳阳阴} DRAWTEXT(x6 and s3,HIGH*1.08,'末\n济'),ALIGN0,COLORFFEADD;{36火水末济-阴阳阴阳阴阳} DRAWTEXT(x6 and s4,HIGH*1.04,'解'),ALIGN0,COLORFFEADD;{46雷水解-阴阳阴阳阴阴} DRAWTEXT(x6 and s5,HIGH*1.04,'涣'),ALIGN0,COLORFFEADD;{56风水涣-阴阳阴阴阳阳} DRAWTEXT(x6 and s6,HIGH*1.04,'坎'),ALIGN0,COLORFFEADD;{66坎为水-阴阳阴阴阳阴} DRAWTEXT(x6 and s7,HIGH*1.04,'蒙'),ALIGN0,COLORFFEADD;{76山水蒙-阴阳阴阴阴阳} DRAWTEXT(x6 and s8,HIGH*1.04,'师'),ALIGN0,COLORFFEADD;{86地水师-阴阳阴阴阴阴}

相关文档
最新文档