红白双娇优化,
增加K线叠加
DRAWGBK(1, COLORRGB(60,15,35) ,COLORRGB(50,50,90),1);
xxL:=LLV(FORCAST(c,10),30),colorgreen,linethick1;
xxH:=HHV(FORCAST(CLOSE,10),30),colorgreen,linethick1;
a2:=hhv(l,20);
a22:=ma(a2,3),colormagenta,linethick3;
a4:=llv(h,20);
a44:=ma(a4,3),colormagenta,linethick3;
fillrgn(xxH>a22,xxH,a22),color440000;{多空通道}{多空通道}{多空通道}
fillrgn(xxH<a22,xxH,a22),color440000;{多空通道}{多空通道}{多空通道}
fillrgn(XXL<a44,XXL,a44),color000000;{多空通道}{多空通道}{多空通道}
fillrgn(XXL>a44,XXL,a44),color000000;{多空通道}{多空通道}{多空通道}
atr:=max((H-L),max(abs(H-ref(c,1)),abs(L-ref(c,1)) ));
low1:=Max( ( Ref(HIGH,1) - LOW ) / ( ( Ref(Sum (Atr ,2 ),1) / 2) * Sqrt( 2 ) ) ,
Max( (Ref(HIGH,2) -LOW) / ( ( Ref(Sum (Atr ,3),1) / 3) * Sqrt( 3 ) ),
Max( (Ref(HIGH,3) - LOW) / ( (Ref(Sum (Atr ,4) ,1) / 4) * Sqrt( 4 ) ) ,
Max( ( Ref( HIGH,4) - LOW) / ( (Ref(Sum(Atr,5),1) / 5) * Sqrt( 5 ) ),
Max( (Ref(HIGH,5) - LOW) / ( (Ref( Sum( Atr,6),1) / 6 ) * Sqrt( 6 ) ),
Max( ( Ref(HIGH,6) -LOW) / ( (Ref( Sum( Atr,7),1) / 7) * Sqrt( 7 ) ),
Max((Ref(HIGH,7)-LOW) / ( (Ref(Sum (Atr,8),1) /8) * Sqrt(8) ),
Max((Ref(HIGH,8)-LOW) / ( (Ref(Sum (Atr ,9),1) / 9) * Sqrt( 9 ) ),
Max((Ref(HIGH,9)-LOW) / ( (Ref(Sum (Atr ,10),1) / 10) * Sqrt( 10 ) ),
Max((Ref(HIGH,10)-LOW) / ( (Ref(Sum (Atr ,11),1) / 11) * Sqrt( 11 ) ),
Max((Ref(HIGH,11)-LOW) / ( (Ref(Sum (Atr ,12),1) / 12) * Sqrt( 12 ) ),
Max((Ref(HIGH,12)-LOW) / ( (Ref(Sum (Atr ,13),1) / 13) * Sqrt( 13 ) ),
Max((Ref(HIGH,13)-LOW) / ( (Ref(Sum (Atr ,14),1) / 14) * Sqrt( 14 ) ),
Max((Ref(HIGH,14)-LOW) / ( (Ref(Sum (Atr ,15),1) / 15) * Sqrt( 15 ) ),
Max((Ref(HIGH,15)-LOW) / ( (Ref(Sum (Atr ,16),1) / 16) * Sqrt( 16 ) ),
Max((Ref(HIGH,16)-LOW) / ( (Ref(Sum (Atr ,17),1) / 17) * Sqrt( 17 ) ),
Max((Ref(HIGH,17)-LOW) / ( (Ref(Sum (Atr ,18),1) / 18) * Sqrt( 18 ) ),
Max((Ref(HIGH,18)-LOW) / ( (Ref(Sum (Atr ,19),1) / 19) * Sqrt( 19 ) ),
Max((Ref(HIGH,19)-LOW) / ( (Ref(Sum (Atr ,20),1) / 20) * Sqrt( 20 ) ),
Max((Ref(HIGH,20)-LOW) / ( (Ref(Sum (Atr ,21),1) / 21) * Sqrt( 21 ) ),
Max((Ref(HIGH,21)-LOW) / ( (Ref(Sum (Atr ,22),1) / 22) * Sqrt( 22 ) ),
Max((Ref(HIGH,22)-LOW) / ( (Ref(Sum (Atr ,23),1) / 23) * Sqrt( 23 ) ),
Max((Ref(HIGH,23)-LOW) / ( (Ref(Sum (Atr ,24),1) / 24) * Sqrt( 24 ) ),
Max((Ref(HIGH,24)-LOW) / ( (Ref(Sum (Atr ,25),1) / 25) * Sqrt( 25 ) ),
Max((Ref(HIGH,25)-LOW) / ( (Ref(Sum (Atr ,26),1) / 26) * Sqrt( 26 ) ),
Max((Ref(HIGH,26)-LOW) / ( (Ref(Sum (Atr ,27),1) / 27) * Sqrt( 27 ) ),
Max((Ref(HIGH,27)-LOW) / ( (Ref(Sum (Atr ,28),1) / 28) * Sqrt( 28 ) ),
Max((Ref(HIGH,28)-LOW) / ( (Ref(Sum (Atr ,29),1) / 29) * Sqrt( 29 ) ),
Max((Ref(HIGH,29)-LOW) / ( (Ref(Sum (Atr ,30),1) / 30) * Sqrt( 30 ) ),
Max((Ref(HIGH,30)-LOW) / ( (Ref(Sum (Atr ,31),1) / 31) * Sqrt( 31 ) ),
Max((Ref(HIGH,31)-LOW) / ( (Ref(Sum (Atr ,32),1) / 32) * Sqrt( 32 ) ),
Max((Ref(HIGH,32)-LOW) / ( (Ref(Sum (Atr ,33),1) / 33) * Sqrt( 33 ) ),
Max((Ref(HIGH,33)-LOW) / ( (Ref(Sum (Atr ,34),1) / 34) * Sqrt( 34 ) ),
Max((Ref(HIGH,34)-LOW) / ( (Ref(Sum (Atr ,35),1) / 35) * Sqrt( 35 ) ),
Max((Ref(HIGH,35)-LOW) / ( (Ref(Sum (Atr ,36),1) / 36) * Sqrt( 36 ) ),
Max((Ref(HIGH,36)-LOW) / ( (Ref(Sum (Atr ,37),1) / 37) * Sqrt( 37 ) ),
Max((Ref(HIGH,37)-LOW) / ( (Ref(Sum (Atr ,38),1) / 38) * Sqrt( 38 ) ),
Max((Ref(HIGH,38)-LOW) / ( (Ref(Sum (Atr ,39),1) / 39) * Sqrt( 39 ) ),
Max((Ref(HIGH,39)-LOW) / ( (Ref(Sum (Atr ,40),1) / 40) * Sqrt( 40 ) ),
Max((Ref(HIGH,40)-LOW) / ( (Ref(Sum (Atr ,41),1) / 41) * Sqrt( 41 ) ),
Max((Ref(HIGH,41)-LOW) / ( (Ref(Sum (Atr ,42),1) / 42) * Sqrt( 42 ) ),
Max((Ref(HIGH,42)-LOW) / ( (Ref(Sum (Atr ,43),1) / 43) * Sqrt( 43 ) ),
Max((Ref(HIGH,43)-LOW) / ( (Ref(Sum (Atr ,44),1) / 44) * Sqrt( 44 ) ),
Max((Ref(HIGH,44)-LOW) / ( (Ref(Sum (Atr ,45),1) / 45) * Sqrt( 45 ) ),
Max((Ref(HIGH,45)-LOW) / ( (Ref(Sum (Atr ,46),1) / 46) * Sqrt( 46 ) ),
Max((Ref(HIGH,46)-LOW) / ( (Ref(Sum (Atr ,47),1) / 47) * Sqrt( 47 ) ),
Max((Ref(HIGH,47)-LOW) / ( (Ref(Sum (Atr ,48),1) / 48) * Sqrt( 48 ) ),
Max((Ref(HIGH,48)-LOW) / ( (Ref(Sum (Atr ,49),1) / 49) * Sqrt( 49 ) ),
Max((Ref(HIGH,49)-LOW) / ( (Ref(Sum (Atr ,50),1) / 50) * Sqrt( 50 ) ),
Max((Ref(HIGH,50)-LOW) / ( (Ref(Sum (Atr ,51),1) / 51) * Sqrt( 51 ) ),
Max((Ref(HIGH,51)-LOW) / ( (Ref(Sum (Atr ,52),1) / 52) * Sqrt( 52 ) ),
Max((Ref(HIGH,52)-LOW) / ( (Ref(Sum (Atr ,53),1) / 53) * Sqrt( 53 ) ),
Max((Ref(HIGH,53)-LOW) / ( (Ref(Sum (Atr ,54),1) / 54) * Sqrt( 54 ) ),
Max((Ref(HIGH,54)-LOW) / ( (Ref(Sum (Atr ,55),1) / 55) * Sqrt( 55 ) ),
Max((Ref(HIGH,55)-LOW) / ( (Ref(Sum (Atr ,56),1) / 56) * Sqrt( 56 ) ),
Max((Ref(HIGH,56)-LOW) / ( (Ref(Sum (Atr ,57),1) / 57) * Sqrt( 57 ) ),
Max((Ref(HIGH,57)-LOW) / ( (Ref(Sum (Atr ,58),1) / 58) * Sqrt( 58 ) ),
Max((Ref(HIGH,58)-LOW) / ( (Ref(Sum (Atr ,59),1) / 59) * Sqrt( 59 ) ),
Max((Ref(HIGH,59)-LOW) / ( (Ref(Sum (Atr ,60),1) / 60) * Sqrt( 60 ) ),
Max((Ref(HIGH,60)-LOW) / ( (Ref(Sum (Atr ,61),1) / 61) * Sqrt( 61 ) ),
Max((Ref(HIGH,61)-LOW) / ( (Ref(Sum (Atr ,62),1) / 62) * Sqrt( 62 ) ),
Max((Ref(HIGH,62)-LOW) / ( (Ref(Sum (Atr ,63),1) / 63) * Sqrt( 63 ) ),
Max((Ref(HIGH,63)-LOW) / ( (Ref(Sum (Atr ,64),1) / 64) * Sqrt( 64 ) ),
Max((Ref(HIGH,64)-LOW) / ( (Ref(Sum (Atr ,65),1) / 65) * Sqrt( 65 ) ),
Max((Ref(HIGH,65)-LOW) / ( (Ref(Sum (Atr ,66),1) / 66) * Sqrt( 66 ) ),
Max((Ref(HIGH,66)-LOW) / ( (Ref(Sum (Atr ,67),1) / 67) * Sqrt( 67 ) ),
Max((Ref(HIGH,67)-LOW) / ( (Ref(Sum (Atr ,68),1) / 68) * Sqrt( 68 ) ),
Max((Ref(HIGH,68)-LOW) / ( (Ref(Sum (Atr ,69),1) / 69) * Sqrt( 69 ) ),
Max((Ref(HIGH,69)-LOW) / ( (Ref(Sum (Atr ,70),1) / 70) * Sqrt( 70 ) ),
Max((Ref(HIGH,70)-LOW) / ( (Ref(Sum (Atr ,71),1) / 71) * Sqrt( 71 ) ),
Max((Ref(HIGH,71)-LOW) / ( (Ref(Sum (Atr ,72),1) / 72) * Sqrt( 72 ) ),
Max((Ref(HIGH,72)-LOW) / ( (Ref(Sum (Atr ,73),1) / 73) * Sqrt( 73 ) ),
Max((Ref(HIGH,73)-LOW) / ( (Ref(Sum (Atr ,74),1) / 74) * Sqrt( 74 ) ),
Max((Ref(HIGH,74)-LOW) / ( (Ref(Sum (Atr ,75),1) / 75) * Sqrt( 75 ) ),
Max((Ref(HIGH,75)-LOW) / ( (Ref(Sum (Atr ,76),1) / 76) * Sqrt( 76 ) ),
Max((Ref(HIGH,76)-LOW) / ( (Ref(Sum (Atr ,77),1) / 77) * Sqrt( 77 ) ),
Max((Ref(HIGH,77)-LOW) / ( (Ref(Sum (Atr ,78),1) / 78) * Sqrt( 78 ) ),
Max((Ref(HIGH,78)-LOW) / ( (Ref(Sum (Atr ,79),1) / 79) * Sqrt( 79 ) ),
Max((Ref(HIGH,79)-LOW) / ( (Ref(Sum (Atr ,80),1) / 80) * Sqrt( 80 ) ),
Max((Ref(HIGH,80)-LOW) / ( (Ref(Sum (Atr ,81),1) / 81) * Sqrt( 81 ) ),
Max((Ref(HIGH,81)-LOW) / ( (Ref(Sum (Atr ,82),1) / 82) * Sqrt( 82 ) ),
Max((Ref(HIGH,82)-LOW) / ( (Ref(Sum (Atr ,83),1) / 83) * Sqrt( 83 ) ),
Max((Ref(HIGH,83)-LOW) / ( (Ref(Sum (Atr ,84),1) / 84) * Sqrt( 84 ) ),
Max((Ref(HIGH,84)-LOW) / ( (Ref(Sum (Atr ,85),1) / 85) * Sqrt( 85 ) ),
Max((Ref(HIGH,85)-LOW) / ( (Ref(Sum (Atr ,86),1) / 86) * Sqrt( 86 ) ),
Max((Ref(HIGH,86)-LOW) / ( (Ref(Sum (Atr ,87),1) / 87) * Sqrt( 87 ) ),
Max((Ref(HIGH,87)-LOW) / ( (Ref(Sum (Atr ,88),1) / 88) * Sqrt( 88 ) ),
Max((Ref(HIGH,88)-LOW) / ( (Ref(Sum (Atr ,89),1) / 89) * Sqrt( 89 ) ),
Max((Ref(HIGH,89)-LOW) / ( (Ref(Sum (Atr ,90),1) / 90) * Sqrt( 90 ) ),
Max((Ref(HIGH,90)-LOW) / ( (Ref(Sum (Atr ,91),1) / 91) * Sqrt( 91 ) ),
Max((Ref(HIGH,91)-LOW) / ( (Ref(Sum (Atr ,92),1) / 92) * Sqrt( 92 ) ),
Max((Ref(HIGH,92)-LOW) / ( (Ref(Sum (Atr ,93),1) / 93) * Sqrt( 93 ) ),
Max((Ref(HIGH,93)-LOW) / ( (Ref(Sum (Atr ,94),1) / 94) * Sqrt( 94 |