X1:=(Ema(C,5)-EMA(C,13))/EMA(C,13)*100;
X2:=(EMA(C,5)-EMA(C,34))/EMA(C,13)*100;
X3:=(EMA(C,5)-EMA(C,60))/EMA(C,13)*100;
X4:=(EMA(C,5)-EMA(C,120))/EMA(C,13)*100;
X5:=V/CAPITAL*(C+O+L+H)/4;
X6:=(H-MAX(C,O))-(MIN(C,O)-L)+(C-REF(C,1));
X7:=IF(X6>0,X5,0-X5);
X8:=H-MAX(C,O)-(MIN(C,O)-L);
X9:=(X7+X8)/2+C-REF(C,1);
X10:=SUM(X9,0)+100;
X11:=EMA(X10,5)+100;
X12:=EMA(X10,13)+100;
X13:=EMA(X10,34)+100;
X14:=EMA(X10,60)+100;
X15:=EMA(X10,120)+100;
X16:=(X11-X12)/EMA(C,13)*100;
X17:=(X11-X13)/EMA(C,13)*100;
X18:=(X11-X14)/EMA(C,13)*100;
X19:=(X11-X15)/EMA(C,13)*100;
X20:=(X19-X16);
X21:=(X19-X17);
X22:=(X19-X18);
Y1:=3*SMA((C-LLV(L,75))/(HHV(H,75)-LLV(L,75))*100,20,1);
Y2:=2*SMA(SMA((C-LLV(L,75))/(HHV(H,75)-LLV(L,75))*100,20,1),15,1);
Y3:=Y1-Y2;
Y4:=100-Y3;
Y5:=(0-(EMA(Y4,1)-50))+50;
Y6:=(0-(EMA(Y4,12)-50))+50;
Z1:=3*SMA((C-LLV(L,27))/(HHV(H,27)-LLV(L,27))*100,5,1);
Z2:=2*SMA(SMA((C-LLV(L,27))/(HHV(H,27)-LLV(L,27))*100,5,1),3,1);
Z3:=(Z1-Z2-50)*1.032+50;
Z4:=(2*C+H+L+O)/5;
Z5:=EMA((Z4-LLV(L,34))/(HHV(H,34)-LLV(L,34))*100,13);
P0:=X4-X1+X20+Y5-Y6,COLORYELLOW;
P1:=X4-X1+X20,COLORRED;
P2:=X4-X2+X21;
P3:=X4-X3+X22,COLORWHITE;
P4:=(Z3-Z5)/2+P0,COLORGREEN;
买:crOSS(P4,P0) AND P4<50;