e20 = EMA(C,20); e5 = EMA(C,5);
Plot(e20,"E20",colorGreen);
Plot(e5, "e05",colorBrightGreen,styleDashed);
LONGFilter = C > e20 AND e5 > e20;
SELLFilter = C < e20;
SHORTFilter = C < e20 AND e5 < e20;
COVERFilter = C > e20;
Buy = LONGFilter AND (H >= ORBH) AND (BarsSinceNewDay > EntryBarStart) AND (BarsSinceNewDay <= EntryBarEnd) AND ((BarsSinceNewDay < BarsSinceLastEntrySignal) OR BothEntrySignalsNull );
Sell = SELLFilter AND (L <= ORBHSL) OR (H >= ORBHTarget) OR (TimeNum() > SquareOffTime-1) AND (BarsSinceNewDay > BarsSinceLastBuySignal);
Short = SHORTFilter AND (L <= ORBL) AND (BarsSinceNewDay > EntryBarStart) AND (BarsSinceNewDay <= EntryBarEnd) AND ((BarsSinceNewDay < BarsSinceLastEntrySignal) OR BothEntrySignalsNull );
Cover = COVERFilter AND (H >= ORBLSL) OR (L <= ORBLTarget) OR (TimeNum() > SquareOffTime-1) AND (BarsSinceNewDay > BarsSinceLastShortSignal);