网友求助:
各位老大根据以下这段主图源码帮忙做出前三、 四、五、六的高低画线源码,谢谢!
input:N(3);
J1:=BARSTATUS=2;
J2:=REF(HIGH,N)=HHV(HIGH,2*N+1);
J3:=FILTER(J2,N);
J4:=BACKSET(J3,N+1);
J5:=FILTER(J4,N);
J6:=J5 OR J1;
J7:=REF(LOW,N)=LLV(LOW,2*N+1);
J8:=FILTER(J7,N);
J9:=BACKSET(J8,N+1);
JA:=FILTER(J9,N);
JB:=JA AND NOT(J5);
JC:=BACKSET(J6,REF(BARSLAST(JB),1)+1);
JD:=JC>REF(JC,1);
JE:=BACKSET(JD,2);
JF:=JE>REF(JE,1);
J10:=BACKSET(JF AND COUNT(J6,REF(BARSLAST(JB),1)+2)=0,REF(BARSLAST(JB),1)+2);
J11:=J10>REF(J10,1);
J12:=BACKSET(J11 AND COUNT(J6,REF(BARSLAST(JB),1)+2)=0,REF(BARSLAST(JB),1)+2);
J13:=J12>REF(J12,1);
J14:=IF(J6,COUNT(JB,REF(BARSLAST(J6),1)+1),0);
J15:=IF(J14=1 AND J6,BARSLAST(JF),0);
J16:=IF(J6 AND REF(LOW,BARSLAST(JF))>=REF(LOW,BARSLAST(J11)),BARSLAST(J11),BARSLAST(JF));
J17:=IF(J14=2 AND J6,J16,0);
J18:=IF(J14>=3 AND J6,IF(J6 AND REF(LOW,J16)>=REF(LOW,BARSLAST(J13)),BARSLAST(J13),J16),0);
J19:=J15+J17+J18;
J1A:=BACKSET(J6,J19);
J1B:=J1A>REF(J1A,1);
J1C:=BACKSET(J1B,2);
J1D:=J1C>REF(J1C,1);
J1E:=J1D OR J1;
J1F:=BACKSET(J1E,REF(BARSLAST(J6),1)+1);
J20:=J1F>REF(J1F,1);
J21:=BACKSET(J20,2);
J22:=J21>REF(J21,1);
J23:=BACKSET(J22 AND COUNT(J1E,REF(BARSLAST(J6),1)+2)=0,REF(BARSLAST(J6),1)+2);
J24:=J23>REF(J23,1);
J25:=BACKSET(J24 AND COUNT(J1E,REF(BARSLAST(J6),1)+2)=0,REF(BARSLAST(J6),1)+2);
J26:=J25>REF(J25,1);
J27:=IF(J1E,COUNT(J5,REF(BARSLAST(J1E),1)+1),0);
J28:=IF(J27=1 AND J1E,BARSLAST(J22),0);
J29:=IF(J1E AND REF(HIGH,BARSLAST(J22))<=REF(HIGH,BARSLAST(J24)),BARSLAST(J24),BARSLAST(J22));
J2A:=IF(J27=2 AND J1E,J29,0);
J2B:=IF(J27>=3 AND J1E,IF(J1E AND REF(HIGH,J29)<=REF(HIGH,BARSLAST(J26)),BARSLAST(J26),J29),0);
J2C:=J28+J2A+J2B;
J2D:=BACKSET(J1E,J2C);
J2E:=J2D>REF(J2D,1);
J2F:=BACKSET(J2E,2);
J30:=J2F>REF(J2F,1);
J37:=BACKSET(J1,BARSLAST(J1D)+1);
J38:=J37>REF(J37,1);
J39:=BACKSET(J38,REF(BARSLAST(J1D),1)+2);
J3A:=J39>REF(J39,1);
J3B:=BACKSET(J1,BARSLAST(J30)+1);
J3C:=J3B>REF(J3B,1);
J3D:=BACKSET(J3C,REF(BARSLAST(J30),1)+2);
J3E:=J3D>REF(J3D,1);
前一低: REF(LOW,BARSLAST(J38)),ColorWHITE,PointDot,Linethick3;
前二低: REF(LOW,BARSLAST(J3A)),Colormagenta,PointDot,Linethick2;
前一高: REF(HIGH,BARSLAST(J3C)),ColorWHITE,PointDot,Linethick3;
前二高: REF(HIGH,BARSLAST(J3E)),Colormagenta,PointDot,Linethick2;
解答如下:
原来公式有点罗嗦了,可以这样
input:N(5);
J1:=BARSTATUS=2;
J2:=REF(HIGH,N)=HHV(HIGH,2*N+1);
J3:=FILTER(J2,N);
J4:=BACKSET(J3,N+1);
J5:=FILTER(J4,N);
J6:=J5 OR J1;
J7:=REF(LOW,N)=LLV(LOW,2*N+1);
J8:=FILTER(J7,N);
J9:=BACKSET(J8,N+1);
JA:=FILTER(J9,N);
JB:=JA AND NOT(J5);
HORILINE(J6,h,J6 ),Colorffffff,DOTLINE; 高参考:ref(ref(h,BARSLAST(J6)),1),Linethick0;
HORILINE(JB,l,JB ),Color00ffff,DOTLINE; 低参考:ref(ref(l,BARSLAST(Jb)),1),Linethick0;
选股和预计用高参考,低参考