I would need a code for simple strategy as below, can you kindly
provide the same.
i want to use heikin-ashi charts, so my close, open, low and
high are specified below
HA-Close = (Open(0) + High(0) + Low(0) + Close(0)) / 4
HA-Open = (HA-Open(-1) + HA-Close(-1)) / 2
HA-High = Maximum of the High(0), HA-Open(0) or HA-Close(0)
HA-Low = Minimum of the Low(0), HA-Open(0) or HA-Close(0)
Buy —> If the close goes above highest close of last 4 candles then buy.
Sell —> If the close goes below lowest close of last 4 candles then sell.
SET HC = (OPEN+HIGH+LOW+CLOSE)/4
SET HO = (REF(OPEN,1) + REF(CLOSE,1))/2
SET HH = MAXOF(HIGH, MAXOF(HC, HO))
SET HW = MINOF(LOW, HO, HC)
HC>MAXOF(REF(HH,1),REF(HH,2),REF(HH,3), REF(HH,4)) Sell:SET HC = (OPEN+HIGH+LOW+CLOSE)/4
SET HO = (REF(OPEN,1) + REF(CLOSE,1))/2
SET HH = MAXOF(HIGH, MAXOF(HC, HO))
SET HW = MINOF(LOW, HO, HC)
HC<MAXOF(REF(HH,1),REF(HH,2),REF(HH,3), REF(HH,4))
Hi,
I tried to use this script as a scanner, but, it gives “Your script generated an error”. Am I using this correctly? Can you please advise?
Thanks
Sachin