您现在的位置:程序化交易>> 期货公式>> 博易大师>> 博易大师知识>>正文内容

老师,在分钟周期如何自动画日k的开盘收盘价的方框呀 [博易POBO]

咨询内容:

老师,在分钟周期如何自动画日k的开盘收盘价的方框呀

老师,在分钟周期如何自动画日k的开盘收盘价的方框呀,  要是能有上下影线就更好了,比如5分钟周期
 
以下是通达信的  第二种或第二种+源码效果最好,可以任意周期都能显示日K
 
第一种:
T:=BARSLAST(DAY!=REF(DAY,1));
 HH:=HHV(H,69);
 LL:=LLV(L,69);
 DRAWLINE(T=0 AND O>REFX(C,BARSNEXT(T=68)),O,T=68 AND C<REF(O,T),REF(O,T),0),COLORCYAN;
 DRAWLINE(T=0 AND O<REFX(C,BARSNEXT(T=68)),O,T=68 AND C>REF(O,T),REF(O,T),0),COLORRED;
 DRAWLINE(T=0 AND O=REFX(C,BARSNEXT(T=68)),O,T=68 AND C=REF(O,T),REF(O,T),0),COLORWHITE;
 DRAWLINE(T=0 AND O>REFX(C,BARSNEXT(T=68)),REFX(C,BARSNEXT(T=68)),T=68 AND C<REF(O,T),C,0),COLORCYAN;
 DRAWLINE(T=0 AND O<REFX(C,BARSNEXT(T=68)),REFX(C,BARSNEXT(T=68)),T=68 AND C>REF(O,T),C,0),COLORRED;
 DRAWLINE(T=0 AND O=REFX(C,BARSNEXT(T=68)),REFX(C,BARSNEXT(T=68)),T=68 AND C=REF(O,T),C,0),COLORWHITE;
 STICKLINE(T=0 AND O>REFX(C,BARSNEXT(T=68)),REFX(C,BARSNEXT(T=68)),O,0,0),COLORCYAN;
 STICKLINE(T=0 AND O<REFX(C,BARSNEXT(T=68)),REFX(C,BARSNEXT(T=68)),O,0,0),COLORRED;
STICKLINE(T=68 AND C<REF(O,T),REF(O,T),C,0,0),COLORCYAN;
 STICKLINE(T=68 AND C>REF(O,T),REF(O,T),C,0,0),COLORRED;
 STICKLINE(T=34 AND REF(O,T)>REFX(C,BARSNEXT(T=68)),REFX(HH,BARSNEXT(T=68)),REFX(LL,BARSNEXT(T=68)),0,0),COLORCYAN;
 STICKLINE(T=34 AND REF(O,T)<REFX(C,BARSNEXT(T=68)),REFX(HH,BARSNEXT(T=68)),REFX(LL,BARSNEXT(T=68)),0,0),COLORRED;
 STICKLINE(T=34 AND REF(O,T)=REFX(C,BARSNEXT(T=68)),REFX(HH,BARSNEXT(T=68)),REFX(LL,BARSNEXT(T=68)),0,0),COLORWHITE;
STICKLINE(T=34,REF(O,T),REFX(C,BARSNEXT(T=68)),0,0),COLORBLACK;



DRAWKLINE(HIGH,OPEN,LOW,CLOSE);
1499095915(1).png



第二种


日1:=HOUR<REF(HOUR,1);
日O:=O#DAY;
日H:=H#DAY;
日L:=L#DAY;
日C:=C#DAY;
STICKLINE(日O<=日C,日C,日O,4,0),COLOR00005C;
STICKLINE(日O>日C,日C,日O,4,0),COLOR005C00;
STICKLINE(日O<=日C,IF(TIME=0950,日H,DRAWNULL),日L,1,0),COLOR00005C;
STICKLINE(日O>日C,IF(TIME=0950,日H,DRAWNULL),日L,1,0),COLOR005C00;
DRAWKLINE(H,O,L,C);


1499099627(1).png
第二种+以下源码
 
