找了很久才找到这段代码,相对有效降低金融交易风险。
HH:=(O+H+C)*(1.02-1)/3+H;
AB:=C>REF(C,4);
X9:=EVERY(AB,9);
X8:=EVERY(AB,8);
X7:=EVERY(AB,7);
X6:=EVERY(AB,6);
X5:=EVERY(AB,5);
X4:=EVERY(AB,4);
X3:=EVERY(AB,3);
X2:=EVERY(AB,2);
X1:=EVERY(AB,1);
Y9:=REF(X9,1)=0;
Y8:=REF(X8,1)=0;
Y7:=REF(X7,1)=0;
Y6:=REF(X6,1)=0;
Y5:=REF(X5,1)=0;
Y4:=REF(X4,1)=0;
Y3:=REF(X3,1)=0;
Y2:=REF(X2,1)=0;
Y1:=REF(X1,1)=0;
Z81:=REFX(X8,1)=0;
Z71:=REFX(X7,1)=0;
Z72:=REFX(X7,2)=0;
Z61:=REFX(X6,1)=0;
Z62:=REFX(X6,2)=0;
Z63:=REFX(X6,3)=0;
Z51:=REFX(X5,1)=0;
Z52:=REFX(X5,2)=0;
Z53:=REFX(X5,3)=0;
Z54:=REFX(X5,4)=0;
Z41:=REFX(X4,1)=0;
Z42:=REFX(X4,2)=0;
Z43:=REFX(X4,3)=0;
Z44:=REFX(X4,4)=0;
Z45:=REFX(X4,5)=0;
Z31:=REFX(X3,1)=0;
Z32:=REFX(X3,2)=0;
Z33:=REFX(X3,3)=0;
Z34:=REFX(X3,4)=0;
Z35:=REFX(X3,5)=0;
Z36:=REFX(X3,6)=0;
Z21:=REFX(X2,1)=0;
Z22:=REFX(X2,2)=0;
Z23:=REFX(X2,3)=0;
Z24:=REFX(X2,4)=0;
Z25:=REFX(X2,5)=0;
Z26:=REFX(X2,6)=0;
Z27:=REFX(X2,7)=0;
Z11:=REFX(X1,1)=0;
Z12:=REFX(X1,2)=0;
Z13:=REFX(X1,3)=0;
Z14:=REFX(X1,4)=0;
Z15:=REFX(X1,5)=0;
Z16:=REFX(X1,6)=0;
Z17:=REFX(X1,7)=0;
Z18:=REFX(X1,8)=0;
Z881:=NOT(Z81);
Z771:=NOT(Z71);
Z772:=NOT(Z72);
Z661:=NOT(Z61);
Z662:=NOT(Z62);
Z663:=NOT(Z63);
Z551:=NOT(Z51);
Z552:=NOT(Z52);
Z553:=NOT(Z53);
Z554:=NOT(Z54);
Z441:=NOT(Z41);
Z442:=NOT(Z42);
Z443:=NOT(Z43);
Z444:=NOT(Z44);
Z445:=NOT(Z45);
Z331:=NOT(Z31);
Z332:=NOT(Z32);
Z333:=NOT(Z33);
Z334:=NOT(Z34);
Z335:=NOT(Z35);
Z336:=NOT(Z36);
Z221:=NOT(Z21);
Z222:=NOT(Z22);
Z223:=NOT(Z23);
Z224:=NOT(Z24);
Z225:=NOT(Z25);
Z226:=NOT(Z26);
Z227:=NOT(Z27);
Z111:=NOT(Z11);
Z112:=NOT(Z12);
Z113:=NOT(Z13);
Z114:=NOT(Z14);
Z115:=NOT(Z15);
Z116:=NOT(Z16);
Z117:=NOT(Z17);
Z118:=NOT(Z18);
B9:=X9 AND Y9;
B8:=X8 AND Y8 AND Z881;
B7:=X7 AND Y7 AND Z771 AND Z772;
B6:=X6 AND Y6 AND Z661 AND Z662 AND Z663;
B5:=X5 AND Y5 AND Z551 AND Z552 AND Z553 AND Z554;
B4:=X4 AND Y4 AND Z441 AND Z442 AND Z443 AND Z444 AND Z445;
B3:=X3 AND Y3 AND Z331 AND Z332 AND Z333 AND Z334 AND Z335 AND Z336;
B2:=X2 AND Y2 AND Z221 AND Z222 AND Z223 AND Z224 AND Z225 AND Z226 AND Z227;
B1:=X1 AND Y1 AND Z111 AND Z112 AND Z113 AND Z114 AND Z115 AND Z116 AND Z117 AND Z118;
CC9:DRAWTEXT(B9,HH,'9'),COLORGREEN;
CC8:DRAWTEXT(B8,HH,'8'),COLORBLUE;
CC7:DRAWTEXT(B7,HH,'7'),COLORBLUE;
CC6:DRAWTEXT(B6,HH,'6'),COLORBLUE;
CC5:DRAWTEXT(B5,HH,'5'),COLORBLUE;
CC4:DRAWTEXT(B4,HH,'4'),COLORBLUE;
CC3:DRAWTEXT(B3,HH,'3'),COLORBLUE;
CC2:DRAWTEXT(B2,HH,'2'),COLORBLUE;
CC1:DRAWTEXT(B1,HH,'1'),COLORBLUE;LL:=L-(O+H+C)*(1.02-1)/3;
BA:=C;
R9:=EVERY(BA,9);
R8:=EVERY(BA,8);
R7:=EVERY(BA,7);
R6:=EVERY(BA,6);
R5:=EVERY(BA,5);
R4:=EVERY(BA,4);
R3:=EVERY(BA,3);
R2:=EVERY(BA,2);
R1:=EVERY(BA,1);
S9:=REF(R9,1)=0;
S8:=REF(R8,1)=0;
S7:=REF(R7,1)=0;
S6:=REF(R6,1)=0;
S5:=REF(R5,1)=0;
S4:=REF(R4,1)=0;
S3:=REF(R3,1)=0;
S2:=REF(R2,1)=0;
S1:=REF(R1,1)=0;
T81:=REFX(R8,1)=0;
T71:=REFX(R7,1)=0;
T72:=REFX(R7,2)=0;
T61:=REFX(R6,1)=0;
T62:=REFX(R6,2)=0;
T63:=REFX(R6,3)=0;
T51:=REFX(R5,1)=0;
T52:=REFX(R5,2)=0;
T53:=REFX(R5,3)=0;
T54:=REFX(R5,4)=0;
T41:=REFX(R4,1)=0;
T42:=REFX(R4,2)=0;
T43:=REFX(R4,3)=0;
T44:=REFX(R4,4)=0;
T45:=REFX(R4,5)=0;
T31:=REFX(R3,1)=0;
T32:=REFX(R3,2)=0;
T33:=REFX(R3,3)=0;
T34:=REFX(R3,4)=0;
T35:=REFX(R3,5)=0;
T36:=REFX(R3,6)=0;
T21:=REFX(R2,1)=0;
T22:=REFX(R2,2)=0;
T23:=REFX(R2,3)=0;
T24:=REFX(R2,4)=0;
T25:=REFX(R2,5)=0;
T26:=REFX(R2,6)=0;
T27:=REFX(R2,7)=0;
T11:=REFX(R1,1)=0;
T12:=REFX(R1,2)=0;
T13:=REFX(R1,3)=0;
T14:=REFX(R1,4)=0;
T15:=REFX(R1,5)=0;
T16:=REFX(R1,6)=0;
T17:=REFX(R1,7)=0;
T18:=REFX(R1,8)=0;
T881:=NOT(T81);
T771:=NOT(T71);
T772:=NOT(T72);
T661:=NOT(T61);
T662:=NOT(T62);
T663:=NOT(T63);
T551:=NOT(T51);
T552:=NOT(T52);
T553:=NOT(T53);
T554:=NOT(T54);
T441:=NOT(T41);
T442:=NOT(T42);
T443:=NOT(T43);
T444:=NOT(T44);
T445:=NOT(T45);
T331:=NOT(T31);
T332:=NOT(T32);
T333:=NOT(T33);
T334:=NOT(T34);
T335:=NOT(T35);
T336:=NOT(T36);
T221:=NOT(T21);
T222:=NOT(T22);
T223:=NOT(T23);
T224:=NOT(T24);
T225:=NOT(T25);
T226:=NOT(T26);
T227:=NOT(T27);
T111:=NOT(T11);
T112:=NOT(T12);
T113:=NOT(T13);
T114:=NOT(T14);
T115:=NOT(T15);
T116:=NOT(T16);
T117:=NOT(T17);
T118:=NOT(T18);
A9:=R9 AND S9;
A8:=R8 AND S8 AND T881;
A7:=R7 AND S7 AND T771 AND T772;
A6:=R6 AND S6 AND T661 AND T662 AND T663;
A5:=R5 AND S5 AND T551 AND T552 AND T553 AND T554;
A4:=R4 AND S4 AND T441 AND T442 AND T443 AND T444 AND T445;
A3:=R3 AND S3 AND T331 AND T332 AND T333 AND T334 AND T335 AND T336;
A2:=R2 AND S2 AND T221 AND T222 AND T223 AND T224 AND T225 AND T226 AND T227;
A1:=R1 AND S1 AND T111 AND T112 AND T113 AND T114 AND T115 AND T116 AND T117 AND T118;
CD9:DRAWTEXT(A9,LL,'9'),COLORGREEN;
CD8:DRAWTEXT(A8,LL,'8'),COLORBLUE;
CD7:DRAWTEXT(A7,LL,'7'),COLORBLUE;
CD6:DRAWTEXT(A6,LL,'6'),COLORBLUE;
CD5:DRAWTEXT(A5,LL,'5'),COLORBLUE;
CD4:DRAWTEXT(A4,LL,'4'),COLORBLUE;
CD3:DRAWTEXT(A3,LL,'3'),COLORBLUE;
CD2:DRAWTEXT(A2,LL,'2'),COLORBLUE;
CD1:DRAWTEXT(A1,LL,'1'),COLORBLUE;
把上述代码复制粘贴到指标管理器保存就可以直接使用。