Automated breakout trading strategy on French CAC40

Category: Trading

 

In this article i would like to present you the automated trading strategy that is describe in the French ProOrder / ProBacktest documentation. This strategy is a simple breakout automated system that relies on past market behavior observation, and it works ! I am personally currently trading it with a small account dedicated to it and i must say that it is quiet robust for an intra-day trading strategy.

Entries conditions are simple but smarter than a classic ‘yesterday high/low quotes’ breakout orders.

As European indices are quite “similar” and correlated, this trading strategy may be adapted to any other indices, we’ll have a look by the end of this article.

 

Automated trading strategy “Breakout ProOrder” presentation

A classical Breakout” system first identifies the maximum and minimum values attained by the price over a given time period (in our example, the first 30 minutes of trading after 9am) and then places a buy order on the upper level and a sell order on the lower level.

This breakout automated strategy system takes up maximum two positions per day (sometimes one if any) between 9:30 am and 7:45 p.m.. In all cases, the system is no longer in position after 7:45 p.m., so it is possible to know the gain or potential loss of the day by that time.

This strategy, traded with constant lot made decent profit over the last years :

cac40-breakout-strategy-constant-lot

The version i own reinvest the gain made by the strategy itself in every new trade, as the account grown or decrease in capital. It is my own choice to do it, as this strategy can make high profit in a single day, specially with high volatility like in this past months. Because lost are not so consequent and could be easily re-gain by the strategy, i like to see it working every day with its constant regularity of trade executions that ProOrder offers. I opened a special “mini-account” of about 1000€ specially dedicated to it, as a part of my automated strategies arsenal. So far, the results are promising : (…)

cac40-breakout-2months-result

(…) and conform to ProBacktest. There’s no reason i should stop it for now, it is only 2 months of real trades, but yes we got already 61% profit… Maybe it will not last, but heh ! 61% of free cash security, there’s no doubt this is something we’ll not see everyday, let it play !

The performance with gain re-invest on trade volumes results, as ProBackTest reflects it :

cac40-breakout-strategy-reinvest-gainAs you can see here more clearly than on constant lot strategy, gain re-investment has a major effect on account balance when things go well. As a matter of fact, the cons would be that we may encounter higher losses, but as volume lot calculation use money balance, the loss would be lesser and lesser if the strategy lost many times in a row.

 

The strategy explained

In a breakout strategy, we are always facing the same issue : the false breakout signals. Knowing it, we can assume that there are only 3 different cases of what could happen everyday by trading this strategy (with a buy example) :

breakout-proorder-cases

On first case, we are buying the instrument when a new breakout occur at high level. High and low levels are calculated by looking at the first 2 15minutes bars between 9h00 and 9h30 AM. In this case, things are going well and the trade last all day long until 19:45 (7:45 PM) on which all trades will be close.

On second case we are losing the first buy order, this is a false breakout and we lost the trade by touching the stoploss on the low level. Then we can assume that price is going south and the strategy take a short position which last until 7:45 PM. Gain.

The third case is the worst one. This is something we have to deal with : no clear market intraday trends .. we loose our 2 maximum positions of the day. The smart thing here is that we don’t want to continue trading while we have lost 2 times in a row, on the same day with the same strategy on the same instrument, so we stop trading and wait for the next day for new possible opportunities to trade real good breakout ! By limiting only 2 trades per day, we also know in advance how many money we can afford to loose every day.

To limit the false breakout the strategy introduce a “max amplitude” of the range. If the spread between the high and level is superior of this maximum points range, no trade will be initiated.

 

The code itself

For everyone understanding and code learning purpose, i have translated the code comments from French to English. This automated strategy covers a lot of what we can do with a little trading knowledge with ProOrder. You can also find the .itf file at the end of this article.

// We do not store datas until the system starts.
// If it is the first day that the system is launched and if it is afternoon,
// it will be waiting until the next day for defining sell and buy orders 
DEFPARAM PreLoadBars = 0

// Position is closed at 7h45 PM, frenh time (in case of CAC40 trading)
DEFPARAM FlatAfter = 194500

// No new position will be initiated after the 5h00 PM candlestick
LimitHour = 171500

// Market scan begin with the 15 minute candlestick that closed at 9h15 AM
StartHour = 091500