A:=BARSLAST(DATE!=REF(DATE,1))+1;
 T:=BARSLAST(CROSS(A=1,0.5));
 T1:=REF(A,T+1)+A;
 T2:=REF(T1,T+1)+A;
 T3:=REF(T2,T+1)+A;
 T4:=REF(T3,T+1)+A;
 T5:=REF(T4,T+1)+A;
 T6:=REF(T5,T+1)+A;
 T7:=REF(T6,T+1)+A;
 T8:=REF(T7,T+1)+A;
 T9:=REF(T8,T+1)+A;
 H1:=FINDHIGH(H,0,A,1);
 H2:=FINDHIGH(H,A,REF(A,T+1),1);
 H3:=FINDHIGH(H,T1,REF(A,T+1),1);
 H4:=FINDHIGH(H,T2,REF(A,T+1),1);
 H5:=FINDHIGH(H,T3,REF(A,T+1),1);
 H6:=FINDHIGH(H,T4,REF(A,T+1),1);
 H7:=FINDHIGH(H,T5,REF(A,T+1),1);
 H8:=FINDHIGH(H,T6,REF(A,T+1),1);
 H9:=FINDHIGH(H,T7,REF(A,T+1),1);
 H10:=FINDHIGH(H,T8,REF(A,T+1),1);
 L1:=FINDLOW(L,0,A,1);
 L2:=FINDLOW(L,A,REF(A,T+1),1);
 L3:=FINDLOW(L,T1,REF(A,T+1),1);
 L4:=FINDLOW(L,T2,REF(A,T+1),1);
 L5:=FINDLOW(L,T3,REF(A,T+1),1);
 L6:=FINDLOW(L,T4,REF(A,T+1),1);
 L7:=FINDLOW(L,T5,REF(A,T+1),1);
 L8:=FINDLOW(L,T6,REF(A,T+1),1);
 L9:=FINDLOW(L,T7,REF(A,T+1),1);
 L10:=FINDLOW(L,T8,REF(A,T+1),1);
 STICKLINE(RANGE(CURRBARSCOUNT,1,CONST(A)),CONST(H1),CONST(H1),8,0),COLORYELLOW;
 STICKLINE(RANGE(CURRBARSCOUNT,1,CONST(A)),CONST(L1),CONST(L1),8,0),COLORYELLOW;
 STICKLINE(CURRBARSCOUNT=1 OR CURRBARSCOUNT=CONST(A),CONST(L1),CONST(H1),0,0),COLORYELLOW;
 STICKLINE(RANGE(CURRBARSCOUNT,CONST(A)+1,CONST(T1)),CONST(H2),CONST(H2),8,0),COLORYELLOW;
 STICKLINE(RANGE(CURRBARSCOUNT,CONST(A)+1,CONST(T1)),CONST(L2),CONST(L2),8,0),COLORYELLOW;
 STICKLINE(CURRBARSCOUNT=CONST(T1) OR CURRBARSCOUNT=CONST(A)+1,CONST(L2),CONST(H2),0,0),COLORYELLOW;
 STICKLINE(RANGE(CURRBARSCOUNT,CONST(T1)+1,CONST(T2)),CONST(H3),CONST(H3),8,0),COLORYELLOW;
 STICKLINE(RANGE(CURRBARSCOUNT,CONST(T1)+1,CONST(T2)),CONST(L3),CONST(L3),8,0),COLORYELLOW;
 STICKLINE(CURRBARSCOUNT=CONST(T2) OR CURRBARSCOUNT=CONST(T1)+1,CONST(L3),CONST(H3),0,0),COLORYELLOW;
 STICKLINE(RANGE(CURRBARSCOUNT,CONST(T2)+1,CONST(T3)),CONST(H4),CONST(H4),8,0),COLORYELLOW;
 STICKLINE(RANGE(CURRBARSCOUNT,CONST(T2)+1,CONST(T3)),CONST(L4),CONST(L4),8,0),COLORYELLOW;
 STICKLINE(CURRBARSCOUNT=CONST(T3) OR CURRBARSCOUNT=CONST(T2)+1,CONST(L4),CONST(H4),0,0),COLORYELLOW;
 STICKLINE(RANGE(CURRBARSCOUNT,CONST(T3)+1,CONST(T4)),CONST(H5),CONST(H5),8,0),COLORYELLOW;
 STICKLINE(RANGE(CURRBARSCOUNT,CONST(T3)+1,CONST(T4)),CONST(L5),CONST(L5),8,0),COLORYELLOW;
 STICKLINE(CURRBARSCOUNT=CONST(T4) OR CURRBARSCOUNT=CONST(T3)+1,CONST(L5),CONST(H5),0,0),COLORYELLOW;
 STICKLINE(RANGE(CURRBARSCOUNT,CONST(T4)+1,CONST(T5)),CONST(H6),CONST(H6),8,0),COLORYELLOW;
 STICKLINE(RANGE(CURRBARSCOUNT,CONST(T4)+1,CONST(T5)),CONST(L6),CONST(L6),8,0),COLORYELLOW;
 STICKLINE(CURRBARSCOUNT=CONST(T5) OR CURRBARSCOUNT=CONST(T4)+1,CONST(L6),CONST(H6),0,0),COLORYELLOW;
 STICKLINE(RANGE(CURRBARSCOUNT,CONST(T5)+1,CONST(T6)),CONST(H7),CONST(H7),8,0),COLORYELLOW;
 STICKLINE(RANGE(CURRBARSCOUNT,CONST(T5)+1,CONST(T6)),CONST(L7),CONST(L7),8,0),COLORYELLOW;
 STICKLINE(CURRBARSCOUNT=CONST(T6) OR CURRBARSCOUNT=CONST(T5)+1,CONST(L7),CONST(H7),0,0),COLORYELLOW;
 STICKLINE(RANGE(CURRBARSCOUNT,CONST(T6)+1,CONST(T7)),CONST(H8),CONST(H8),8,0),COLORYELLOW;
 STICKLINE(RANGE(CURRBARSCOUNT,CONST(T6)+1,CONST(T7)),CONST(L8),CONST(L8),8,0),COLORYELLOW;
 STICKLINE(CURRBARSCOUNT=CONST(T7) OR CURRBARSCOUNT=CONST(T6)+1,CONST(L8),CONST(H8),0,0),COLORYELLOW;
 STICKLINE(RANGE(CURRBARSCOUNT,CONST(T7)+1,CONST(T8)),CONST(H9),CONST(H9),8,0),COLORYELLOW;
 STICKLINE(RANGE(CURRBARSCOUNT,CONST(T7)+1,CONST(T8)),CONST(L9),CONST(L9),8,0),COLORYELLOW;
 STICKLINE(CURRBARSCOUNT=CONST(T8) OR CURRBARSCOUNT=CONST(T7)+1,CONST(L9),CONST(H9),0,0),COLORYELLOW;
 STICKLINE(RANGE(CURRBARSCOUNT,CONST(T8)+1,CONST(T9)),CONST(H10),CONST(H10),8,0),COLORYELLOW;
 STICKLINE(RANGE(CURRBARSCOUNT,CONST(T8)+1,CONST(T9)),CONST(L10),CONST(L10),8,0),COLORYELLOW;
 STICKLINE(CURRBARSCOUNT=CONST(T9) OR CURRBARSCOUNT=CONST(T8)+1,CONST(L10),CONST(H10),0,0),COLORYELLOW;
 
 

1499127763(1).png
  <!-- 咨询内容:

附件 :

-->

 

 来源:程序化99网( WWW.CXH99.COM )

博易技术人员: 效果图:
 
  
DK1.png A:=REF(HOUR,1)=15ANDHOUR<>15;
DH:=STKDATA('',6,'OPEN');
DL:=STKDATA('',6,'CLOSE');
DHR:VALUEWHEN(A,REF(DH,1));
DLR:VALUEWHEN(A,REF(DL,1)); 来源 程序化久久网

 

有思路,想编写各种指标公式,程序化交易模型,选股公式,预警公式的朋友

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

怎么收费,代编流程等详情请点击阅读,或QQ微信联系我们!


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

相关文章

    没有相关内容