## Comment on Code your Technical Analysis strategy

commented on 26 Apr 2013, 04:51 PM

Basically 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

For all those who don’t know Heiken-Ashi is a type of candle stick chart with the difference being in the following parameters.

Close = (Open+High+Low+Close)/4
Open = [Open (previous bar) + Close (previous bar)]/2
High = Max (High,Open,Close)
Low = Min (Low,Open, Close)

Your condition is the below to buy/sell, which is based only on the close, so you really don’t need to worry about open, high, low.
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

The below should be self explanatory.

SET HAC = (OPEN+HIGH+LOW+CLOSE)/4
HAC>MAXOF(REF(HAC,1), REF(HAC,2), REF(HAC,3), REF(HAC,4))