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 :
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 : (…)
(…) 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 :
As 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) :
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.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 |
// 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
You still using this strategy Nic?
Yes! I am still using this strategy, as explained on forum here : http://www.prorealcode.com/topic/proorder-breakout-on-french-cac40-my-account-performances/
When i got time, i will adapt this one for other instrument, as i think it has potential : price action/breakout, let the profit roll and cut the loss shortly. It had already made proof that profit is consistent, and in many market situations, no one can predict the future so i have made kind of Monte Carlo analysis to convince myself of its kind behavior, you’ll find them in the forum topic (link above).
HELLO NICOLAS,
TIME FRAME?
Hello ALEALE, this automated trading strategy is made to work on the 15 minutes timeframe.
Hi Nicolas,
Thanks for sharing! I am however having great trouble with this strategy, I’ve tried it on all index’s so far with not a single trade being executed in the back tests, on any time frame.
I’ve used the .itf you kindly supplied with no modifications. Is this .itf you posted correct…or am I missing something?
Thanks!
Hello Dave, this strategy is also available in the Library / automatic trading strategies section, here : http://www.prorealcode.com/prorealtime-trading-strategies/breakout-proorder-french-cac40/#comment-100
In the comments there, Stef spotted something that may caused the strategy not to trade : “not generating orders – is caused by how you choose to display your data WRT time zones (Platform options -> Time zones & Trading hours).”
Tell me if you can fix this issue by changing time options in your trading platform.
Hi Nicolas: Thank you for an excellent example of the variety and use of tools available in ProOrder. A couple of questions arising in the code above:1. In the formula for position size with reinvestment, why subtract initial investment of 1000 from strategyprofit- isn’t strategyprofit already just the profit? 2. OrderDistance is subtracted from the HighLevel to define the entry level for a buy stop- that is at a level below HighLevel, asking price to retrace below HighLevel?…and added to LowLevel to define the sellshort stop level? Is this you intention? When I back test in a buy situation with no or little retracement from HighLevel (for example 11 April 2016), the program places an order some distance above HighLevel anyway!
Cheers Kit
Hello Kit,
1. You are right ‘strategyprofit’ is already the profit made by the strategy. But here we want to wait until the strategy has already made at least 1000€ of profit to start lot increasing, that’s why 1000 is subtracted to the whole profit.
2. Yes it is intentional. What we try here is to catch the big moves that could be involved by breaking the LowLevel and the HighLevel that the system has identified. To get better chance of trades executions, we add or subtract the OrderDistance to the Low and High level respectively.
Nicolas
I tried everything.must I change something for this stategy to work on south Africa cash40?
Maybe start time and position size? Have you tried on 15 minutes timeframe already? This is the timeframe where it should run.
Hi Nicolas, thank you so much for this excellent Strategy
The times in the code are UST / France and I had to minus 1 hour to get the TS to work well on UK Time. So @Etta you will need to convert UST to your local time and then it should work??
GraHal
Hi Nicolas, thank you so much for this excellent Strategy
The times in the code are UST / France and I had to minus 1 hour to get the TS to work well on UK Time. So @Etta you will need to convert UST to your local time and then it should work??
This site may be useful
http://www.timeanddate.com/worldclock/converter.html
GraHal
I have a few questions on this TS, but I’ll try and keep it simple …
What is ‘Order Distance’ please?
Thanks
GraHal
When I manual trade a BreakOut, I would wait until price exceeded a highest high over n periods and then buy.
Nicolas says …
Yes it is intentional. What we try here is to catch the big moves that could be involved by breaking the LowLevel and the HighLevel that the system has identified. To get better chance of trades executions, we subtract the OrderDistance from High level respectively.
If the TS subtracts some value (Order Distance) from the High Level then surely we are not buying at a BreakOut from the high level??
Or is it that we already have executed an Order some value (Order Distance) above the high and the subtraction from the High is to give us our ‘StopLoss’ at the same level below the HIgh as the executed Order was above the High??
Haven#t kept it sinple after all have I? ha
I keep ‘getting lost’ trying to work out exactly which line of code does what in this TS?
Thanks
GraHal
Yes you are right, we do not take the trade at highest or lowest of the range, but minus OrderDistance or plus OrderDistance. The reason is simple: a lot of people will try to catch the breakout and the price could explode at the identified levels.. So because we only check condition one time per bar, we get a better chance of jump in into the breakout before this explosion happen. The OrderDistance variable trigger an anticipation of what may happen..
Ah gotcha! thanks Nicolas!
So I know highlevel and lowlevel are determined from the 2 bars ending 09:15 and 09:30 and I can see StartHour = 091500 but which bit of code fixes the 2 bars to end at 09:30?
I want to change the ‘2 bar setting’ to see if it makes for better equity curve on other markets.
Cheers
GraHal
Lines 56 and 57
Aha I thought it must be, maybe I am getting better reading code after all! ha
I confirmed it to myself by optimising the +1 at the end of line 56 to give me a new ‘higher high’ since a previous one several days earlier. I slept on it and then asked the question here for confirmation.
Okay I know it’s ‘curve fitting’, but trial and error is a good way to learn provided you don’t lose money in the process! I run my optimised TS on DEMO for a considerable period before I would put any code on here.
Muchas Gracias
Etta, did you manage to get the SA40 to work?
Nicolas, do you know if this code was ever adapted for the SA 40 cash index?
Sorry I haven’t seen any version for this indice. What is the spread of this one?
Usually 20-25 pips
That’s huge and that’s why I asked you. I believe that it would be almost impossible to achieve good results in intraday with that kind of spread sorry..
Thanks Nicolas
salve, ho provato la strategia in proBacktest ma non da i risulti indicati ….
france 40 (eur 2 mini)
il codice è uguale a quello indicato ho caricato direttamente il link su PRT…
provata anche in test per un mese ma fa poche operazioni molte in perdita e poche in guadagno … posso vedere un rapporto della strategia in reale per capire dove sbaglio ….
grazie….
La strategia non esegue così bene per i mesi passati. Ma erano anche gli stessi anni alcuni fa. Continuo a credere questo è una buona strategia nel nostro arsenale di trading. Alcune varianti di questa strategia sono stati sviluppati da altri membri, è possibile trovare in libreria, è sufficiente cercare ‘breakout’.
Salut Nicolas,
Plusieurs questions -:)
Dans le guide de programmation “ProBacktest et Proorder” il est dit que le programme a été backtesté sur un mini-contrat CFD France 40. Or, je n’ai qu’une version de démo pour l’instant et je n’ai donc pas accès à ces contrats dans ma liste d’instrument ( du moins c’est mon impression…). Selon vous, puis-je prendre un future quelconque à la place ? Et si oui lequel car leur dénomination est obscure pour moi ( CAC Full116 ( Globex/No globex ), Only / No Only , 1216 ?….).
Savez-vous s’il faut cocher la case “Taille des lots” dans le fenêtre de droite ( car il est noté “Forex only” ) ?
ProOrder déclenche-t-il les ordres d’achat ( resp. de vente ) au cours+(spread paramétré /2) comme je le subodore afin d’être éxécuté ?
Pourquoi prend-on une taille de position=2 ? La spéc dit certes que c’est le nombre maximal de positions prises au cours d’une journée mais elle ne dit pas que c’est la taille du nombre de contrats à traiter à chaque trade ( il devrait être de 1 , non ?)
Voilà pour ces questions de novice ( avec mes excuses si celles-ci amènent des réponses évidentes car je viens de découvrir ProOrder hier ).
Cordialement.
1/ la documentation parle de contrats CFD, donc avec un compte de trading pour les CFDs : https://cfd-trading.prorealtime.com/
2/ Non, pas utile
3/ le terme spread dont il est question désigne le “spread” soit l’écart entre les bornes haute et basse, non la différence Ask/Bid.
4/ 2 était la taille de contrat minimum à l’époque pour le contrat CFD mini du CAC40
Hi Nicolas, on the 27/10/2016 it did three trades. Do you know why? did it happened also to you?
Thanks
Salut Nicolas ! concernant cette stratégie,je reviens sur la discussion que nous avons eu sur un autre topic concernant l’ajout d’un trailer stop : en effet la cloture automatique à 19h45 ,n’es t elle pas insuffisante dans le cas où dans le case1 ou case 2 ,le marché vient à se retourner (par exemple évènement sur les marchés US à part) et annule tous les gains à partir de 16 h par exemple ?
Je suppose qu’il faudrait remplacer la ligne
SET STOP PLOSS MaxAmplitude par SET STOP TRAILING positionprice*x ?
C’est une idée que tu peux tester en effet. Les backtests de cette stratégie ont validé l’hypothèse qu’il fallait laisser courir les gains plutôt que de les couper prématurément et c’est sans doute ce qui se passera beaucoup plus souvent avec un trailing stop que si nous laissions les éventuels retournements de marché US grignoter les gains potentiels. AMHA 🙂
Bonjour Nicolas,
A partir de votre ProOrder serait il possible de faire un indicateur qui donnerait un signal de prise de position ?
Je préfère garder la main que de tout faire en automatique.
Cordialement
Oui ce serait possible en effet de transformer cette stratégie en un indicateur de signaux de trading. Merci de faire une demande spécifique à ce sujet sur le forum ProBuilder, j’y répondrai dés que possible 🙂
Merci Nicolas pour votre réponse.
Sujet crée : https://www.prorealcode.com/topic/indicateur-a-partir-de-la-strategie-du-proorder-breakout-cac40/
Merci pour votre aide,
Cordialement
Bojour Nicolas,
je teste cette stratégie sur l’indice car je n’ai pas d’accés aux CFD ou Futures. J’ai changé juste l’heure de sortie (17h30) et l’heure de dernière négociation (15h45).
mais , pour la période 3/07/2018-27/07/2018 j’ai juste 3 trades longs le 3 juillet et 6 trades tous court le 19 juillet!!!!!
Je précise que je le fais à partir de 2 Probacktest différents qui donnent les mêmes résultats;
– 1 qui est une importation du fichier ITF de ce site;
– le second que j’ai créé en copiant le programme à partir de la doc de PRT.
Ce qui m’intéroge c’est le passage à buyposition =1 (ligne 68)alors que cette ligne est antérieure à l’entrée en position ligne 70. Mais je ne suis pas un as en programmation et j’ai du mal à comprendre l’enchainement des lignes avec les IF THEN ELSE ENDIF mais je me soigne (J’étudie). JJe constate que Pascal 3431 a eu le même problème. J’essaie de trouver la solution, je suis un laborieux.
Merci et bon weekend.
Edmond
“Buyposition” est tout simplement une variable qu’on renseigne avec la valeur 1 pour savoir si on a été LONG au marché. Je vous suggère de regarder les vidéos de formation à la programmation si vous voulez comprendre un peu mieux le code et pourquoi pas l’améliorer ! 🙂
https://www.prorealcode.com/programming-with-prorealtime/
Hi old timers 😉 Out of curiosity, do you still use this strategy?