-- Capital Synergy Moving Average Crossover with Price; @SETVALUETEXTMODE('Text'); @SETNAME('CSCustom',True); @SHOWYGRIDLINE(True); -- Moving averages; MAFast : MA(C,MAFp),StyleSolid,ColorBlue,Width1; MASlow : MA(C,MASp),StyleSolid,ColorRed,Width1; -- Signal calculations; Buy1 := Cross(C,MAFast); Buy2 := MAFast > MASlow; BuyR := Buy1 & Buy2; Short1 := Cross(MAFast,C); Short2 := MAFast < MASlow; ShortR := Short1 & Short2; LastB := REF(BarsLast(BuyR),1); LastS := REF(BarsLast(ShortR),1); CanB := LastB> LastS; CanS := LastB < LastS; Buy := CanB & BuyR; Short := CanS & ShortR; -- Draw labels; DRAWTEXT(Buy,L-200,'Buy',1),Label2,VCenter,Bottom; DRAWTEXT(Short,H+200,'Short',2),Label1,VCenter,Top;