MA_SHORT := MA(CLOSE, 20);

MA_LONG := MA(CLOSE, 50);

BUY_SIGNAL := CROSS(MA_SHORT, MA_LONG);

SELL_SIGNAL := CROSS(MA_LONG, MA_SHORT);

STOP_LOSS := CLOSE < REF(CLOSE, 1) * 0.95;

DRAWTEXT(BUY_SIGNAL AND TIME <=0935, LOW, 'BUY'), COLORRED;

{DRAWTEXT(SELL_SIGNAL, HIGH, 'SELL'), COLORRED;

DRAWTEXT(STOP_LOSS, LOW, 'STOP LOSS'), COLORBLUE;}

STICKLINE(BUY_SIGNAL, LOW, HIGH, 0, 1), COLORYELLOW;

{STICKLINE(SELL_SIGNAL, LOW, HIGH, 0, 1), COLORRED;

STICKLINE(STOP_LOSS, LOW, HIGH, 0, 1), COLORBLUE;};