// Indicators
COI = WEIGHTEDAVERAGE[10](ROC[14] +ROC[11])
MAC = MACDline[12,26,9](close)
STO = Stochastic[14,3](close)
ST = Supertrend[3,10]
atr = averagetruerange[10]
// Conditions to enter long positions
c1 = COI > COI[1] AND COI < 0
c2 = MAC > MAC[1] AND MAC < 0
c3 = STO > 20 AND STO < 40
IF c1 AND c2 AND c3 THEN
DRAWARROWUP(barindex,low-atr/2)coloured(0,200,0)
lastorder=1
ENDIF
// Conditions to exit long positions
c5 = close crosses over ST
IF c5 and lastorder>0 THEN
DRAWTEXT("exit BUY order",barindex,high+atr/2)
ENDIF
// Conditions to enter short positions
c11 = COI < COI[1] AND COI > 0
c12 = MAC < MAC[1] AND MAC > 0
c13 = STO < 80 AND STO > 60
IF c11 AND c12 AND c13 THEN
DRAWARROWDOWN(barindex,high+atr/2)coloured(200,0,0)
lastorder=-1
ENDIF
// Conditions to exit short positions
c15 = close crosses under ST
IF c15 and lastorder<0 THEN
DRAWTEXT("exit SELLSHORT order",barindex,low-atr/2)
ENDIF
RETURN