Adolfo

DAX TRADING STRATEGY BREAKOUT/FAKEOUT 1m

Category: Strategies By: Adolfo Created: May 26, 2016, 3:47 PM
May 26, 2016, 3:47 PM
Strategies
38 Comments
DAX TRADING STRATEGY BREAKOUT/FAKEOUT 1m

DAX TRADING STRATEGY BREAKOUT/FAKEOUT 1m Tight Risk – No FAKE profits – 1000€ acc

GB 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!

ES 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!

 

//-------------------------------------------------------------------------
// 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

 

Download
Filename: Binomio-AutoTrading-Bot-DAX-2.itf
Downloads: 835
Download
Filename: Binomio-ATB-Range-Indicator.itf
Downloads: 657
Adolfo
Adolfo Senior
A ProRealTrader. I'm here to learn as much as I can, and improve my skills every single day!
Author’s Profile

Comments

ALZ
ALZ
7 years ago
#

Hi, I tested this strategy and that doesn't work.. strategy is losing.. Does anyone currently use it? Thanks

Scalp
8 years ago
#

Hola Adolfo, tengo una variante de tu estrategia, pero no se programar, me puedes ayudar al respecto? Gracias,Blas

hvluthy@sunrise.ch
9 years ago
#

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 ?

gesbal
10 years ago
#

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 = false
Defparam flatbefore = 085900
Defparam flatafter = 120000

n = 10

IF Time = 085900 THEN
Alto = highest[60](high)
Bajo = lowest[60](low)
compra = 0
venta = 0
ENDIF

if Time > 085959 AND Time <= 120000 THEN

IF compra = 0 THEN
buy n share at Alto stop
ENDIF

IF venta = 0 THEN
sellshort n share at bajo stop
ENDIF

ENDIF

If longonmarket THEN
compra = 1

ENDIF

IF shortonmarket THEN
venta = 1

ENDIF

set stop ploss 10
set target pprofit 10

 

verdi55
10 years ago
#

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 ?

ernesto
10 years ago
#

Hey it doesn't work there are not any buy or sell.

Obiwano
10 years ago
#

Dear Adolfo,

Have you been trading this strategy now in real?  What is the outcome?  Which final code did you use?

Thanks

GraHal
10 years ago
#

  No it keeps telling me I dont have permission to add etc??

I'll try later

 

Nicolas
10 years ago
#

The filename has nothing to deal with the strategy version, don't worry. About picture in comment, it will come later sorry..

GraHal
10 years ago
#

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

 

Hockeytrader
10 years ago
#

Can somebody upload the version without optimization?

Adolfo
10 years ago
#

Hi Hockeytrader, I can sed you any version of this strategy but don't know wich one you really want. 

SebTrades
10 years ago
#

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?

SebTrades
10 years ago
#

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

Adolfo Onrubia
10 years ago
#

Totally agree, let's discuss about it somewhere :)

SebTrades
10 years ago
#

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!

Adolfo Onrubia
10 years ago
#

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.

SebTrades
10 years ago
#

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!

SebTrades
10 years ago
#

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?

Nicolas
10 years ago
#

Seems that it were IG demo server related, please relaunch your strategies to have it worked correctly now.

Adolfo Onrubia
10 years ago
#

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!

Adolfo Onrubia
10 years ago
#

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.

#

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...

Adolfo Onrubia
10 years ago
#

Thank you all for your comments, are always wellcome!

@Pablo
Uno 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...... ;)

manel
10 years ago
#

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. 

Adolfo Onrubia
10 years ago
#

@Nicolas
Don'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"

@David
German 30 cash 1€/point

Still fighting...

 

Anonymous
10 years ago
#

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?

Sofitech
10 years ago
#

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 ?

Adolfo Onrubia
10 years ago
#

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.

Nicolas
10 years ago
#

Maybe freeze level?

ProRealCode ProRealCode
Loading...