Comment on Code your Technical Analysis strategy

drmdave commented on 30 Dec 2013, 07:07 PM

I want to code the following logic for Amibroker:

Chart 1 min candle chart intraday
Indicator 21 Simple Moving Average
Profit target 21 points
Stop Loss 9 points
Trailing stop loss Once the position is in profit by 13 points, 9 points trailing stop loss.

Buy

When a candle closes above the 21 SMA, buy when the peak price of this candle is breached by 3 points.
If the successive candles high is less than 3 points, the entry point is when the price breaches the highest of the precedding candles since signal, by 3 points.

Sell

At profit target of 21 points or a trailing stop loss of 9 points once the profit is 13 points
Or exit when the signal is reversed.

Re entry

Once position is closed re-enter if the trend continues and the prices breaches the high of a candle when position was closed by 3 points.

Short

When a candle closes below the 21 SMA, short when the low of this candle is breached by 3 points.
If the successive candles low is less than 3 points, the entry point is when the price breaches the lowest of the precedding candles since signal, by 3 points.

Cover

At profit target of 21 points or a trailing stop loss of 9 points once the profit is 13 points
Or exit when the signal is reversed.

Once position is closed re-enter if the trend continues and the prices breaches the low of a candle when position was closed by 3 points.

View the full comment thread »