HJ_1:=EMA((CLOSE*3+HIGH+LOW+OPEN)/6,5);
HJ_2:=HJ_1;
HJ_3:=HHV(HJ_1,13);
HJ_4:=LLV(HJ_1,13);
HJ_5:=MACD.MACD#DAY(12,26,9);
HJ_6:=MACD.MACD#WEEK(12,26,9);
HJ_7:=HJ_3-HJ_4;
HJ_8:=COUNT(HJ_7>REF(HJ_7,1) AND HJ_3>REF(HJ_3,1),5)=1 AND HJ_7>REF(HJ_7,1) AND HJ_3>REF(HJ_3,1) AND HJ_1>=REF(HJ_1,1);
HJ_9:=FILTER(HJ_8=1,10);
HJ_10:=BARSLAST(HJ_9>0);
HJ_11:=IF(HJ_10>0 AND HJ_10<=10,1,0)=1 AND (CLOSE-REF(CLOSE,HJ_10))/REF(CLOSE,HJ_10)*100>=5;
HJ_12:=SUM(FILTER(HJ_11,10),0)/SUM(HJ_9>0,0)*100;
HJ_13:=COUNT(HJ_5>=0 AND HJ_6>=0,5)=1 AND HJ_5>=0 AND HJ_6>=0;
HJ_14:=FILTER(HJ_13=1,10);
HJ_15:=BARSLAST(HJ_14>0);
HJ_16:=IF(HJ_15>0 AND HJ_15<=10,1,0)=1 AND (CLOSE-REF(CLOSE,HJ_15))/REF(CLOSE,HJ_15)*100>=5;
HJ_17:=SUM(FILTER(HJ_16,10),0)/SUM(HJ_14>0,0)*100;
HJ_18:=FILTER(COUNT(HJ_1=HJ_4,3)>=2 AND HJ_1>HJ_4,5);
XG:HJ_18;
{-----------------------------------}