ROC1 := (CLOSE / REF(CLOSE, 10) - 1) * 100;

ROC2 := (CLOSE / REF(CLOSE, 15) - 1) * 100;

ROC3 := (CLOSE / REF(CLOSE, 20) - 1) * 100;

ROC4 := (CLOSE / REF(CLOSE, 30) - 1) * 100;

KST := MA(ROC1, 10) + MA(ROC2, 10) 2 + MA(ROC3, 10) 3 + MA(ROC4, 10) * 4;

SIGNAL := MA(KST, 9);

DRAWTEXT(CROSS(KST, SIGNAL)AND TIME<=0935, L, 'BUY'), COLORYELLOW;

{DRAWTEXT(CROSS(SIGNAL, KST), H, 'SELL'), COLORGREEN;};