// The 24th and 31th days of December will not be traded because market close before 7h45 PM
IF (Month = 5 AND Day = 1) OR (Month = 12 AND (Day = 24 OR Day = 25 OR Day = 26 OR Day = 30 OR Day = 31)) THEN
  TradingDay = 0
ELSE
  TradingDay = 1
ENDIF

// Variables that would be adapted to your preferences
if time = 084500 then
  PositionSize = max(2,2+ROUND((strategyprofit-1000)/1000)) //gain re-invest trade volume
//PositionSize = 2 //constant trade volume over the time
endif

MaxAmplitude = 58
MinAmplitude = 11
OrderDistance = 4
PourcentageMin = 30

// Variable initilization once at system start
ONCE StartTradingDay = -1

// Variables that can change in intraday are initiliazed
// at first bar on each new day
IF (Time <= StartHour AND StartTradingDay <> 0) OR IntradayBarIndex = 0 THEN
  BuyTreshold = 0
  SellTreshold = 0
  BuyPosition = 0
  SellPosition = 0
  StartTradingDay = 0
ELSIF Time >= StartHour AND StartTradingDay = 0 AND TradingDay = 1 THEN

// We store the first trading day bar index 
  DayStartIndex = IntradayBarIndex
  StartTradingDay = 1
ELSIF StartTradingDay = 1 AND Time <= LimitHour THEN

// For each trading day, we define each 15 minutes
// the higher and lower price value of the instrument since StartHour
// until the buy and sell tresholds are not defined

IF BuyTreshold = 0 OR SellTreshold = 0 THEN
  HighLevel = Highest[IntradayBarIndex - DayStartIndex + 1](High)
  LowLevel = Lowest [IntradayBarIndex - DayStartIndex + 1](Low)

// Spread calculation between the higher and the 
// lower value of the instrument since StartHour
  DaySpread = HighLevel - LowLevel

// Minimal spread calculation allowed to consider a significant price breakout
// of the higher and lower value 
  MinSpread = DaySpread * PourcentageMin / 100

// Buy and sell tresholds for the actual if conditions are met
  IF DaySpread <= MaxAmplitude THEN
   IF SellTreshold = 0 AND (Close - LowLevel) >= MinSpread THEN
SellTreshold = LowLevel + OrderDistance
   ENDIF
   IF BuyTreshold = 0 AND (HighLevel - Close) >= MinSpread THEN
BuyTreshold = HighLevel - OrderDistance
   ENDIF
  ENDIF
ENDIF

// Creation of the buy and sell orders for the day
// if the conditions are met 
IF SellTreshold > 0 AND BuyTreshold > 0 AND (BuyTreshold - SellTreshold) >= MinAmplitude THEN
  IF BuyPosition = 0 THEN
   IF LongOnMarket THEN
    BuyPosition = 1
   ELSE
    BUY PositionSize CONTRACT AT BuyTreshold STOP
  ENDIF
ENDIF
IF SellPosition = 0 THEN
   IF ShortOnMarket THEN
    SellPosition = 1
   ELSE
  SELLSHORT PositionSize CONTRACT AT SellTreshold STOP
ENDIF
ENDIF
ENDIF
ENDIF

// Conditions definitions to exit market when a buy or sell order is already launched
IF LongOnMarket AND ((Time <= LimitHour AND SellPosition = 1) OR Time > LimitHour) THEN
SELL AT SellTreshold STOP
ELSIF ShortOnMarket AND ((Time <= LimitHour AND BuyPosition = 1) OR Time > LimitHour) THEN
EXITSHORT AT BuyTreshold STOP
ENDIF

// Maximal risk definition of loss per position 
// in case of bad evolution of the instrument price
SET STOP PLOSS MaxAmplitude

 

To conclude

This strategy performs correctly since 2008. It does have common rules of typical breakout strategy, it is not introducing complex calculation with no advanced statistical bias, it deals with no indicators at all. All of these facts are telling me that it could be also effective in the future. I know this one is currently being traded by a lot of people, since it is a part of the ProOrder documentation, so i think it will not be the last time we heard about this one.

 

[edit] : I opened a forum thread to reflect and share my account performance, find it here :

my ProOrder Breakout account performance

 

Logo Logo
Loading...