Hi everyone,
This strategy is based on Kumo Breakout indicator.
Timeframe : H4
Spread used : 2
Basicaly, once we get a +1 on indicator we buy 1 contract and then we sell it when we reach ou profit target.
On short, we apply the same idea but on a reverse indication of the Kumo indicator.
The main idea is to make some regular profit and to avoid huge drawdown.
// Définition des paramètres du code
DEFPARAM CumulateOrders = False // Cumul des positions désactivé
// Annule tous les ordres en attente et ferme toutes les positions à 0:00, puis empêche toute création d'ordre avant l'heure "FLATBEFORE".
DEFPARAM FLATBEFORE = 090000
// Annule tous les ordres en attente et ferme toutes les positions à l'heure "FLATAFTER"
DEFPARAM FLATAFTER = 173000
// Empêche le système de placer de nouveaux ordres sur les jours de la semaine spécifiés
daysForbiddenEntry = OpenDayOfWeek = 6 OR OpenDayOfWeek = 0
// Conditions pour ouvrir une position acheteuse
indicator1 = CALL "Breakout Kumo"
c1 = (indicator1 = 1)
IF c1 AND not daysForbiddenEntry THEN
BUY 1 CONTRACT AT MARKET
ENDIF
// Conditions pour fermer une position acheteuse
c2 = (close < close[1])
IF c2 THEN
SELL AT MARKET
ENDIF
// Conditions pour ouvrir une position en vente à découvert
indicator2 = CALL "Breakout Kumo"
c3 = (indicator2 = -1)
IF c3 AND not daysForbiddenEntry THEN
SELLSHORT 1 CONTRACT AT MARKET
ENDIF
// Conditions pour fermer une position en vente à découvert
c4 = (close > close[1])
IF c4 THEN
EXITSHORT AT MARKET
ENDIF
// Stops et objectifs
SET STOP pLOSS 35 pTRAILING 5
Thanks a lot for sharing your trading strategy code with us.
I moved your post from library to forum to discuss about it. I think the results might be overestimated because of this line:
SET STOP pLOSS 35 pTRAILING 5
It is not possible to have 2 kind of stoploss in ProOrder (live trading), while it is possible in backtests. Did you test the strategy with tick/tick history?
Hi Nicolas,
I have tested with tick/tick history on ibex35 successfully.
For major indices or forex pairs, results are less interesting… at least using this timeframe&spread.
As the indicator works not so bad, I assume that exiting on the next bar should be promising.
Still to be tried.
Thanks for your advise on Stops.
About trailing stop you can try the code snippets you can find in these 2 blog posts:
https://www.prorealcode.com/blog/trading/complete-trailing-stop-code-function/
https://www.prorealcode.com/blog/learning/trailing-stop-max-favorable-excursion-mfe/
There are many forks of them in a lot of members strategies around here, you should browse the forums and the library too 🙂 Keep up the good work!
Hi everyone, Nicolas,
Please find a draft code of a new version of the Breakout Kumo.
Tested on a tick/tick history and 0.6 spread.
EUR/USD Mini.
Timeframe H4.
PS : I will try to add the trailling stop code at another moment.
// Définition des paramètres du code
DEFPARAM CumulateOrders = False // Cumul des positions désactivé
// Empêche le système de placer des ordres pour entrer sur le marché ou augmenter la taille d'une position avant l'heure spécifiée
timeEnterBefore = time >= 080000
// Empêche le système de placer des ordres pour entrer sur le marché ou augmenter la taille d'une position après l'heure spécifiée
timeEnterAfter = time < 174500
// Empêche le système de placer de nouveaux ordres sur les jours de la semaine spécifiés
daysForbiddenEntry = OpenDayOfWeek = 6 OR OpenDayOfWeek = 0
positionSize = 75
// Conditions pour ouvrir une position acheteuse
indicator1 = CALL "Breakout Kumo"
c1 = (indicator1 = 1)
IF c1 AND timeEnterBefore AND timeEnterAfter AND not daysForbiddenEntry AND Time < 130000 AND c3[1] THEN
BUY positionSize CONTRACT AT MARKET
ENDIF
// Conditions pour fermer une position acheteuse
c2 = (indicator1 = 0)
IF c2 AND Time > 170000 THEN
SELL AT MARKET
ENDIF
// Conditions pour ouvrir une position en vente à découvert
indicator2 = CALL "Breakout Kumo"
c3 = (indicator2 = -1)
IF c3 AND timeEnterBefore AND timeEnterAfter AND not daysForbiddenEntry AND Time < 130000 AND c2[1] THEN
SELLSHORT positionSize CONTRACT AT MARKET
ENDIF
// Conditions pour fermer une position en vente à découvert
c4 = (indicator2 = 0)
IF c4 AND Time > 170000 THEN
EXITSHORT AT MARKET
ENDIF
SET TARGET PPROFIT 65
SET STOP PLOSS 20
Bravo ça s’améliore 🙂
Mais il doit y avoir une coquille quelque part, tu n’as aucun ordre d’achat dans le backtest alors que ton code en prévoit bien !