intraday DAX strategy 5min mini1€ spread 1

Viewing 15 posts - 61 through 75 (of 503 total)
  • Author
    Posts
  • #21865 quote
    Nicolas
    Keymaster
    Master

    Took the last code from this post: https://www.prorealcode.com/topic/5-min-mini1e-dax-spread-1/page/3/#post-21815

    Modified the code to be lightweight with only useful code, don’t know if it’s the last version, but this kind of coding should be used in your future development, to gain  some time while backtesting:

    // Definición de los parámetros del código
    DEFPARAM CumulateOrders = false // Acumulación de posiciones desactivada
    
    DEFPARAM FlatAfter = 173000
    
    once ordersize=1
    
    HoraEntradaLimite = 090600
    
    HoraInicio = 090500
    
    Margin = 60
    Lottfree = 0
    orderSize = max(1,1+ROUND((strategyprofit-lottfree)/Margin))
    ordersize=min(18,ordersize)
    n=1
    
    if Time >= HoraInicio and time <= HoraEntradaLimite then
    
    if not onmarket then
    
    c1 = open < close-2*pointsize
    c2= open > close-1*pointsize
    
    IF PositionPerf(1) < 0 THEN
    OrderSize = OrderSize/2
    ELSIF PositionPerf(1)> 0 THEN
    OrderSize =OrderSize+2
    endif
    ordersize=max(ordersize,1)
    
    IF c1 THEN
    buy ordersize*n contract AT close+2 stop
    endif
    
    IF c2 THEN
    sellshort ordersize*n contract AT close-1 stop
    endif
    
    endif
    endif
    
    SET STOP ptrailing 5
    jonjon, CN, Raul Vg and stephane thanked this post
    #21875 quote
    Alco
    Participant
    Senior

    @jonjon

    Dow has a minimum 9 pip SL.

    jonjon and CN thanked this post
    #21877 quote
    Alco
    Participant
    Senior

    @jonjon

    Oh wait, sorry I got it wrong. It has a minimum 9 pip SL before opening. After opening it has a minimum of 6 pip SL.

    jonjon thanked this post
    #21878 quote
    jonjon
    Participant
    Average

    @Alco. That sounds better. I’ll try getting the data. I actually trade the Dow anyway (I’m currently trading through X_Trader and chart through eSignal). The equivalent contract on PRT to what I trade is the Mini DJ30 Full0317 Future. Hopefully this is similar to the prices you get.

    I’ll let you know how it goes.

    #21881 quote
    BC
    Participant
    Master

    Hi Nicolas

    Is it possible Live trade with “ptrailing” function with V10.2?

    Thanks

    #21882 quote
    Nicolas
    Keymaster
    Master

    @Bin

    Yes of course, the reason why people are complaining about it, is about the lack of reliability into backtest in version pre 10.2 and the “0 bar” phenomena.

    #21900 quote
    4everTrading
    Participant
    Senior

    Hello guys,

     

    First of all, Grandisimo trabajo Raul,

    Next…

    This is only an idea, I tried the strategy in 15 minutes timeframe, only changing some data (attach shot3). I have compared the both timeframe in the last year (small backtest) and the results were sightly diferent.

    I changed the code to start both system with only one contract  for really small accounts (sadly my case)

    As you can see, the drawdown is very similar but gains not

    So, what’s your opinion

    HappyTrading

    // Definición de los parámetros del código
    DEFPARAM CumulateOrders = false // Acumulación de posiciones desactivada
    
    DEFPARAM FlatAfter =173000
    
    once ordersize=1
    
    HoraEntradaLimite = 091600
    
    HoraInicio = 091500
    
    Margin = 60
    Lottfree = 0
    orderSize = max(1,1+ROUND((strategyprofit-lottfree)/Margin))
    if Ordersize>18 then
    Ordersize=180
    endif
    n=1
    
    if Time >= HoraInicio and time <= HoraEntradaLimite then
    
    
    c1 = open < close-2
    if not onmarket then
    IF c1 THEN
    IF PositionPerf(1) < 0 THEN
    OrderSize = OrderSize/2//+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*n contract AT close+2 stop
    endif
    
    c2= open > close-1
    
    IF c2 THEN
    iF PositionPerf(1) < 0 THEN
    OrderSize = OrderSize/2//+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*n contract AT close-1 stop
    endif
    endif
    endif
    
    
    
    
    SET STOP ptrailing 5
    
    shot1.png shot1.png shot2.png shot2.png shot3.png shot3.png
    #21909 quote
    Raul Vg
    Participant
    Senior

    Jonjon, Could you pass the backtest from the day of June 2014 that gives you the error until today? Counting that you have it in the dax of 25 € per point, it would have to divide everything between 25.

    #21910 quote
    Raul Vg
    Participant
    Senior

    Hi Carlos, thank you very much, I see in your backtest a benefits curve that is not very attractive and an excessive max drawdown, for example, for the last robot that I have shared the max drawdown is half and profits more than double

    #21911 quote
    Raul Vg
    Participant
    Senior

    The gain / loss ratio is practically half

    #21912 quote
    4everTrading
    Participant
    Senior

    Thanks for the comment, what capital do you think is the best to start in live account. I would like to get code to start with 2000€ of capital and trying to asuming a real risk

    Saludos de Madrid.

    #21918 quote
    jonjon
    Participant
    Average

    Raul – here you go. Your previous code exactly as it was with a trailing stop of 5. Problem seems to be with the data around end June & July 2014. The backtest here is from 1 Aug 2014 until 30 Dec 2016.

     

    Have a good weekend guys. Catch you Monday

    DAX-5min-scalp-RV2.png DAX-5min-scalp-RV2.png
    #21921 quote
    Nicolas
    Keymaster
    Master

    @carlos

    With the same strategy you are waiting 3 times longer (3 bars of 5 minutes in a 15 minutes timeframe) to place and move stoploss with the trailing stop. As you may already know it, nothing happens between 2 bars in probacktest.

    #21922 quote
    Raul Vg
    Participant
    Senior

    Hi jonjon, Many thanks for your time and for helping me, there is one thing that bothers me, and is that in my backtest of a year and a half earns 33,000euros, and in yours 2 and a half years with a very good profit curve earns 600,000 / 25 = 24,000 euros. I do not understand how it can be so

    #21929 quote
    volpiemanuele
    Participant
    Veteran

    Hi,

    at this time, for me,  the best code is this. I have modified the code posted from nicolas in relation to position size leaving only my position size and optimizing the best position trade in max 38 lots. Thanks

    // 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
    once ordersize=1
    
    HoraEntradaLimite = 090600
    
    HoraInicio = 090500
    
    
    Margin = 60
    Lottfree = 0
    orderSize = max(1,1+ROUND((strategyprofit-lottfree)/Margin))
    ordersize=min(38,ordersize)
    n=1
    
    
    
    if Time >= HoraInicio and time <= HoraEntradaLimite then
    
    if not onmarket then
    
    c1 = open < close-2*pointsize
    c2= open > close-1*pointsize
    
    
    IF c1 THEN
    buy ordersize*n contract AT close+2 stop
    endif
    
    IF c2 THEN
    sellshort ordersize*n contract AT close-1 stop
    endif
    
    endif
    endif
    
    SET STOP ptrailing 5
    

    Thanks

Viewing 15 posts - 61 through 75 (of 503 total)
  • You must be logged in to reply to this topic.

intraday DAX strategy 5min mini1€ spread 1


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
Raul Vg @raul_v Participant
Summary

This topic contains 502 replies,
has 34 voices, and was last updated by Asteriks
5 years, 8 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 01/19/2017
Status: Active
Attachments: 189 files
Logo Logo
Loading...