Can anyone help me. I trying to build a startegy in 1min timeframe. It looks for short signals only. Let’s say when strategy has a short signal on 1m timeframe when close <movingavarage 5. But I also want a red Heikin-Ashi candle on 1 hour timeframe. Someone who can tell if it works
Try this one (not tested):
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
You must launch it from a 1-minute chart (or below, provided 1 hour and 1 minute are multiples of that TF).
Thanks so much. It opened a whole new world to me.