Join waitlist
Strategies / Pattern / Color Code Candle Flip

Color Code Candle Flip

The idea builds smoothed candles and buys when a large bullish body follows a bearish one, selling short on the mirror-image flip. Each trade has a 0.0174 percent stop and 0.0348 percent target, and an opposite signal reverses it.

PatternLong & shortSwingGBP/USDDaily
1.56Profit factor
2,934Net profit USD
43.84%Win rate
3,285Trades
-86.60Max drawdown
0.89Avg trade

Best run of 4. GBP/USD, Daily, spread 1.5, from run pf:2026-10-12-GBPUSD-D.tsv:1.

Entry rules, long

  1. Buys 1 contract at market when no long position is open, with a 0.0174 percent stop and 0.0348 percent target

Entry rules, short

  1. Sells 1 contract short at market when no short position is open, with a 0.0174 percent stop and 0.0348 percent target

Exit rules

  1. The 0.0174 percent stop or 0.0348 percent target closes the trade

Test conditions

PeriodUp to 2026-10-12
InstrumentGBP/USD, Daily
Spread1.5 points
Starting capital1,000,000
CostsSpread only. Commissions and overnight financing are not included.
BarsUp to 200,000 bars, fewer where the instrument has less history
Last tested2026-10-13

Every run

Markets and timeframes tested

MarketTimeframePFTradesWin %NetMax DD
GBP/USDBest runDaily1.56 3,28543.842,934 USD-86.60
USD/JPYDaily1.55 3,21343.82236,770 USD-5,760
EUR/USDDaily1.48 3,14442.6817,927 USD-774
Dow Jones4 hours1.22 2,45538.292,183 EUR-207

Charts

Results by run

Above 1.0 made money, below 1.0 lost money.

The code

ProBuilder code, as tested

// ==============================================================
// Color Code Candle Flip
// ProRealAlgos Strategy Library  |  prorealalgos.com
// Type: Pattern
// Direction: Long & short
// Timeframe tested: Daily
// ==============================================================

DEFPARAM CumulateOrders = false

ONCE ccopen = 0

ccclose = (open + high + low + close) / 4
IF BarIndex = 0 THEN
    ccopen = (open + close) / 2
ELSE
    ccopen = (ccopen[1] + ccclose[1]) / 2
ENDIF
cchigh = MAX(high, MAX(ccopen, ccclose))
cclow = MIN(low, MIN(ccopen, ccclose))
thresh = 0.01 * (cchigh - cclow)

18 more lines: the entry and exit rules.

Setup

How to load it

  1. Copy the code with the copy button on the code block.
  2. In ProRealTime, open a chart of the instrument and timeframe you want to test, then open ProOrder > New trading system and choose "Create with programming".
  3. Paste the code, give the system a name and save it.
  4. Click "Backtest", set your own spread and position size, and run it before you consider trading it live.

Indicators used

Heikin Ashi
Read this firstKnown weaknesses2 points
  • Results include the spread only. Commissions and overnight financing are not included.
  • The code is published as it was backtested and has not been compiled again since.

Questions

About this strategy

Can I run Color Code Candle Flip in ProOrder?

Yes. The code is ProBuilder and runs as an automated ProOrder system. Backtest it on your own account with your own spread and position size before trading it live.

Which markets was it tested on?

It was tested on 4 market and timeframe combinations. The best run was GBP/USD, Daily, with a profit factor of 1.56 over 3,285 trades.

How large was the drawdown?

The best run had a maximum drawdown of 87 USD at the tested position size, against a net result of 2,934 USD.

Does it trade long, short or both?

It trades both long and short.

Related

Strategies like this one

Heikin Ashi Color Flip

Uses the same indicator.

1.12 PF · 3,692 trades

Expansion Range Breakout Short

Best run on the same market, GBP/USD.

1.07 PF · 1,981 trades

Stochastic Reversal With Candle Body Trend

Also a pattern strategy.

1.57 PF · 863 trades

Get the full rules, the complete code and the ProRealAlgos portfolio as a member.

The ProRealAlgos community gets the full rules, the complete code and the automated portfolio.

Past backtest results do not guarantee future results. This is not financial advice. Curated and maintained by ProRealAlgos. ProRealTime™ is a trademark of ProRealTime SAS. prorealalgos.comStatsDocs