S&P500 automatic trading strategy ROBOT EEUU 500 1H

Viewing 15 posts - 1 through 15 (of 31 total)
  • Author
    Posts
  • #23811 quote
    Raul Vg
    Participant
    Senior

    Hello again!
    I share this robot that I have been testing for several months and it completely matches the backtest with reality.

    It is very simple, simply fulfilling 4 conditions of several indicators.

    Maybe this too prepared and suffers from being over optimized, I have practically a year following it in demo and is equal to the backtest.

    I share so that you can probe with 200,000 new bars and new ideas and improve it for the good of all.

    Look at the backtest that even if you put a number of bars 0, it is not, they are when you touch the take profit.

    To see what it seems.

    Nicolas, manel, Eric and 11 others thanked this post
    eeuu-500.png eeuu-500.png EEUU-500-1-HORA.itf MiIndicador3.itf
    #23819 quote
    Nicolas
    Keymaster
    Master

    Thank you very much Raul. I’m in. About testing overfitting, I have access to a new tool in my beta VIP version. I’ll give news about it when I can talk about it.

    I think you should add this strategy into the library too to drain more people, that’s why you get many feedback in the other thread. I could make it for you, but I need a short description of the strategy at least.

    Joachim Nilsson and Simply thanked this post
    #23825 quote
    Raul Vg
    Participant
    Senior

    Hi Nicolas, I already added it

    #23832 quote
    Joachim Nilsson
    Participant
    Average

    Thanks Raul. Will take a look at it tonight 🙂 Fun fact – Hora means prostitute in swedish, gonna look a bit strange in the autotrading column 😀

    Cheers!

    Bandido and Gubben thanked this post
    #23834 quote
    Nicolas
    Keymaster
    Master

    Oh sorry Raul 🙂
    I’ll review it hopefully this weekend. Have a nice evening.

    Bandido thanked this post
    #23852 quote
    manel
    Participant
    Veteran

    Thanks for this Raul. I attach the 200,000 units results. It seems fairly consistent with the exception of 2010 and 2011 which were bad years. The drawdown is too big at 42% for 5k of capital so you would need at least twice this amount to run with this strategy. I have run it in tick by tick mode but I do notice something strange about the zero bar trades P&L and entry trades timelog in general. I took an example of the 10/02/16 – 18/02/16 opening and closing trades :

    The Orders list suggest they were opened on the 10th (5 trades total) and they were closed on the 17th and 18th (5 trades total). This can be confirmed by the chart as well. However, on the closed positions list the last exit trade on the 18th 5am shows as zero bar indicating that it was opened and closed in the same hour (but it wasn;t as the entry trade was made on the 10th)….. The same incorrect entry trade time errors are also present on the other non zero bar closing trades (which were opened in the 10th not the 17th as stated in the closing list). Strange, needs some more looking into….. but thanks again for sharing. Looks promising so far.

    SP500-test-results.jpg SP500-test-results.jpg SP500-test-stats.jpg SP500-test-stats.jpg SP500-test-orders.jpg SP500-test-orders.jpg SP500-closed.jpg SP500-closed.jpg
    #23858 quote
    manel
    Participant
    Veteran

    Charts attached.

    PS – Sorry I could not find this post in the library section at the time.

    SP500-test-chart-2.jpg SP500-test-chart-2.jpg SP500-test-chart.jpg SP500-test-chart.jpg
    #23887 quote
    Joachim Nilsson
    Participant
    Average

    Hey.

    Since your conditions are met so many time during the same position it sometimes takes heaps of contracts av you can see in my added picture.

    I´ve made it more conservative för my own test period with the code change: DEFPARAM CumulateOrders = false. But still 5 contracts.

    I think that it´s better to have a MM-system than a script that cumulate orders. See added picture.

    Skärmavbild-2017-02-04-kl.-10.18.15.png Skärmavbild-2017-02-04-kl.-10.18.15.png Skärmavbild-2017-02-04-kl.-10.19.07.png Skärmavbild-2017-02-04-kl.-10.19.07.png
    #23902 quote
    Raul Vg
    Participant
    Senior

    Hello! If I already have it tested, without accumulating orders, in ig, the minimum position for s & p500 is 5 contracts, ideally I would accumulate orders but from there, instead of 5 in 5, I get only 1 each time Meets the condition, thus maintaining the percentage and ratio

    #23903 quote
    Raul Vg
    Participant
    Senior

    I’m also modifying it to work with the dow, I’ll share it shortly

    #23917 quote
    Joachim Nilsson
    Participant
    Average

    Ok I didn´t realise that the minimum position size was 5 contract. I still think that it would be better with a mm system instead of accumulation. I mean 120 contract at once. That’s a big position!

     

    Edit: Looking forward to see your dow code

    #23926 quote
    arcane
    Participant
    Senior

    Good work but be careful a strategy to purchase over a bullish period.

    Same problem with Pathfinder.

    However the years up are ended

    #23927 quote
    Raul Vg
    Participant
    Senior

    Thus introduces the first operation of the minimum of 5 contracts and from there it is getting one by one.

    // Definición de los parámetros del código
    DEFPARAM CumulateOrders = true // Acumulación de posiciones desactivada
    
    sl=100
    
    n=5
    
    
    
    if countofposition > 1 then
    n=1
    endif
    
    if countofposition < 50 then
    
    // Condiciones para entrada de posiciones largas
    indicator1 = ExponentialAverage[24](MACDline[21,44,24](close))
    indicator2 = MACDline[21,44,24](close)
    c1 = (indicator1 <= indicator2)
    
    indicator3 = Stochastic[28,8](close)
    indicator4 = Average[22](Stochastic[28,8](close))
    c2 = (indicator3 >= indicator4)
    
    
    indicator8 = close + 5
    ignored, ignored, indicator9 = CALL "MiIndicador(3)"(close)
    c6 = (indicator8 <= indicator9)
    
    indicator11 = close
    indicator21 = ExponentialAverage[43](close)
    c11 = (indicator11 >= indicator21)
    
    IF c1 AND c2 AND c6 and c11 THEN
    BUY n CONTRACT AT MARKET
    ENDIF
    endif
    // Condiciones de salida de posiciones largas
    ignored, indicator10, ignored = CALL "MiIndicador(3)"(close)
    c7 = (close CROSSES under indicator10)
    
    IF c7 THEN
    SELL  AT MARKET
    ENDIF
    SET STOP pLOSS sl
    SET TARGET pPROFIT 60
    #23966 quote
    Nicolas
    Keymaster
    Master

    The code is now available in the library: https://www.prorealcode.com/prorealtime-trading-strategies/sp500-automated-trading-strategy-eeuu-500-mini-1e-1hora/

    I would suggest to make optimisation with In Sample and Out Of Sample period to validate a bit what the optimiser has found to be the best periods for your indicators. Otherwise, you’ll be kind of overfit, but you already know that 🙂

    #24020 quote
    CN
    Participant
    Senior

    Hey guys,


    @raul
    thanks for a great system as allways. The fear I have is that this is a long only system and that we at this time in the market are at an ATH of being overbought… A decline should me iminent, that’s why I fear such a system.

    Anyone that shares my fears or am I being a big baby?

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

S&P500 automatic trading strategy ROBOT EEUU 500 1H


ProOrder: Automated Strategies & Backtesting

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

This topic contains 30 replies,
has 11 voices, and was last updated by robertogozzi
6 years ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 02/03/2017
Status: Active
Attachments: 11 files
Logo Logo
Loading...