After six candles in a row close in the same direction, the system trades with that run, long after six up candles and short after six down candles. It has not been backtested yet, so no performance numbers exist.
| positionSize Contracts per trade | 1 |
| patternLength Consecutive same-colour candles needed | 6 |
| minBarsBetween Bars since the last order before a new one while in a trade | 6 |
| stopLossPoints Protective stop in points | 20 |
| takeProfitPoints Target in points | 10 |
The code
Every file in the library uses the same header, the same section order and the same variable names. The numbers above were produced by the original version before the rewrite, and the rewrite has not yet been compiled in ProRealTime.
// ============================================================ // Six Candle Run // ProRealAlgos Strategy Library | prorealalgos.com // Type: Pattern // Direction: Long & short // Timeframe tested: Not yet tested // ============================================================ // --- Settings --- DEFPARAM CumulateOrders = false // --- Parameters --- positionSize = 1 // contracts per trade patternLength = 6 // consecutive same-colour candles needed minBarsBetween = 6 // bars since the last order before a new one while in a trade stopLossPoints = 20 // protective stop in points takeProfitPoints = 10 // target in points // --- Indicators --- bearRun = (Summation[patternLength](close < open) = patternLength) bullRun = (Summation[patternLength](close > open) = patternLength)
30 more lines: the entry and exit rules.
Read this first
Questions
The system is written for automated trading with 1 contract, a 20 point stop and a 10 point target. It has not been compile checked or tested.
None yet. The page will show results once a backtest has been run.
At 1 contract the fixed stop is 20 points per trade. There is no drawdown figure yet because it has not been backtested.
That is still open. The fixed point stop and target mean the right chart depends on how far the instrument usually moves in a few bars.
Related
The ProRealAlgos community gets the full rules, the complete code and the automated portfolio.