DAX TRADING STRATEGY BREAKOUT/FAKEOUT 1m Tight Risk – No FAKE profits – 1000€ acc
ENGLISH VERSION
IG MARKETS – Version 10.2 ProRealTime
I will start trading this strategy in real as soon as possible and command an invitation for those who have time / desire to review and find any possible failure and / or optimize it, either with the BBexit or any other way you can think of, I I have not been able to do better for the moment.
SUMMARY
The most important thing for me this strategy is risk-reduced operation in fact is all that matters, in my humble opinion- in trading, the benefits will come sooner or later alone, if only survives account !
All part of a simple following what I could go watching over time in the evolution of some markets, such as the DAX in this case idea. It is to accompany the market in the direction to take, not “guess” what the market will do but rather “REACT” to what you might be doing.
DESCRIPTION
The system reset variables to 0 each new day, thereafter waiting until 07: 55-07: 59 a.m. (GMT + 2) to set the maximum and night minimum.
At 08:00 a.m. (GMT + 2) sends orders or limited stop above and below the maximum / minimum leaving a gap between them 10% of the total distance of the range. For example: The range has been between 9900 and 9850, the difference is 50 ticks (10%=5 Ticks), the 4 orders shall be located at: 9905 (buy), 9895 (sell) and 9855 (buy), 9845 (sell), and will be “STOP “or” LIMIT “depending on whether the price closes inside or outside the set range. Contrary orders do stop function when changing direction. The system has a maximum of 4 opportunities daily, can operate only once in each position, so avoiding entering loser loop when the price behaves sideways. Parameters are fixed also with benefits according to night range, my main idea was range * 1.5 to when it comes within range, and range * 1 for when it comes out of range. This is the only variable that have optimized the system and modified range * range * 1.5 to 1.2, although the difference is almost irrelevant.
CAPITAL MANAGEMENT
Of course, carries a calculation module position size so that decides the number of contracts to operate in each operation based on the capital available at all times, thereby maintaining the same risk, but significantly increase profits.
SPREAD
Backtest had a 1.0 points spread set up on it. Also because between 08:00 a.m. to 09:00 a.m., spread is 2.0 points for IG Markets, variable spread is 1.0 at this time in order to add +1.0 (2.0 points) between this hour, and since 09:00 a.m. spread variable is set to 0.
INDICATOR
Deputy have available the indicator chart pivot points and the range area, I recommend you use it to make it more intuitive and easy to understand operational.
I hope you can help me with this and give you so much joy as intended.
A big hug and good trading!
VERSION EN CASTELLANO
IG MARKETS – PROREALTIME 10.2 Versión
Voy a empezar a operar ésta estrategia en real lo antes posible y mando una invitación para quien tenga tiempo/ganas de revisarla y encontrar algún posible fallo y/o optimizarla, ya sea con el BBexit o de cualquier otra forma que se te ocurra, yo no he sido capaz de hacerlo mejor por el momento.
RESUMEN
Lo más importante para mí de ésta estrategia es el riesgo reducido por operación, de hecho es lo único que importa –en mi humilde opinión- en el trading, perder lo menos posible, los beneficios llegarán solos tarde o temprano, ¡si sobrevive la cuenta!
Todo parte de una idea simple a raíz de lo que he podido ir observando a lo largo del tiempo en la evolución de algunos mercados, como el DAX en éste caso. Se trata de acompañar al mercado en la dirección que tome, no de “ADIVINAR” lo que va a hacer el mercado sino más bien de “REACCIONAR” a lo que pueda estar haciendo.
DESCRIPCIÓN
El sistema resetea variables a 0 cada nuevo día, a partir de ahí espera hasta las 07:55-07:59 a.m. (GMT+2) para establecer el máximo y mínimo nocturnos.
A las 08:00 a.m. (GMT+2) envía órdenes stop o limitadas por encima y por debajo del máximo/mínimo dejando una distancia entre ellas del 10% de la distancia total del rango. Por ejemplo: El rango ha estado entre 9900 y 9850, la diferencia son 50 ticks, las 4 órdenes se situarán a: 9905(compra), 9895(venta) y 9855(compra), 9845(venta), y serán de “STOP” o “LIMIT” dependiendo de si el precio cierra dentro o fuera del rango establecido. Las órdenes contrarias hacen la función de stop al cambiar la dirección. El sistema tiene un máximo de 4 oportunidades diarias, únicamente puede operar una vez en cada posición, de manera que evita entrar en bucle perdedor cuando el precio se comporta de manera lateral. Los parámetros de beneficios van fijados también acorde al rango nocturno, mi idea principal fue rango*1.5 para cuando entra dentro del rango, y de rango*1 para cuando entra fuera del rango. Ésta es la única variable que he optimizado en el sistema y modificado de rango*1.5 a rango*1.2, aunque la diferencia es prácticamente irrelevante.
GESTIÓN DE CAPITAL
Cómo no, lleva un módulo de cálculo de tamaño de posición de manera que decide el número de contratos a operar en cada operación en base al capital disponible en cada momento, permitiendo así mantener el mismo riesgo, pero aumentar considerablemente los beneficios.
SPREAD
El backtest tiene establecido 1.0 de spread fijo, no obstante, como entre las 08:00 a.m. y las 09:00 a.m., el spread real de IG es de 2.0, he añadido la variable spread al código de la siguiente manera. Entre las 8 y las 9 el spread es 1.0, de manera que lo añada al spread y sean los 2 puntos reales, mientras que a partir de las 9 la variable spread es igual 0 y permanece el 1 punto que tiene prefijado.
INDICADOR
Adjunto tienes disponible el indicador que grafica los puntos de pivote y la zona de rango, recomiendo que lo uses para que sea más intuitivo y fácil de entender la operativa.
Espero que me puedas ayudar con esto y que te dé tantas alegrías como pretende.
¡Un fuerte abrazo y buen trading!
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 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 |
//------------------------------------------------------------------------- // Main code : Binomio AutoTrading Bot v.2 DAX //------------------------------------------------------------------------- REM ######################################### REM ## Binomio AutoTrading Bot 2016 DAX 1m ## REM ######################################### REM Not cumulate orders defparam cumulateorders = false REM No positions open before this time defparam flatbefore = 080000 REM All positions will be closed after this time defparam flatafter = 213000 REM MAX and MIN we want to operate REM No orders will be set if range is greater than maxrange = 150 REM No orders will be set if range is shorter than minrange = 20 REM ######### profittrendvalue = 1.5 profitrangevalue = profittrendvalue //5 //1.7 rangepercent = 0.1 REM ###################### REM ## MONEY MANAGEMENT ## REM ###################### Capital = 3000 Risk = 0.5 REM RESET MAIN VARIABLES EACH NEW DAY if Dayofweek = 5 then trading = 0 else If intradaybarindex = 0 then trading = 1 bullish = 0 bearish = 0 inrange = 0 rangepips = 0 enter1 = 0 enter2 = 0 enter3 = 0 enter4 = 0 abovemax = 0 abovemin = 0 belowmax = 0 belowmin = 0 //profittrend = 0 profitrange = 0 endif endif REM CHECK CONTROL TIME starttime = 075500 endtime = 075900 REM RANGE ESTABLISHMENT IF time >= starttime and time <= endtime then REM NIGHT MAX maximo = dhigh(0) REM NIGHT MIN minimo = dlow(0) REM RANGE IN PIPS BETWEEN NIGHT MAX AND MIN rangepips = round(maximo-minimo) REM PROFIT IN PIPS EX profitrange = rangepips*profitrangevalue// i.e we could add here "*0.9" to reduce the profit objective //profittrend = rangepips*profittrendvalue //1.5 REM DISTANCE FROM LINES TO SET ORDERS margin = rangepips*rangepercent REM SET MAX ORDER PLACES abovemax = maximo+margin belowmax = maximo-margin REM SET MIN ORDER PLACES abovemin = minimo+margin belowmin = minimo-margin REM SET NUMBER OF PIPS TO RISK EACH TRADE StopLoss = round(margin*2) if StopLoss<6 then StopLoss = 6 endif endif REM Calculate contracts equity = Capital + StrategyProfit maxrisk = round(equity*(Risk/100)) PositionSize = abs(round((maxrisk/StopLoss)/PointValue)*pipsize) REM SPREAD CHECK IF Time>=090000 and time<173000 then spread = 0 // Backtest spread is set to 1 else spread = 1 // Backtest spread 1 + 1 = Real spread endif REM CONDICION DEL MERCADO inrange = Close<maximo-margin and close>minimo+margin bullish = Close>(maximo+margin) bearish = Close<(minimo-margin) semibull = Close>maximo-margin and close<maximo+margin semibear = close<minimo+margin and close>minimo-margin REM START SETTING ORDERS REM FIRST TRADES if not onmarket and trading = 1 and rangepips<=maxrange and rangepips>=minrange then REM RESET VARIABLES EACH TIME WE ARE OUT OF THE MARKET if bearish then if enter4=0 then sellshort PositionSize contract at market//belowmin limit endif if enter1=0 then buy PositionSize contract at abovemin+spread stop endif endif if bullish then if enter3=0 then buy PositionSize contract at market//abovemax limit endif if enter2=0 then sellshort PositionSize contract at belowmax-spread stop endif endif if inrange then if enter1=0 then buy PositionSize contract at abovemin limit endif if enter2=0 then sellshort PositionSize contract at belowmax limit endif if enter3=0 then buy PositionSize contract at abovemax+spread stop endif if enter4=0 then sellshort PositionSize contract at belowmin-spread stop endif endif if semibull then if enter3=0 then buy PositionSize contract at abovemax+spread stop endif if enter2=0 then sellshort PositionSize contract at belowmax-spread stop endif endif if semibear then if enter1=0 then buy PositionSize contract at abovemin+spread stop endif if enter4=0 then sellshort PositionSize contract at belowmin-spread stop endif endif endif buytrend = tradeprice(1)>maximo buyrange = tradeprice(1)<maximo selltrend = tradeprice(1)<minimo sellrange = tradeprice(1)>minimo REM SI ESTAMOS LARGOS if longonmarket then REM IF TRADE PRICE IS ABOVE MAX if buytrend then enter3 = 1 if enter2=0 then sellshort PositionSize contract at belowmax-spread stop endif endif REM IF TRADE PRICE IS INTO DE RANGE if buyrange then enter1 = 1 if enter4=0 then sellshort PositionSize contract at belowmin-spread stop endif endif endif REM SI ESTAMOS CORTOS if shortonmarket then REM SI HEMOS VENDIDO POR DEBAJO DEL MINIMO if selltrend then enter4 = 1 if enter1=0 then buy PositionSize contract at abovemin+spread stop endif endif REM SI HEMOS VENDIDO DENTRO DEL RANGO if sellrange then enter2 = 1 if enter3=0 then buy PositionSize contract at abovemax+spread stop endif endif endif set stop ploss stoploss set target pprofit profitrange |
Share this
No information on this site is investment advice or a solicitation to buy or sell any financial instrument. Past performance is not indicative of future results. Trading may expose you to risk of loss greater than your deposits and is only suitable for experienced investors who have sufficient financial means to bear such risk.
ProRealTime ITF files and other attachments :PRC is also on YouTube, subscribe to our channel for exclusive content and tutorials
Gran trabajo, Adolfo!
I would like to have enough time to code and create my own codes, too. (Poco a poco, todo llegará 😉 )
Thanks a lot for share!
You’re wellcome Andres!
I recommend to start it with 3000€ account and 0,5% risk per trade rather than the actual 1%. But for a 1000€ account we need a bot more risk in order to even join the market with at least 1 contract..
Best trading!
Thank you very much for all your time and work to help everyone here Adolfo. Since I’m not Spanish fluent, it’s a pleasure to have you on board for to the Spanish language forums 🙂
I see there are a lot of things in your code that you borrowed from different topics in the forums and blogs. That’s amazing. It’s definitely what was my desire when I launched this website there is only 3 months now. I hope a lot of people will get through all the learning steps too to make also nice addition to the library. Sharing what we learned with others is like the tree of life, if we keep for ourselves what we have learned, people would never feed their knowledge and the cycle would stop. I learned a lot with internet through years and it’s now my/your turn to continue this cycle 🙂 Anyway, after this brief philosophical statement, your strategy is interesting but I wonder if the pending orders would have been executed at the same price in real time datas, and that’s something we need to test.
Thanks a lot Nicolas!
I hope so too! We will know soon since is already to start tomorrow!
Best wishes!
Very nice code using all kind of ideas from the forum. Great job.Just 2 question : – I see that a part of the code is indicating the spread value before 17h30 and after. Does it mean we do not have to indicate the spread in the backtest system of prt again ?– You talk about “no fake profits”… you talk about the issue with PRT and target profit indication… the fact that if it is in the same bar, the backtest results will be false ? (or is there another way to generate false profits in PRT maybe..)
Hi Sofitech!
First answer, yes. I should say.. my fault. Is only for backtest to match real conditions as much as posible, for real trading we should remove or just set to 0.
Second answer, exactly. I did a lot of stratregies with fixed profits, and after see trade by trade, more often were FAKE as all of us know. This issue mades me crazy and I hope no other ways to generate false profits!
Thanks a lot for that, really apreciate that.
Hi Adolfo – Great work here, some good ideas and codes to learn from as well. Thanks very much for posting your strategy to share, much appreciated.
Had a bit of trouble at first replicating your results but then realised I’m in a different time zone. For those who are in the UK, just change all the times in the code back by 1hr and the code should work fine.
Hi, some question…
on which TF did you run it? 1 minute?
if you use IG how did you backtested it? with IG on 1 min timeframe I have only 9 days of history
why do you put spread 0 after 9.00? It should be 1.
When you say to put it live do you mean with real money or with demo account of IG?
any forward or montecarlo test done?
For the moment only these question but more and more will arrive. 🙂
Thanks
David
Hi David,
1.- Yes I’m using IG and did it changing to units and selecting 200.000 units (can’t set any more).
2.- Thanks for this question specially, only can set 1 kind of spread in main window, since we are starting system between diferent spread times, I added 1 point extra spread between 08:00-09:00 because real IG markets spread at this time is 2.0, so if don’t set spread variable (+1) at this time we will not get the same price in real market, with this extra point we will try to get the same price, in this case 1 point worst.
3.- I mean real market conditions, and real money, because of this, I need your experience to see if something could go wrong for some reason or another that I could miss.
4.- looking for help at this point also.
I really apreciate your questions, thanks a lot!
P.D. A few updates incoming since this morning real test didn’t set up stop orders in time, will be back soon with those improvements.
Maybe freeze level?
Adolpho. I have a problem to import files in PRT.. could you post the code of the indicator here so i can copy and paste it ?
Thanks Adolfo… I will check it after that you fix the problem in real market conditions. I do not understand why my IG account has only 9 days history (13.000 bars) on 1 min TF. what CFD do you choose exactly?
@NicolasDon’t know why but stop and limit orders after buy/sell didn’t start, only starts when set stop ploss or pprofit… still trying to figure out.
@Sofitech
IF time >= 075500 and time<=075900 then
maximo = dhigh(0)
minimo = dlow(0)
endif
return maximo coloured (255,0,0) as \"Máximo\", minimo coloured (0,255,0) as \"Mínimo\"
@DavidGerman 30 cash 1€/point
Still fighting…
Hi David – I have a IG spreadbet account that I initially tested it on so it had 3mths of 1m history (definitely not enough for proper testing but ok for now on low risk). If the full history doesn’t show up automatically I usually go into the units box and specify a really big number (like 100,000) so that the chart returns the full available history. Strange you are not getting the history though, haven’t set up a CFD account so can’t test it for you yet.
Also, for IG spreadbet I had to amend the code slightly to take into account that the minimum stake is 2 units and not 1 – (I managed this after many tries, not quite experienced with coding atm :-)) – think it works, if someone with more knowledge can perhaps check ?
PositionSize = max(2,abs(round((maxrisk/StopLoss)/PointValue)*pipsize))
Adolfo – I had the same issues in live testing this morning – triggered two trades 1 long (-10.3pts loss) and 1 short (+17.3pts) so an overall profit of 7points on the day. Also noticed the problem you mentioned, can’t quite work out the issue with the closeout and stops either, am trying to decipher it myself.
Hi Adolfo, very good program. According to my experience performing programs is not good to open and close stoploss in the same candle, because I think it does not guarantee or correctly calculates the backtest, in your program as I see happens once (5% of operations). a couple of months ago I happened something similar with the same index, asked for help and they recommended the same thing I’m telling you. Anyway I see that it is very good program, very well developed and I’m studying. the management of the number of lots to invest not just understand it …. I realize otherwise. thank you very much and I will keep close friend …
Hola Adolfo, muy buen programa. Segun mi experiencia realizando programas no es bueno que abra y cierre de stoploss en la misma vela, por que creo que no asegura ni calcula correctamente el backtest,en tu programa segun veo sucede alguna vez (un 5% de las operaciones). hace un par de meses me ocurrio algo parecido con el mismo indice, pedi ayuda y me recomendaron lo mismo que te estoy contando . De todas maneras veo que es muy buen programa, muy bien desarrollado y estoy estudiandolo. lo de la gestion del numero de lotes a invertir no acabo de entenderlo…. yo lo realizo de otra manera. muchas gracias y te sigo de cerca amigo…
Thank you all for your comments, are always wellcome!
@PabloUno de los aspectos que más he intentado preocuparme ha sido de que no diera ningún “profit” en la misma vela, pero como bien indicas, hay varias veces que saltan los stop de pérdidas en la misma vela y seguramente eso distorsione los resultados. Con respecto al número de lotes, lo calcula a partir del número de pips a arriesgar en la siguiente operación. De manera que si tiene que dar más distancia al stoploss reduce el número de contratos y viceversa, igualando siempre el porcentaje del capital que estamos dispuestos a perder en cada operación.
Gracias de nuevo!
……….terminando la actualización…… 😉
UPDATED – New version here.
http://www.prorealcode.com/topic/updated-strategy/
Enjoy it! Thanks everyone for your comments, likes and the most important, your time.
For everyone following here, just finished a monte carlo test on this strategy, is posted here. maybe you can help to understand what that’s mean.
Thanks in advance!
Hi Adolfo, I am experiencing also the problem of Stop/Limit orders being ignored after buy/sell orders. I wrote to PRT support, but got no answer yet. Did you figure out what the problem is?
Seems that it were IG demo server related, please relaunch your strategies to have it worked correctly now.
Hi SebTrades, I don’t know what the problem is, but I “fixed” it changind stop and limit orders to “set stop ploss” and “set target pprofit” instead, after start it in real time seems to be working ok now.
I have been using “set stop ploss” and “set target profit” for long; they work… with some peculiarities. But even without going into details and unless I missed something, you cannot use ‘Set stop pLoss’ for trailing winning positions as the parameter for pLoss must be positive… and that is what I am interested into!
I have been using “set stop ploss” and “set target profit” for long; they work… with some peculiarities. But even without going into details and unless I missed something, you cannot use ‘Set stop pLoss’ for trailing winning positions as the parameter for pLoss must be positive… and that is what I am interested into!
I think something was changed in the ProOrder code and that is probably a bug. I shall open a separate topic on this problem to see if more people are concerned… and what PRT support says about it
Totally agree, let’s discuss about it somewhere 🙂
It is now back to normal. I relaunched my strategies as Nicolas advised and it works…. I would definitely expect to receive from PRT support some assurance that the problem was identified and fixed; otherwise what tells us that it is not going to happen again… on the real trading?
Can somebody upload the version without optimization?
Hi Hockeytrader, I can sed you any version of this strategy but don’t know wich one you really want.
Odd thing … the bot fielname at the top of this thread has -3 at the end but when I click the filename at the top of the box (see below) then the filename shows as -2 at the end.
Any comments?
GraHal
PS Mmm I cant add a pic of the box, I’ll try on the next post
No it keeps telling me I dont have permission to add etc??
I’ll try later
The filename has nothing to deal with the strategy version, don’t worry. About picture in comment, it will come later sorry..
Dear Adolfo,
Have you been trading this strategy now in real? What is the outcome? Which final code did you use?
Thanks
Hey it doesn’t work there are not any buy or sell.
Result now : a loss of 1080 Euros in the past 8 months. Were there some parameters over-optimized or just the market period bad for this system ?
que tal
yo uso un sistema casi idéntico pero quizas mas simple en su composición . solo tengo una duda de programacion que igual podias , ademas de ayudarme , pues probarla en tu sistema pues hice un test manual y me salieron muy buenos resultados
la idea es que solo haga la operación en una dirección . es decir si abres alcista que anule la orden de ruptura de stop y viceversa
pero intento introducir la orden en mi sistema y me da error .
lo unico que necesitaria es eso , en resumen solo una operacion al dia. gracias
codigo
Defparam cumulateorders = falseDefparam flatbefore = 085900Defparam flatafter = 120000
n = 10
IF Time = 085900 THENAlto = highest[60](high)Bajo = lowest[60](low)compra = 0venta = 0ENDIF
if Time > 085959 AND Time <= 120000 THEN
IF compra = 0 THENbuy n share at Alto stopENDIF
IF venta = 0 THENsellshort n share at bajo stopENDIF
ENDIF
If longonmarket THENcompra = 1
ENDIF
IF shortonmarket THENventa = 1
ENDIF
set stop ploss 10set target pprofit 10
I’m very interested to try out your strategy, but as a bloody newbie I need some help regarding the set-up which must be changed every day. Would you accept helping me ?
Hola Adolfo, tengo una variante de tu estrategia, pero no se programar, me puedes ayudar al respecto? Gracias,Blas
Hi,
I tested this strategy and that doesn’t work.. strategy is losing..
Does anyone currently use it?
Thanks