TIMEFRAME(1 hour,updateonclose)
// Heikin-Ashii candle setup
if barindex > 0 then
xClose = (open+close+low+high)/4
xOpen = (xOpen[1]+xClose[1])/2
//haHigh = Max(xOpen, xClose)
//haLow = Min(xOpen, xClose)
//xHigh = Max(High,haHigh)
//xLow = Min(Low,haLow)
else
xClose = (open+close+low+high)/4
xOpen = (Open[1]+Close[1])/2
//haHigh = Max(xOpen, xClose)
//haLow = Min(xOpen, xClose)
//xHigh = Max(High,haHigh)
//xLow = Min(Low,haLow)
endif
Cond1 = xOpen > xClose //BEARish HA candlestick
TIMEFRAME(1 minute,updateonclose)
Cond2 = close < average[5,0](close) //current price < SMA5
TIMEFRAME(default)
IF Cond1 AND Cond2 AND Not OnMarket THEN
SELLSHORT 1 CONTRACT AT MARKET
ENDIF
SET TARGET pPROFIT 50
SET STOP pLOSS 20