gspt1:=REF(CLOSE,2)/REF(CLOSE,1)>=1.04;
gspt2:=REF(gspt1,1);
gspt3:=MA(CLOSE,5);
gspt4:=MA(CLOSE,10);
gspt5:=MA(CLOSE,60);
gspt6:=MA(CLOSE,120);
gspt7:=REF(CLOSE,1)< REF(gspt3,1) AND OPEN< gspt3 AND gspt3>gspt6;
gspt8:=REF(gspt7,1)=0 AND gspt7;
gspt9:=EMA(HHV(HIGH,1),8);
gspt10:=EMA(CLOSE,8);
gspt11:=gspt10< REF(gspt10,1) AND CLOSE< gspt10;
gspt12:=IF(gspt9< REF(gspt9,1) OR gspt11,1,0);
gspt13:=(COUNT(gspt12=1,4)=3 AND gspt12=0)*89;
gspt14:=VOL/((HIGH-LOW)*2-ABS(CLOSE-OPEN));
gspt15:=IF(CLOSE>OPEN,gspt14*(HIGH-LOW),IF(CLOSE< OPEN,gspt14*(HIGH-OPEN+CLOSE-LOW),VOL/2))+IF(CLOSE>OPEN,0-gspt14*(HIGH-CLOSE+OPEN-LOW),IF(CLOSE< OPEN,0-gspt14*(HIGH-LOW),0-VOL/2));
gspt16:=gspt15/20/1.15;
gspt17:=gspt16*0.55+REF(gspt16,1)*0.33+REF(gspt16,2)*0.22;
gspt18:=EMA(gspt17,3);
gspt19:=gspt18< 100;
gspt20:=COUNT(gspt19,9)< 2;
gspt21:=CLOSE/REF(CLOSE,1)>1.09;
gspt22:=CLOSE=HIGH;
gspt23:=REF(gspt21,1) AND REF(gspt22,1);
gspt24:=COUNT(gspt23,11)>0;
gspt25:=MA(CLOSE,3);
gspt26:=(CLOSE-REF(CLOSE,1))/REF(CLOSE,1)*100;
gspt27:=(HIGH-REF(CLOSE,1))/REF(CLOSE,1)*100;
gspt28:=REF(HHV(VOL,10),1);
gspt29:=MA(CLOSE,20);
gspt30:=(gspt25+gspt3)/2;
gspt31:=COUNT(COUNT(gspt26>9.9 AND CLOSE=HIGH,1)>=1,30)>0;
gspt32:=COUNT(COUNT(gspt26>9.9 AND CLOSE=HIGH,1)>=1,60)>0;
gspt33:=gspt29>REF(gspt29,1) AND VOL< gspt28 AND gspt31 AND gspt27>3 AND OPEN<=gspt3 AND CLOSE>gspt3 AND (COUNT(gspt30>REF(gspt30,1),3)>=3 OR COUNT(gspt3>REF(gspt3,1),3)>=3) AND COUNT(gspt29>REF(gspt29,1),25)>=16;
gspt34:=(CLOSE-OPEN)/OPEN*100;
gspt35:=gspt32 AND VOL< 1.3*REF(VOL,1) AND COUNT(gspt34>0.5,6)>=5 AND COUNT(gspt25>gspt3,5)>=5 AND COUNT(HIGH>REF(HIGH,1),6)>=5 AND gspt27>4.5 AND OPEN<=gspt25 AND CLOSE>gspt25 AND OPEN>gspt3;
gspt36:=gspt33 OR gspt35;
gspt37:=gspt36=1 AND COUNT(gspt36,15)=1;
gspt38:=AMOUNT/VOL/7;
gspt39:=(3*HIGH+LOW+OPEN+2*CLOSE)/7;
gspt40:=SUM(AMOUNT,10)/gspt38/7;
gspt41:=DMA(gspt39,VOL/gspt40);
gspt42:=(CLOSE-gspt41)/gspt41*100;
gspt43:=-gspt42;
gspt44:=gspt42>gspt43;
gspt45:=CROSS(gspt42,0.6) AND gspt44;
gspt46:=EMA(CLOSE/REF(CLOSE,1),5);
gspt47:=EMA(CLOSE/REF(CLOSE,1),10);
gspt48:=CROSS(gspt46,gspt47);
gspt49:=gspt45 AND gspt48;
gspt50:=gspt49 AND gspt37;
gspt51:=COUNT(gspt37,10)>0;
gspt52:=gspt49 AND gspt51 AND gspt24;
gspt53:=gspt49 AND gspt24 AND gspt13;
gspt54:=gspt50 AND gspt24;
gspt55:=gspt52 OR gspt54 OR gspt53;
gspt56:=(EMA(CLOSE,12)-EMA(CLOSE,26))/EMA(CLOSE,26)*100;
gspt57:=EMA(gspt56,9);
gspt58:=(gspt56-gspt57)*100;
gspt59:=gspt58-REF(gspt58,1);
gspt60:=CROSS(gspt59,50);
gspt61:=EMA(EMA(EMA(CLOSE,12),12),12);
gspt62:=(gspt61-REF(gspt61,1))/REF(gspt61,1)*100;
gspt63:=MA(gspt62,9);
gspt64:=gspt62>gspt63;
gspt65:=CLOSE/REF(CLOSE,1)>1.09;
gspt66:=CLOSE=HIGH;
gspt67:=REF(gspt65,1) AND REF(gspt66,1);
gspt68:=COUNT(gspt67,4)>0;
gspt69:=COUNT(gspt67,5)>0;
gspt70:=(3*CLOSE+LOW+OPEN+HIGH)/6;
gspt71:=(20*gspt70+19*REF(gspt70,1)+18*REF(gspt70,2)+17*REF(gspt70,3)+16*REF(gspt70,4)+15*REF(gspt70,5)+14*REF(gspt70,6)+13*REF(gspt70,7)+12*REF(gspt70,8)+11*REF(gspt70,9)+10*REF(gspt70,10)+9*REF(gspt70,11)+8*REF(gspt70,12)+7*REF(gspt70,13)+6*REF(gspt70,14)+5*REF(gspt70,15)+4*REF(gspt70,16)+3*REF(gspt70,17)+2*REF(gspt70,18)+REF(gspt70,20))/210;
gspt72:=MA(gspt71,6);
gspt73:=gspt71>gspt72;
gspt74:=CLOSE>1.02*REF(CLOSE,1);
gspt75:=(CLOSE-REF(CLOSE,1))/REF(CLOSE,1)*100< (-6);
gspt76:=REF(CLOSE,1)>(REF(CLOSE,BARSLAST(gspt74))+REF(CLOSE,BARSLAST(gspt74)+1))/2 AND CLOSE< (REF(CLOSE,BARSLAST(gspt74))+REF(CLOSE,BARSLAST(gspt74)+1))/2;
gspt77:=REF(CLOSE,1)< (REF(CLOSE,BARSLAST(gspt75))+REF(CLOSE,BARSLAST(gspt75)+1))/2 AND CLOSE>(REF(CLOSE,BARSLAST(gspt75))+REF(CLOSE,BARSLAST(gspt75)+1))/2;
gspt78:=BARSLAST(gspt75)<=7 AND gspt74 AND gspt77 AND COUNT(gspt74,BARSLAST(gspt75))=1 AND NOT(HIGH=LOW) AND REF(NOT(HIGH=LOW),BARSLAST(gspt75))=1;
gspt79:=COUNT(gspt78,7)>0;
gspt80:=((CLOSE-REF(MA(CLOSE,6),1))/6+MA(CLOSE,6))*1.004;
gspt81:=CROSS(CLOSE,gspt80) AND gspt80>REF(gspt80,1);
gspt82:=((CLOSE-REF(MA(CLOSE,18),1))/18+MA(CLOSE,18))*1.004;
gspt83:=CROSS(CLOSE,gspt82) AND gspt82>REF(gspt82,1);
gspt84:=gspt81 AND gspt83 AND gspt78 AND gspt73 AND gspt64;
gspt85:=gspt68 AND gspt78 AND gspt73 AND gspt64;
gspt86:=gspt84 OR gspt85;
gspt87:=REF(CLOSE>OPEN AND REF(HIGH=CLOSE,1) AND OPEN>REF(CLOSE,1),1) OR (OPEN< REF(CLOSE,1) AND REF(CLOSE< OPEN,1) AND CLOSE/REF(CLOSE,1)< 0.97 AND LOW/REF(CLOSE,1)< 0.927) OR (LOW/REF(CLOSE,1)< 1.008 AND CLOSE/REF(CLOSE,1)< 1.0199 AND CLOSE/OPEN< 0.955 AND OPEN/CLOSE< 1.13 AND REF(HIGH=CLOSE,1)) OR (REF(CLOSE< OPEN,1) AND (CLOSE< REF(LOW,2) OR CLOSE/REF(CLOSE,2)< 0.945) AND CLOSE/REF(CLOSE,2)< 0.965) AND CLOSE/LOW< 1.051 AND NOT(HIGH=LOW);
gspt88:=REF(REF(CLOSE/REF(CLOSE,4)>=1.13,3) OR REF(CLOSE/REF(CLOSE,3)>=1.1,1) OR REF(CLOSE/REF(CLOSE,4)>=1.073,2) OR REF(CLOSE/REF(CLOSE,1)>=1.089,1) OR CLOSE/REF(CLOSE,2)>=1.089 OR CLOSE/REF(CLOSE,4)>=1.073 AND COUNT(CLOSE>=OPEN,4)>=1,1);
gspt89:=CLOSE/REF(CLOSE,1)< 0.955 OR CLOSE/REF(CLOSE,1)< 0.963 AND REF(CLOSE< OPEN,1) OR CLOSE/REF(CLOSE,1)< 0.965 AND REF(CLOSE< OPEN,1) OR CLOSE< REF((CLOSE+OPEN)/2,2) OR CLOSE/REF(CLOSE,1)< 0.966 AND CLOSE< REF(OPEN,1) AND LOW< REF(LOW,1);
gspt90:=gspt87 OR gspt88 OR gspt89;
gspt91:=(CLOSE-REF(CLOSE,1))/REF(CLOSE,1)*100< (-6);
gspt92:=CLOSE>1.02*REF(CLOSE,1);
gspt93:=gspt91 AND gspt90;
gspt94:=REF(CLOSE,1)< (REF(CLOSE,BARSLAST(gspt93))+REF(CLOSE,BARSLAST(gspt93)+1))/2 AND CLOSE>(REF(CLOSE,BARSLAST(gspt93))+REF(CLOSE,BARSLAST(gspt93)+1))/2;
gspt95:=BARSLAST(gspt93)<=7 AND gspt92 AND gspt94 AND COUNT(gspt92,BARSLAST(gspt93))=1 AND NOT(HIGH=LOW) AND REF(NOT(HIGH=LOW),BARSLAST(gspt93))=1;
gspt96:=gspt95 AND gspt87=0 AND gspt86=0 AND gspt1;
STICKLINE(gspt96,CLOSE,OPEN,6,0),COLORLIMAGENTA;
STICKLINE(gspt96,CLOSE,OPEN,2,0),COLORYELLOW,LINETHICK2;
DRAWICON(gspt96,LOW*0.99,25);