These codes are “plug and play”, I think Raul will certainly know how to incorporate it in his strategy 🙂
Hello guys, to see, first, jonjon, you can pass the backtest images of the code as it appears here with the mini 1 euro? I have changed the way of entering the market, from buying or selling direct to placing orders. And second, for my broker the minimum trailing stop is 5 and for the stop it is 4. now as soon as I can look to implement the trailing that Nicolas says in this code. What do you think? Does this strategy have a future?
Good evening Nicolas,
You are right but we can not use your code.
We are on candles of 5 mn.
The stop does not update quickly enough.
The stop does not update quickly enough.
Pray for the multitimeframe to come! Soon I hope 🙂
If the strategy don’t use indicator at all, it could be modified to work on any inferior timeframe.
- Sorry Jonjon, I did not read you. Can you try this code?
// Definición de los parámetros del código
DEFPARAM CumulateOrders = false // Acumulación de posiciones desactivada
DEFPARAM FlatAfter =172900
once ordersize=1
HoraEntradaLimite = 090600
HoraInicio = 090500
if Ordersize>50 then
Ordersize=10
endif
if Time >= HoraInicio and time <= HoraEntradaLimite then
// Condiciones de entrada de posiciones cortas
c1 = open < close-2
if not onmarket then
IF c1 THEN
IF PositionPerf(1) < 0 THEN
OrderSize = OrderSize-1
if ordersize<1 then
ordersize=1
ENDIF
ELSIF PositionPerf(1) > 0 THEN
OrderSize =OrderSize+2
if ordersize<1 then
ordersize=1
ENDIF
endif
buy ordersize shares AT close+1 stop
endif
c2= open > close-1
IF c2 THEN
iF PositionPerf(1) < 0 THEN
OrderSize = OrderSize-1
if ordersize<1 then
ordersize=1
ENDIF
ELSIF PositionPerf(1) > 0 THEN
OrderSize =OrderSize+2
if ordersize<1 then
ordersize=1
endif
ENDIF
sellshort ordersize shares AT close-2 stop
endif
endif
endif
SET STOP ptrailing 5
At ig on the dax the minimum trailing stop is 10 points.
The result is less good in this case.
>> For clarity of messages on ProRealCode’s forums, please use the “insert code PRT” button to separate the text of the code part! Thank you! <<
I’m sorry, I’m writing from the phone. I have in ig and the minimum trailing is 5
Sorry I have tried on the actual account.
on behalf of demonstration, the minimum is 10 prt cfd “” in France.
CNParticipant
Senior
Intressting, its 5 in sweden
// Definición de los parámetros del código
DEFPARAM CumulateOrders = false // Acumulación de posiciones desactivada
DEFPARAM FlatAfter =172900
once ordersize=1
HoraEntradaLimite = 090600
HoraInicio = 090500
if Ordersize>50 then
Ordersize=10
endif
if Time >= HoraInicio and time <= HoraEntradaLimite then
// Condiciones de entrada de posiciones cortas
c1 = open < close-2
if not onmarket then
IF c1 THEN
IF PositionPerf(1) < 0 THEN
OrderSize = OrderSize-1
if ordersize<1 then
ordersize=1
ENDIF
ELSIF PositionPerf(1) > 0 THEN
OrderSize =OrderSize+2
if ordersize<1 then
ordersize=1
ENDIF
endif
buy ordersize shares AT close+2 stop
endif
c2= open > close-1
IF c2 THEN
iF PositionPerf(1) < 0 THEN
OrderSize = OrderSize-1
if ordersize<1 then
ordersize=1
ENDIF
ELSIF PositionPerf(1) > 0 THEN
OrderSize =OrderSize+2
if ordersize<1 then
ordersize=1
endif
ENDIF
sellshort ordersize shares AT close-1 stop
endif
endif
endif
SET STOP ptrailing 5
Hi,
I modify the strategy in order to increase the lot in relation to the margin. Good result !!
/ Definición de los parámetros del código
DEFPARAM CumulateOrders = false // Acumulación de posiciones desactivada
// La posición se cierra a las 17:29 p.m. si no toca ni stop ni take.
DEFPARAM FlatAfter =173000
Margin = 60
Lottfree = 0
PositionSize = max(1,1+ROUND((strategyprofit-lottfree)/Margin))
if positionsize >=18 then
Positionsize=18
endif
//once ordersize=1
// No se abren nuevas posiciones después de la vela que se cierra a las 09:06
HoraEntradaLimite = 090600
// El análisis de mercado empieza en la vela de 5 minutos que cierra a las 09:05
HoraInicio = 090500
// Órdenes máximas
//if Ordersize>18 then
//Ordersize=18
//endif
// Riesgo, multiplicador de contratos.
//n=2
// Condiciones para el analisis.
if Time >= HoraInicio and time <= HoraEntradaLimite then
// Condiciones de entrada de posiciones largas.
c1 = open < close-1
IF c1 THEN
// Si la primera barra del día de 5 min es positiva, compramos.
buy positionsize shares at close+2 stop
endif
// Condiciones de entrada de posiciones cortas.
c2= open > close-1
IF c2 THEN
// Si la primera barra del día de 5 min es negativa, vendemos.
sellshort positionsize shares at close-1 stop
endif
endif
//SET STOP ploss 5
//SET TARGET pPROFIT 10
SET STOP PTRAILING 5
AlcoParticipant
Senior
Hi Guys,
I’ve tried this system on the dow. It shows a good result aswell. Maybe someone could check it with 200000 bars.
Morning. Tried exactly your code (with London times) with starting equity of EUR20k. Unfortunately blows out account by April 2013.