After brainstorm pseudocode, most challenging step to convert discretionary trading into program is pattern recognition.
How? Data-sampling?
AUTOCHANNEL
if price > MA then R = MA + f * ATR; S = MA
else if price < MA then S = MA - f * ATR; R = MA
else S = MA - 0.5f * ATR; R = MA + 0.5f * ATR
MACDS/MMAS
minoruptrend = gradient(fastmacd) > 0 AND fastmacd > 0
majoruptrend = gradient(slowmacd) > 0 AND slowmacd > 0
tradableuptrend = minoruptrend AND majoruptrend
divergence = sustained(current > previous(fastma - slowma))
convergence = sustained(current < previous(fastma - slowma))
BOLLINGER BANDS
rangeexpansion = sustained(current > previous (height))
rangecontraction = sustained(current < previous (height))
ENTRIES & EXITS
buy = tradableuptrend AND divergence AND rangeexpansion
sell = fastmacd < 0 AND broken autochannel support
Updated Mar:
Its interesting to note that in R&D, most ideas that come up during brainstorm wont make it to end-product. What initially seem as great ideas may turn out to underperform seemingly simple ideas that appear along the way.
The simple idea that appeared in this project is "trend-following". It simply appeared through evolution of rigorous backtesting to select survival of the fittest. Another discovery is the robustness of "negation trailing stop" and the synergy it has with "price impulse".