您现在的位置:程序化交易>> 期货公式>> 文华财经>> 文华财经知识>>正文内容

横线分色显示 数字标注更改在横线末端显示 [文华财经]

  • 咨询内容:  横线分色显示 数字标注更改在横线末端显示

    文件名:赢顺截图20220209120821.pngAA:=REF(O,DAYBARPOS-1),COLORGRAY;//每日开盘价画横线DRAWSL(ISLASTBAR&&C>AA&&PERIOD<8,AA,0,-DAYBARPOS+1,0,RGB(0,128,255)),DOT;//当日开盘价格之上运行DRAWSL(ISLASTBAR&&C<=AA&&PERIOD<8,AA,0,-DAYBARPOS+1,0,RGB(0,128,255)),DOT;//当日开盘价格之下运行
    MA5:MA(C,5),COLORYELLOW,LINETHICK1;DRAWSL(ISLASTBAR,MA5,0,100,0,COLORRED),LINETHICK1;

    VERTLINE(DAYBARPOS=1&&PERIOD<>8&&BACKSET(ISLASTBAR,SUMBARS(DAYBARPOS=1,10)),RGB(40,40,40)),DOT;//每日隔线(可以调整天数)?
    DRAWCOLORKLINE(PERIOD<8&&TIME=1445||TIME=2245||TIME=1115,COLORGREEN,1);//15分钟K线周期每个时间段收盘K线DRAWCOLORKLINE(TIME>=1115&&TIME<1130&&PERIOD<6&&ISUP,COLORGREEN,1);DRAWCOLORKLINE(TIME>=1445&&TIME<1500&&PERIOD<6&&ISUP,COLORGREEN,1);DRAWCOLORKLINE(TIME>=2245&&TIME<2300&&PERIOD<6&&ISUP,COLORGREEN,1);
    DRAWCOLORKLINE(TIME>=1115&&TIME<1130&&PERIOD<6&&ISDOWN,COLORGREEN,0);DRAWCOLORKLINE(TIME>=1445&&TIME<1500&&PERIOD<6&&ISDOWN,COLORGREEN,0);DRAWCOLORKLINE(TIME>=2245&&TIME<2300&&PERIOD<6&&ISDOWN,COLORGREEN,0);
    N1:=10;N2:=10;G:=MA(C,5);D:=MA(C,10);NNH:=BARSLAST(H=HHV(H,5)) ,NODRAW;NNL:=BARSLAST(L=LLV(L,5)) ,NODRAW;NN:=IF(REF(G,NNH)>REF(D,NNH) AND NNH<=5-3,NNH,IF(REF(G,NNL)<REF(D,NNL) AND NNL<=5-3,NNL,5-2)) ,NODRAW;NNN:=IF(ISLASTBAR AND NN>0,NN,5-2) ,NODRAW;H1:=REF(H,NNN)=HHV(H,5-1);L1:=REF(L,NNN)=LLV(L,5-1);FG01:=BACKSET(H1,NNN+1)>BACKSET(H1,NNN),NODRAW;//只设置前面第M-1个FD01:=BACKSET(L1,NNN+1)>BACKSET(L1,NNN) ,NODRAW;FG02:=FG01=FD01 AND G>D,NODRAW;FD02:=FG01=FD01 AND G<D,NODRAW;TTTT:=BARSLAST(FD01),NODRAW;FG0:=FG01 AND IF(FG02=1,H=HHV(H,BARSLAST(REF(FD01,1))+1),H=HHV(H,IF(BARSLAST(L=LLV(L,5))>=5-2,5-2,BARSLAST(FD01)))) AND FD02=0 ,NODRAW;FD0:=FD01 AND IF(FD02=1,L=LLV(L,BARSLAST(REF(FG01,1))+1),L=LLV(L,IF(BARSLAST(H=HHV(L,5))>=5-2,5-2,BARSLAST(FG01))))  AND FG02=0 ,NODRAW;//高低点间周期GT:=BARSLAST(FG0),NODRAW;DT:=BARSLAST(FD0),NODRAW;//第一次处理高低点间多余的点LLLL:=DT=0 AND REF(DT,1)<GT AND L>REF(L,REF(DT,1)+1),NODRAW;FG1:=BACKSET(REFX(GT,1)=0 AND GT<DT AND REFX(H,1)>=REF(H,GT),GT+1),NODRAW;FD1:=BACKSET(REFX(DT,1)=0 AND DT<GT AND REFX(L,1)<=REF(L,DT),DT+1),NODRAW;FG11:=IF(GT=0 AND REF(GT,1)<DT AND IF(REF(G,BARSLAST(L=LLV(L,5)))>REF(D,BARSLAST(L=LLV(L,5))),BARSLAST(L=LLV(L,5))<5-2,1) AND  H<REF(H,REF(GT,1)+1),1,0),NODRAW;FD11:=IF(DT=0 AND REF(DT,1)<GT AND IF(REF(G,BARSLAST(H=HHV(H,5)))<REF(D,BARSLAST(H=HHV(H,5))),BARSLAST(H=HHV(H,5))<5-2,1) AND L>REF(L,REF(DT,1)+1),1,0),NODRAW;//再次周期GT1:=BARSLAST(FG11<>1 AND FG1<>1 AND FG0),NODRAW;DT1:=BARSLAST(FD11<>1 AND FD1<>1 AND FD0),NODRAW;FD2:=BACKSET(REFX(GT1,1)=0 AND DT1<3 AND GT1-DT1<4 AND REF(L,DT1)>LLV(L,GT1+5-2),DT1+1),NODRAW;FG2A:=BACKSET(REFX(GT1,1)=0 AND DT1<3 AND GT1-DT1<4 AND REF(L,DT1)<=LLV(L,GT1+5-2) AND REF(H,GT1)>HHV(H,GT1+5-2),GT1+1),NODRAW;FG2B:=IF(GT1=0 AND DT1<4 AND REF(GT1,1)-DT1<4 AND REF(L,DT1)<=LLV(L,REF(GT1,1)+5-1) AND H>HHV(H,REF(GT1,1)+5-1),1,0),NODRAW;FG2:=BACKSET(REFX(DT1,1)=0 AND GT1<3 AND DT1-GT1<4 AND REF(H,GT1)<HHV(H,DT1+5-2),GT1+1),NODRAW;FD2A:=BACKSET(REFX(DT1,1)=0 AND GT1<3 AND DT1-GT1<4 AND REF(H,GT1)>=HHV(L,DT1+5-2) AND REF(L,DT1)>LLV(L,DT1+5-2),DT1+1),NODRAW;FD2B:=IF(DT1=0 AND GT1<4 AND REF(DT1,1)-GT1<4 AND REF(H,GT1)>=HHV(H,REF(DT1,1)+6) AND L>LLV(L,REF(DT1,1)+5-1),1,0),NODRAW;TTTTTT:= H<REF(H,REF(GT1,1)+1) AND DT1<4,NODRAW;HHHHHH:=REF(LLV(L,10),DT1),NODRAW;//前长后短;FG21:=IF(GT1=0 AND DT1<4 AND H<=REF(H,REF(GT1,1)+1)  ,1,0),NODRAW;FD21:=IF(DT1=0 AND GT1<4  AND L>=REF(L,REF(DT1,1)+1) ,1,0),NODRAW;//前短后长,前低后高(去低);FD231:=BACKSET(REFX(GT1,1)=0 AND DT1>3 AND GT1>DT1 AND GT1-DT1<4 AND REFX(H,1)>REF(H,GT1) AND REF(L,DT1)>REF(LLV(L,10),DT1),DT1+1),NODRAW;FG23:=BACKSET(REFX(GT1,1)=0 AND DT1>3 AND GT1>DT1 AND  GT1-DT1<4 AND REFX(H,1)>REF(H,GT1) AND (REF(H,GT1)<REF(HHV(H,13),GT1) OR REF(FD231,DT1)=0),GT1+1),NODRAW;//前短后长,去2;FG231:=BACKSET(REFX(DT1,1)=0 AND GT1>3  AND DT1>GT1 AND DT1-GT1<4 AND REFX(L,1)<REF(L,DT1) AND REF(H,GT1)<REF(HHV(H,10),GT1) ,GT1+1),NODRAW;FD23:=BACKSET(REFX(DT1,1)=0 AND GT1>3  AND DT1>GT1 AND DT1-GT1<4 AND REFX(L,1)<REF(L,DT1) AND ( REF(L,DT1)>REF(LLV(L,13),DT1) OR REF(FG231,GT1)=0),DT1+1),NODRAW;//前短后长,去3;FDD23:=REF(H,GT1)<REF(HHV(H,10),GT1) OR REF(FD23,DT1)=0,NODRAW;FD24:=BACKSET(REFX(GT1,1)=0 AND DT1>3 AND GT1>DT1 AND GT1-DT1<4 AND REFX(H,1)<HHV(H,GT1+3) AND REF(L,DT1)>LLV(L,DT1+5),DT1+1),NODRAW;FG24:=BACKSET(REFX(DT1,1)=0 AND GT1>3  AND DT1>GT1 AND DT1-GT1<4 AND REFX(L,1)>LLV(L,DT1+3) AND REF(H,GT1)<HHV(H,GT1+5),GT1+1),NODRAW;//做两次高低点间多余的点GT2:=BARSLAST(FG21<>1 AND FG23<>1 AND FG231<>1 AND FG24<>1   AND FG2<>1 AND FG2A<>1 AND FG2B<>1 AND GT1=0),NODRAW;DT2:=BARSLAST(FD21<>1 AND FD23<>1 AND FD231<>1 AND FD24<>1  AND FD2<>1 AND FD2A<>1 AND FD2B<>1 AND DT1=0),NODRAW;FG3:=BACKSET(REFX(GT2,1)=0 AND GT2<DT2 AND REFX(H,1)>=REF(H,GT2),GT2+1),NODRAW;FD3:=BACKSET(REFX(DT2,1)=0 AND DT2<GT2 AND REFX(L,1)<=REF(L,DT2),DT2+1),NODRAW;FG31:=IF(GT2=0 AND REF(GT2,1)<DT2 AND H<REF(H,REF(GT2,1)+1),1,0),NODRAW;FD31:=IF(DT2=0 AND REF(DT2,1)<GT2 AND L>REF(L,REF(DT2,1)+1),1,0),NODRAW;GT3:=BARSLAST(GT2=0 AND FG3<>1 AND FG31<>1 ),NODRAW;DT3:=BARSLAST(DT2=0 AND  FD3<>1 AND FD31<>1),NODRAW;FG4:=BACKSET(REFX(GT3,1)=0 AND GT3<DT3 AND REFX(H,1)>=REF(H,GT3),GT3+1),NODRAW;FD4:=BACKSET(REFX(DT3,1)=0 AND DT3<GT3 AND REFX(L,1)<=REF(L,DT3),DT3+1),NODRAW;FG41:=IF(GT3=0 AND REF(GT3,1)<DT3 AND H<REF(H,REF(GT3,1)+1),1,0),NODRAW;FD41:=IF(DT3=0 AND REF(DT3,1)<GT3 AND L>REF(L,REF(DT3,1)+1),1,0),NODRAW;HHH:=GT3=0 AND FG31<>1 AND  FG3<>1,NODRAW;LLL:=DT3=0 AND FD31<>1 AND  FD3<>1,NODRAW;DRAWLINE1(HHH,H,LLL,L,0),RGB(0,100,100),LINETHICK1;//转折线绿色DRAWLINE1(LLL,L,HHH,H,0),COLORGRAY,LINETHICK1;//转折线红色DRAWTEXT(HHH&&BACKSET(ISLASTBAR,BARSLAST(HHH)+1),H,'▽'),COLORLIGHTGREEN,FONTSIZE25;DRAWTEXT(LLL&&BACKSET(ISLASTBAR,BARSLAST(LLL)+1),L,'△'),COLORLIGHTRED,VALIGN0,FONTSIZE25;//最后一段画线N8:=BARSLAST(HHH)+1;N9:=BARSLAST(LLL)+1;DRAWLINE3(ISLASTBAR&&MIN(N8,N9)=N2&&L>REF(L,N9-1),REF(L,N9-1),N9-1,ISLASTBAR,H,0,0),COLORLIGHTRED,DOT;//红色DRAWLINE3(ISLASTBAR&&MIN(N8,N9)=N1&&H<REF(H,N8-1),REF(H,N8-1),N8-1,ISLASTBAR,L,0,0),RGB(0,100,0),DOT;//绿色QQ1:=BACKSET(ISLASTBAR,MAX(BARSLAST(HHH),BARSLAST(LLL))+1);DRAWSL(CROSS(BACKSET(LLL||ISLASTBAR,BARSLAST(HHH)+1),0.5),H,0,20,0,COLORGREEN),LINETHICK1;//设置高点横线长度多少根K线?DRAWSL(CROSS(BACKSET(HHH||ISLASTBAR,BARSLAST(LLL)+1),0.5),L,0,20,0,COLORRED),LINETHICK1;//设置低点横线长度多少根K线?
    DRAWNUMBER(LLL,REF(VALUEWHEN(LLL,L),1),REF(VALUEWHEN(LLL,L),1),1,RGB(0,128,192));DRAWNUMBER(HHH,REF(VALUEWHEN(HHH,H),1),REF(VALUEWHEN(HHH,H),1),1,RGB(0,128,192));
    DRAWNUMBER(ISLASTBAR,REF(VALUEWHEN(LLL,L),0),REF(VALUEWHEN(LLL,L),0),1,RGB(0,128,192));DRAWNUMBER(ISLASTBAR,REF(VALUEWHEN(HHH,H),0),REF(VALUEWHEN(HHH,H),0),1,RGB(0,128,192));
    DRAWTEXT(LLL,L,'多'),VALIGN0;DRAWTEXT(HHH,H,'空'),VALIGN2;
    VALUEWHEN(HHH,H),RGB(70,70,70),NODRAW;//高点连线VALUEWHEN(LLL,L),RGB(0,100,0),NODRAW;//低点连线
    DRAWICON(HHH,H,'ICO12'),VALIGN1;//高点小黄点DRAWICON(LLL,L,'ICO12'),VALIGN1;//低点小黄点
    Z1:=CROSS(BACKSET(ISLASTBAR,SUMBARS(HHH||LLL,3)),0.9);Z2:=CROSS(BACKSET(ISLASTBAR,SUMBARS(HHH||LLL,4)),0.5);
    DRAWSL(CROSS(BACKSET(ISLASTBAR,SUMBARS(HHH||LLL,4)),0.9),REFX1(VALUEWHEN(Z1, VALUEWHEN(HHH,H)),90000),0,REFX1(VALUEWHEN(Z1,SUMBARS(HHH||LLL,3)+1),90000),3,RGB(180,104,255)),DASH;//中枢区间横线左边DRAWSL(CROSS(BACKSET(ISLASTBAR,SUMBARS(HHH||LLL,4)),0.5),REFX1(VALUEWHEN(Z1, VALUEWHEN(LLL,L)),10000),0,REFX1(VALUEWHEN(Z1,SUMBARS(HHH||LLL,3)+1),10000),3,RGB(180,104,255)),DASH;//中枢区间横线左边DRAWSL(CROSS(BACKSET(ISLASTBAR,SUMBARS(HHH||LLL,4)),0.9),REFX1(VALUEWHEN(Z1, VALUEWHEN(HHH,H)),90000),0,10000,0,RGB(150,45,255)),LINETHICK1;//中枢区间横线右边DRAWSL(CROSS(BACKSET(ISLASTBAR,SUMBARS(HHH||LLL,4)),0.5),REFX1(VALUEWHEN(Z1, VALUEWHEN(LLL,L)),10000),0,10000,0,RGB(150,45,255)),LINETHICK1;//中枢区间横线右边


     

     

     来源:程序化99

  • 文华技术人员:  参考:
    AA:=REF(O,DAYBARPOS-1),COLORGRAY;//每日开盘价画横线 DRAWSL(ISLASTBAR&&C>AA&&PERIOD<8,AA,0,-DAYBARPOS+1,0,RGB(0,128,255)),DOT;//当日开盘价格之上运行 DRAWSL(ISLASTBAR&&C<=AA&&PERIOD<8,AA,0,-DAYBARPOS+1,0,RGB(0,128,255)),DOT;//当日开盘价格之下运行
    MA5:MA(C,5),COLORYELLOW,LINETHICK1; DRAWSL(ISLASTBAR,MA5,0,100,0,COLORRED),LINETHICK1;

    VERTLINE(DAYBARPOS=1&&PERIOD<>8&&BACKSET(ISLASTBAR,SUMBARS(DAYBARPOS=1,10)),RGB(40,40,40)),DOT;//每日隔线(可以调整天数)?
    DRAWCOLORKLINE(PERIOD<8&&TIME=1445||TIME=2245||TIME=1115,COLORGREEN,1);//15分钟K线周期每个时间段收盘K线 DRAWCOLORKLINE(TIME>=1115&&TIME<1130&&PERIOD<6&&ISUP,COLORGREEN,1); DRAWCOLORKLINE(TIME>=1445&&TIME<1500&&PERIOD<6&&ISUP,COLORGREEN,1); DRAWCOLORKLINE(TIME>=2245&&TIME<2300&&PERIOD<6&&ISUP,COLORGREEN,1);
    DRAWCOLORKLINE(TIME>=1115&&TIME<1130&&PERIOD<6&&ISDOWN,COLORGREEN,0); DRAWCOLORKLINE(TIME>=1445&&TIME<1500&&PERIOD<6&&ISDOWN,COLORGREEN,0); DRAWCOLORKLINE(TIME>=2245&&TIME<2300&&PERIOD<6&&ISDOWN,COLORGREEN,0);
    N1:=10; N2:=10; G:=MA(C,5); D:=MA(C,10); NNH:=BARSLAST(H=HHV(H,5)) ,NODRAW; NNL:=BARSLAST(L=LLV(L,5)) ,NODRAW; NN:=IF(REF(G,NNH)>REF(D,NNH) AND NNH<=5-3,NNH,IF(REF(G,NNL)<REF(D,NNL) AND NNL<=5-3,NNL,5-2)) ,NODRAW; NNN:=IF(ISLASTBAR AND NN>0,NN,5-2) ,NODRAW; H1:=REF(H,NNN)=HHV(H,5-1); L1:=REF(L,NNN)=LLV(L,5-1); FG01:=BACKSET(H1,NNN+1)>BACKSET(H1,NNN),NODRAW;//只设置前面第M-1个 FD01:=BACKSET(L1,NNN+1)>BACKSET(L1,NNN) ,NODRAW; FG02:=FG01=FD01 AND G>D,NODRAW; FD02:=FG01=FD01 AND G<D,NODRAW; TTTT:=BARSLAST(FD01),NODRAW; FG0:=FG01 AND IF(FG02=1,H=HHV(H,BARSLAST(REF(FD01,1))+1),H=HHV(H,IF(BARSLAST(L=LLV(L,5))>=5-2,5-2,BARSLAST(FD01)))) AND FD02=0 ,NODRAW; FD0:=FD01 AND IF(FD02=1,L=LLV(L,BARSLAST(REF(FG01,1))+1),L=LLV(L,IF(BARSLAST(H=HHV(L,5))>=5-2,5-2,BARSLAST(FG01))))  AND FG02=0 ,NODRAW; //高低点间周期 GT:=BARSLAST(FG0),NODRAW; DT:=BARSLAST(FD0),NODRAW; //第一次处理高低点间多余的点 LLLL:=DT=0 AND REF(DT,1)<GT AND L>REF(L,REF(DT,1)+1),NODRAW; FG1:=BACKSET(REFX(GT,1)=0 AND GT<DT AND REFX(H,1)>=REF(H,GT),GT+1),NODRAW; FD1:=BACKSET(REFX(DT,1)=0 AND DT<GT AND REFX(L,1)<=REF(L,DT),DT+1),NODRAW; FG11:=IF(GT=0 AND REF(GT,1)<DT AND IF(REF(G,BARSLAST(L=LLV(L,5)))>REF(D,BARSLAST(L=LLV(L,5))),BARSLAST(L=LLV(L,5))<5-2,1) AND  H<REF(H,REF(GT,1)+1),1,0),NODRAW; FD11:=IF(DT=0 AND REF(DT,1)<GT AND IF(REF(G,BARSLAST(H=HHV(H,5)))<REF(D,BARSLAST(H=HHV(H,5))),BARSLAST(H=HHV(H,5))<5-2,1) AND L>REF(L,REF(DT,1)+1),1,0),NODRAW; //再次周期 GT1:=BARSLAST(FG11<>1 AND FG1<>1 AND FG0),NODRAW; DT1:=BARSLAST(FD11<>1 AND FD1<>1 AND FD0),NODRAW; FD2:=BACKSET(REFX(GT1,1)=0 AND DT1<3 AND GT1-DT1<4 AND REF(L,DT1)>LLV(L,GT1+5-2),DT1+1),NODRAW; FG2A:=BACKSET(REFX(GT1,1)=0 AND DT1<3 AND GT1-DT1<4 AND REF(L,DT1)<=LLV(L,GT1+5-2) AND REF(H,GT1)>HHV(H,GT1+5-2),GT1+1),NODRAW; FG2B:=IF(GT1=0 AND DT1<4 AND REF(GT1,1)-DT1<4 AND REF(L,DT1)<=LLV(L,REF(GT1,1)+5-1) AND H>HHV(H,REF(GT1,1)+5-1),1,0),NODRAW; FG2:=BACKSET(REFX(DT1,1)=0 AND GT1<3 AND DT1-GT1<4 AND REF(H,GT1)<HHV(H,DT1+5-2),GT1+1),NODRAW; FD2A:=BACKSET(REFX(DT1,1)=0 AND GT1<3 AND DT1-GT1<4 AND REF(H,GT1)>=HHV(L,DT1+5-2) AND REF(L,DT1)>LLV(L,DT1+5-2),DT1+1),NODRAW; FD2B:=IF(DT1=0 AND GT1<4 AND REF(DT1,1)-GT1<4 AND REF(H,GT1)>=HHV(H,REF(DT1,1)+6) AND L>LLV(L,REF(DT1,1)+5-1),1,0),NODRAW; TTTTTT:= H<REF(H,REF(GT1,1)+1) AND DT1<4,NODRAW; HHHHHH:=REF(LLV(L,10),DT1),NODRAW; //前长后短; FG21:=IF(GT1=0 AND DT1<4 AND H<=REF(H,REF(GT1,1)+1)  ,1,0),NODRAW; FD21:=IF(DT1=0 AND GT1<4  AND L>=REF(L,REF(DT1,1)+1) ,1,0),NODRAW; //前短后长,前低后高(去低); FD231:=BACKSET(REFX(GT1,1)=0 AND DT1>3 AND GT1>DT1 AND GT1-DT1<4 AND REFX(H,1)>REF(H,GT1) AND REF(L,DT1)>REF(LLV(L,10),DT1),DT1+1),NODRAW; FG23:=BACKSET(REFX(GT1,1)=0 AND DT1>3 AND GT1>DT1 AND  GT1-DT1<4 AND REFX(H,1)>REF(H,GT1) AND (REF(H,GT1)<REF(HHV(H,13),GT1) OR REF(FD231,DT1)=0),GT1+1),NODRAW; //前短后长,去2; FG231:=BACKSET(REFX(DT1,1)=0 AND GT1>3  AND DT1>GT1 AND DT1-GT1<4 AND REFX(L,1)<REF(L,DT1) AND REF(H,GT1)<REF(HHV(H,10),GT1) ,GT1+1),NODRAW; FD23:=BACKSET(REFX(DT1,1)=0 AND GT1>3  AND DT1>GT1 AND DT1-GT1<4 AND REFX(L,1)<REF(L,DT1) AND ( REF(L,DT1)>REF(LLV(L,13),DT1) OR REF(FG231,GT1)=0),DT1+1),NODRAW; //前短后长,去3; FDD23:=REF(H,GT1)<REF(HHV(H,10),GT1) OR REF(FD23,DT1)=0,NODRAW; FD24:=BACKSET(REFX(GT1,1)=0 AND DT1>3 AND GT1>DT1 AND GT1-DT1<4 AND REFX(H,1)<HHV(H,GT1+3) AND REF(L,DT1)>LLV(L,DT1+5),DT1+1),NODRAW; FG24:=BACKSET(REFX(DT1,1)=0 AND GT1>3  AND DT1>GT1 AND DT1-GT1<4 AND REFX(L,1)>LLV(L,DT1+3) AND REF(H,GT1)<HHV(H,GT1+5),GT1+1),NODRAW; //做两次高低点间多余的点 GT2:=BARSLAST(FG21<>1 AND FG23<>1 AND FG231<>1 AND FG24<>1   AND FG2<>1 AND FG2A<>1 AND FG2B<>1 AND GT1=0),NODRAW; DT2:=BARSLAST(FD21<>1 AND FD23<>1 AND FD231<>1 AND FD24<>1  AND FD2<>1 AND FD2A<>1 AND FD2B<>1 AND DT1=0),NODRAW; FG3:=BACKSET(REFX(GT2,1)=0 AND GT2<DT2 AND REFX(H,1)>=REF(H,GT2),GT2+1),NODRAW; FD3:=BACKSET(REFX(DT2,1)=0 AND DT2<GT2 AND REFX(L,1)<=REF(L,DT2),DT2+1),NODRAW; FG31:=IF(GT2=0 AND REF(GT2,1)<DT2 AND H<REF(H,REF(GT2,1)+1),1,0),NODRAW; FD31:=IF(DT2=0 AND REF(DT2,1)<GT2 AND L>REF(L,REF(DT2,1)+1),1,0),NODRAW; GT3:=BARSLAST(GT2=0 AND FG3<>1 AND FG31<>1 ),NODRAW; DT3:=BARSLAST(DT2=0 AND  FD3<>1 AND FD31<>1),NODRAW; FG4:=BACKSET(REFX(GT3,1)=0 AND GT3<DT3 AND REFX(H,1)>=REF(H,GT3),GT3+1),NODRAW; FD4:=BACKSET(REFX(DT3,1)=0 AND DT3<GT3 AND REFX(L,1)<=REF(L,DT3),DT3+1),NODRAW; FG41:=IF(GT3=0 AND REF(GT3,1)<DT3 AND H<REF(H,REF(GT3,1)+1),1,0),NODRAW; FD41:=IF(DT3=0 AND REF(DT3,1)<GT3 AND L>REF(L,REF(DT3,1)+1),1,0),NODRAW; HHH:=GT3=0 AND FG31<>1 AND  FG3<>1,NODRAW; LLL:=DT3=0 AND FD31<>1 AND  FD3<>1,NODRAW; DRAWLINE1(HHH,H,LLL,L,0),RGB(0,100,100),LINETHICK1;//转折线绿色 DRAWLINE1(LLL,L,HHH,H,0),COLORGRAY,LINETHICK1;//转折线红色 DRAWTEXT(HHH&&BACKSET(ISLASTBAR,BARSLAST(HHH)+1),H,'',COLORLIGHTGREEN,FONTSIZE25; DRAWTEXT(LLL&&BACKSET(ISLASTBAR,BARSLAST(LLL)+1),L,'',COLORLIGHTRED,VALIGN0,FONTSIZE25; //最后一段画线 N8:=BARSLAST(HHH)+1; N9:=BARSLAST(LLL)+1; DRAWLINE3(ISLASTBAR&&MIN(N8,N9)=N2&&L>REF(L,N9-1),REF(L,N9-1),N9-1,ISLASTBAR,H,0,0),COLORLIGHTRED,DOT;//红色 DRAWLINE3(ISLASTBAR&&MIN(N8,N9)=N1&&H<REF(H,N8-1),REF(H,N8-1),N8-1,ISLASTBAR,L,0,0),RGB(0,100,0),DOT;//绿色 QQ1:=BACKSET(ISLASTBAR,MAX(BARSLAST(HHH),BARSLAST(LLL))+1); DRAWSL(CROSS(BACKSET(LLL||ISLASTBAR,BARSLAST(HHH)+1),0.5),H,0,20,0,COLORGREEN),LINETHICK1;//设置高点横线长度多少根K线? DRAWSL(CROSS(BACKSET(HHH||ISLASTBAR,BARSLAST(LLL)+1),0.5),L,0,20,0,COLORRED),LINETHICK1;//设置低点横线长度多少根K线? REFX(L,20); DRAWNUMBER(REF(LLL,20),REF(L,20),REF(L,20),1,RGB(0,128,192)); DRAWNUMBER(REF(HHH,20),REF(H,20),REF(H,20),1,RGB(0,128,192));
    DRAWNUMBER(ISLASTBAR,REF(VALUEWHEN(LLL,L),0),REF(VALUEWHEN(LLL,L),0),1,RGB(0,128,192)); DRAWNUMBER(ISLASTBAR,REF(VALUEWHEN(HHH,H),0),REF(VALUEWHEN(HHH,H),0),1,RGB(0,128,192));
    DRAWTEXT(LLL,L,'',VALIGN0; DRAWTEXT(HHH,H,'',VALIGN2;
    VALUEWHEN(HHH,H),RGB(70,70,70),NODRAW;//高点连线 VALUEWHEN(LLL,L),RGB(0,100,0),NODRAW;//低点连线
    DRAWICON(HHH,H,'CO12',VALIGN1;//高点小黄点 DRAWICON(LLL,L,'CO12',VALIGN1;//低点小黄点
    Z1:=CROSS(BACKSET(ISLASTBAR,SUMBARS(HHH||LLL,3)),0.9); Z2:=CROSS(BACKSET(ISLASTBAR,SUMBARS(HHH||LLL,4)),0.5);

     

     来源: WWW.CXH99.COM

  • 文华客服:  


    文件名:赢顺截图20220209134454.png

     

  • 网友回复:  详细说明如何分段显示颜色?

     

  • 网友回复:  我设置的横线是20根K线长度。我想分为每10K线长度一个颜色。也就是一根横线分两个颜色显示

 

有思路,想编写各种指标公式,交易模型,选股公式,还原公式的朋友

可联系技术人员 QQ: 262069696  点击在线交流或微信号:cxh99cxh99  进行 有偿收费 编写!

怎么收费,代编流程等详情请点击阅读!

(注:由于人数限制,QQ或微信请选择方便的一个联系我们就行,加好友时请简单备注下您的需求,否则无法通过。谢谢您!)


【字体: 】【打印文章】【查看评论

相关文章

    没有相关内容