Strategy 3 CANDLES with CAC40

Strategy 3 CANDLES with CAC40

I would like to share a simple meanreverting system that is based on the analysis of the last 3 candles.

A long range of the last 3 candles of at least 10 pips is considered, and for the short side a move of at least 25 pips.

Preferred indices France 40, Ftse 100 and Dax.

Timeframe 1 minute.Target 75 pips, Stop 70 pips and breakeven update every 30 pips.

Suggestions would be welcome.

Share this

Risk disclosure:

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 : How to import ITF files into ProRealTime platform?

PRC is also on YouTube, subscribe to our channel for exclusive content and tutorials

  1. Matteo MC • 11/29/2022 #

    Hello Stanko.
    I hace tested your system ad i’have noticed that it works very well only quen the market is going up.
    So I have added a condition to enter the market :
    i1=triangularaverage[9000](close)
    if i1[0]>i1[1] then
    TRE=1
    ELSE
    TRE=0
    ENDIF
    The system enters long or short only when TRE=1. Whit this filter the equity line on 200k candels becames very better!
    try and Let me know if you are agree with me.

    • Stanko • 11/29/2022 #

      Ciao Matteo MC. Grazie per il tuo consiglio. Ho provato la strategia con tuo filtro ed il miglioramento è stato netto. Le operazioni si dimezzano ed aumentano i profitti. Attualmente sembra ottimo solo per il CAC40.

    • ivan66 • 11/29/2022 #

      Ciao Matteo, scusami , la modifica che hai suggerito, dove e come va inserita nel programma sopra? Ti ringrazio ciao

  2. rominet44 • 11/29/2022 #

    Hello ! stratégie simple testée et donne de bons résultats, bravo. J’ai essayé une petite optimisation qui améliore légèrement le profit jusqu’à 70k unités en backtest, mais apporte des résultats nettement meilleurs sur une plus longue période (140k et plus ) :
    // essais CAC M1 à partir de Strategy3-CANDLES-with-CAC40
    // mis en service le 30/11/22 à 19h30

    DEFPARAM CumulateOrders = False
    timeEnterBefore = time >= 070000
    timeEnterAfter = time <= 230000

    // *** tendance courte *****************
    M8=average[11](close) // 11
    Tm8h=M8>M8[1]
    Tm8b=M8<M8[1]

    UNO = (open[2] – close) > 9*pipsize // 9
    IF timeEnterAfter AND timeEnterBefore AND (open[2]>close[1]) AND (close[1]>close) AND UNO AND Tm8h THEN
    BUY 1 CONTRACT AT MARKET
    ENDIF

    DUE = (close – open[2]) > 21*pipsize // 21
    IF timeEnterAfter AND timeEnterBefore AND (open[2]<close[1]) AND (close[1]<close) AND DUE AND Tm8b THEN
    SELLSHORT 1 CONTRACT AT MARKET

    Malheureusement je ne sais pas comment ajouter le scan du backtest ???
    La strategie est actuellement en test réel.
    Cordialement
    JPF
    ENDIF

    SET TARGET pPROFIT 72// 72
    SET STOP pLOSS 69 // 69

    //startBreakeven = 5 //30 pips in gain to activate the breakeven function
    //PointsToKeep = 10 //5 pips to keep in profit above/below entry price when the breakeven is activated
    //
    // test if the price have moved favourably of “startBreakeven” points already
    //
    // — LONG side

    SCA = 33
    IF LONGONMARKET AND (close – tradeprice(1)) >= (SCA* pipsize) THEN // 33
    breakevenLevel = tradeprice(1) + (SCA* pipsize) //calculate the breakevenLevel
    //place the new stop orders on market at breakevenLevel

    IF breakevenLevel > 0 THEN
    SELL AT breakevenLevel STOP
    ENDIF
    ENDIF
    //graphonprice breakevenLevel coloured(239,21,21)
    // — SHORT side
    IF SHORTONMARKET AND (tradeprice(1) – close) >= (SCA* pipsize) THEN
    breakevenLevel = tradeprice(1) + (SCA* pipsize) //calculate the breakevenLevel
    //place the new stop orders on market at breakevenLevel
    IF breakevenLevel > 0 THEN
    EXITSHORT AT breakevenLevel STOP
    ENDIF
    ENDIF

    • Stanko • 11/29/2022 #

      Ciao Rominet44.
      Grazie per il tuo consiglio.
      La tua ottimizzazione è molto interessante perchè riduce notevolmente le operazioni ed aumenta i profitti.
      Ho notato anche un filtro con la media a 11 periodi.
      Attualmente performa bene per CAC40, DAX ed EUR/USD.

    • Chrisinobi • 11/29/2022 #

      Hallo Rominet 44
      Dein Code gefällt mir ganz gut, zum probieren und testen, kannst du bitte ihn als ITF-Datei hochladen oder so das man ihn gut kopieren kann. Danke

    • KumoNoJuzza • 11/29/2022 #

      Bonjour,
      @rominet44 pourrais tu expliquer à quoi sert le filtre:
      M8=average[11](close) // 11
      Tm8h=M8>M8[1]
      Tm8b=M8<M8[1]
      Il est efficace mais je pense avoir des lacunes sur le trading car je n'arrive pas comprendre le pourquoi du comment. Merci.

    • Nicolas • 11/29/2022 #

      la moyenne mobile 11 période actuelle est ascendante ou descendante, on teste sa valeur vis à vis de sa valeur précédénte.

  3. Stanko • 11/29/2022 #

    In questi ultimi giorni di pesanti vendite nell’azionario il sistema accusa più perdite consecutive perchè, come aveva capito MatteoMC, la maggior parte degli ingressi sono Long. Trovo difficile trovare filtri per limitare i loss consecutivi: rimane opportuno rimanere fuori dal mercato.

  4. shionuk • 11/29/2022 #

    Sorry I am new here. Seen some really good results on forex with 30 mins. I have commented the code as I understand it in an editor. What is SCA? I am not in this domain so if it is obvious please excuse.

    • Stanko • 11/29/2022 #

      Ciao shinouk,
      lo SCA è una variabile che fa salire lo stop loss a breakeven, cioè la posizione non potrà chiudere in perdita. In questo caso lo stop loss parte da -70 e se la posizione supera il +30 il programma fa salire lo stop a +30. Spesso la posizione si chiude subito, ma il target del profitto rimane a +75 e può essere comunque raggiunto.

  5. wally • 11/29/2022 #

    Hola a todos y gracias a Stanco por la maquina principal y a los compañer@s que aportáis modificaciones.
    Para los mas novatos, serian tan amables de poner el archivo ITF, ya que no consigo insertar las modificaciones.
    Gracias por compartir sus conocimientos.

    • Stanko • 11/29/2022 #

      Ciao wally. Grazie per l’interesse mostrato: non riesco a capire che formato sia ITF. Il mio sistema si può copiare ed incollare senza problemi su ProRealTime. La modifica di MatteoMC la puoi aggiungere manualmente. Per le modifiche di rominet44 puoi provare a copiare il sistema qui sopra ed una volata incollato in ProRealTime potresti cancellare i commenti preceduti dalle due barre “//” perchè potrebbero creare confusione.

  6. jim • 11/29/2022 #

    wow

  7. wally • 11/29/2022 #

    Voy a experimentar.
    Gracias Stanko.

  8. BenJuice • 11/29/2022 #

    Merci Stanko pour ton système:) Il marche très bien.
    J’ai vu que Matteo MC avait trouvé un filtre pour optimiser ton système.
    Je n’arrive pas à intégrer sa condition. Pourrais tu m’aider.
    D’avance merci

    • Stanko • 11/29/2022 #

      Ciao Benjiuce, scusa per il ritardo della risposta.
      Prova a copiare ed incollare questo codice:

      DEFPARAM PreLoadBars = 100000
      DEFPARAM CumulateOrders = False
      timeEnterBefore = time >= 083000
      timeEnterAfter = time COND[1] THEN
      TRE = 1
      ELSE
      TRE = 0
      ENDIF

      UNO = (open[2] – close) > 10*pipsize

      IF timeEnterAfter AND timeEnterBefore AND (open[2]>close[1]) AND (close[1]>close) AND UNO AND TRE = 1 THEN
      BUY 1 CONTRACT AT MARKET
      ENDIF

      DUE = (close – open[2]) > 25*pipsize

      IF timeEnterAfter AND timeEnterBefore AND (open[2]<close[1]) AND (close[1]= (SCA* pipsize) THEN
      breakevenLevel = tradeprice(1) + (SCA* pipsize) //calculate the breakevenLevel
      //place the new stop orders on market at breakevenLevel
      IF breakevenLevel > 0 THEN
      SELL AT breakevenLevel STOP
      ENDIF
      ENDIF
      // — SHORT side
      IF SHORTONMARKET AND (tradeprice(1) – close) >= (SCA* pipsize) THEN
      breakevenLevel = tradeprice(1) + (SCA* pipsize) //calculate the breakevenLevel
      //place the new stop orders on market at breakevenLevel
      IF breakevenLevel > 0 THEN
      EXITSHORT AT breakevenLevel STOP
      ENDIF
      ENDIF

  9. calliope • 11/29/2022 #

    Bonjour et merci beaucoup STANKO pour ce code; La première ligne de ce code ressort en anomalie. Quelqu’un peut il m’aider ?
    Merci à tous pour ces beaux partages

  10. Stanko • 11/29/2022 #

    Ciao calliope.
    Per prima riga intendi “DEFPARAM PreLoadBars = 10000” ? Se sì, questa istruzione dovrebbe velocizzare i calcoli per far funzionare la strategia.
    Comunque se lanci una ricerca con “PreLoadBars” puoi trovare tante risposte ai tuoi dubbi.

  11. Patrice210 • 131 days ago #

    bonjour STANKO, effectivement la première ligne apparait en anomalie et je ne comprend pas votre réponse.
    pouvez vous m’éclairer sil vous plait . en tout cas merci pour le code d’origine

  12. KumoNoJuzza • 40 days ago #

    Hi guys,

    Thanks @Stanko and everyone for your contributions.
    I have been playing around with the strategy and I would like to propose a variation.
    – Filter is based on Hull Average, I have not tried with Alma yet.
    – The biggest change, I believe is that it does not use any stop loss, and thus to mitigate that big risk, I have restrained the trading hours to the quiet hours of the day
    – I have added a trailing stop
    – That code works on IB on DXS,

    I wish I could upload images to share lift and report of the backtest: over 200K 1 minute candles: 1154 € profit with a max drawdown of 377.5 €. They are a few overnight positions and thus requiring additional margin.

    I have not tried on IG Dax yet. I believe it can work on other indices as well. But first things first, I want to improve it.

    For those who are interested, I would be happy to work together on how to stretch the trading timerange of the strategy and to better manage the very long lasting positions.

    //————————————————————————-
    // Main code : 3 Candles DXS 1min
    //————————————————————————-

    DEFPARAM PreLoadBars = 100000
    DEFPARAM CumulateOrders = False

    //Timeframe (5 minutes)
    // ********* Short Trend *****************
    M8=HullAverage[30](close) // 6 on 5minute TF
    Tm8h=M8>M8[1]
    Tm8b=M8<M8[1]

    //********* Position Opening Hours ****************
    POH = Time > 104500 and Time < 141500

    //****** Strategy ********
    UNO = (open[2] – close) > 10*pipsize // 20

    IF Not onmarket AND POH AND (open[2]>close[1]) AND (close[1]>close) AND UNO AND Tm8h THEN
    BUY 1 CONTRACT AT MARKET
    ENDIF

    DUE = (close – open[2]) > 15*pipsize // 30

    IF Not onmarket AND POH AND (open[2]<close[1]) AND (close[1]<close) AND DUE AND Tm8b THEN
    SELLSHORT 1 CONTRACT AT MARKET
    ENDIF

    //Timeframe (1 minute)
    //************************************************************************
    //trailing stop function
    trailingstart = 5 //trailing will start @trailingstart points profit
    trailingstep = 2 //trailing step to move the “stoploss”

    //reset the stoploss value
    IF NOT ONMARKET THEN
    newSL=0
    ENDIF

    //manage long positions
    IF LONGONMARKET THEN
    //first move (breakeven)
    IF newSL=0 AND close-tradeprice(1) >= trailingstart*pipsize THEN
    newSL = tradeprice(1)+trailingstep*pipsize
    ENDIF
    //next moves
    IF newSL>0 AND close-newSL>=trailingstep*pipsize THEN
    newSL = newSL+trailingstep*pipsize
    ENDIF
    ENDIF

    //manage short positions
    IF SHORTONMARKET THEN
    //first move (breakeven)
    IF newSL=0 AND tradeprice(1)-close>=trailingstart*pipsize THEN
    newSL = tradeprice(1)-trailingstep*pipsize
    ENDIF
    //next moves
    IF newSL>0 AND newSL-close>=trailingstep*pipsize THEN
    newSL = newSL-trailingstep*pipsize
    ENDIF
    ENDIF

    //stop order to exit the positions
    IF newSL>0 THEN
    SELL AT newSL STOP
    EXITSHORT AT newSL STOP
    ENDIF

    • Stanko • 39 days ago #

      Hi KumoNoJuzza, thanks for the post. I also tried your code with Dax and the performance is interesting, however the drawdowns are larger due to a wider average volatility than the Cac and therefore not everyone can tolerate large negative balances for many days. With IG the overnight costs for Dax and Cac should be around 1 euro per day. The Nasdaq can also be interesting with the time slots you have set, but it is a much more volatile index than the European indices. Good evening

avatar
Register or

Likes

avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar
Related users ' posts
Wing There's a few threads on the forum about backtest and live trades being different at times. ...
ET I agree with verdi55. As it is now, the code will only test for a breakout on the upside (li...
Philipjonasson are u still active Wing?
Nicolas Thanks for sharing your automated trading strategy idea. Even if you accumulate loosing orde...
Maz Ok. Potential here to build onto this. Have opened a forum thread for further discussion: h...
diegofe_2000 cordial saludo NICOLAS , gracias por excelente indicador. ¿ es posible obtenerlo en MT4 ? ...
Nicolas Lo siento, pero no estoy trabajando para ayudar a la gente aquí de forma gratuita para promo...
diegofe_2000 Nicolas , gracias por tu atención. La pregunta era por curiosidad (yo no trabajo ni manejo ...
ALE
7 years ago
CSR strategy DAX 1 D
CSR strategy DAX 1 D
17
Strategies
Jesper I tried it on dax 1D and I did not get any trades. Shifted to 10H and it started working. Wo...
rgrgrgr I have the same problem
avatar
crazytrader Is this working?
larmhen
7 years ago
HerveS_67 Bonjour, A quoi correspondent les données S, M, L ? Hello, What do the data S, M, L?
Vinks_o_7 aux paramètres à rentrer : 5 20 et 200...
Francesco78 I did a little bit of work on that and now the results looks better and more stable. Please...
Francesco78 I did a little bit of work on that and now the results looks better and more stable. Please...
Khaled Hi Francesco , thank you for sharing your hard work. Any idea why all orders are executed at...
Maxime Baudin Nice, thanks!
rowestock Hi Nicolas, I am revisiting this indicator and wanted to ask, is it possible to replace sty...
Nicolas Why not, please add a new request in our probuilder forums.
majid52026 Hi I want MBXF Timing for mq5 Does anyone have this indicator???
dertopen Hi Nicolas good work for the code translation when i chek the mbfx system site i see in t...
Nicolas Yes, just change the color by yourself in the indicator settings window.
JanWd Thank you for the coding, it seems promising. FTSE gives for the short term (5 min) promis...
Jan Wind 21.04.2019: I retested the strategy for the DAX 5 minutes , it works fine for 10.000 bars, b...
bertrandpinoy hello Francesco, are you still working on this strategy?
avatar
bjoern With the same parameters? For me the results are negative
avatar
bjoern Oh ok, with the initial posted parameters it is positive
victormork yes! It's not like you want to put it on live but when I for example take the version I have...
otty82  all right. thanks
mmichael Hello, I noticed that the indicator shows the initial balance of today but also for all the ...
leyoy Bonjour, comment l'adapter sur 15 minutes au lieu de 1 heures ... j'ai changé 090000 par 081...
Derek Nice strategy. Have you tried adding a stop loss since there are a few sharp drawdowns? I ...
Piston_Broke Non so .... da qui la mia domanda iniziale :-)
Piston_Broke Hi Derek. I have tried many different ways to apply SL's to this and similar versions of th...
Nicolas Indeed, if you are not willing to loose, you will always win. Averaging down losers can carr...
David You're always safer going Long especially with averaging down on an index as the probability...
Oskar Bergvall  I noted Davids and Nicolas remarks. Could it be possible to make an indicator for contraria...
Lotar
7 years ago
Nicolas You can send it to contact@prorealcode.com and I'll attach it here. Thanks for your sharing!
Francesco78 Hi Lotar, which variables would you choose to recalibrate it to the present market condition...
Degardin Arnaud unfortunatly in today's market it's not working at all...
Nicolas it is based on seasonality of DAX.
Luciano Santiago Juárez Hello I am new here I am trying to understand this code IF monthlyMultiplierLong > 0 ...
Luciano Santiago Juárez Sorry the code copied bad the line I dont understand is: ELSIF monthlyMultiplierLong 0 THEN
Wing Yes, investigate as much as you want. For more insight, you can view the linet1, linet2 etc....
CKW Hi Wing, Thanks for your sharing. I am still trying to breakdown & understand your code...
Wing Hello CKW. No, the parameter, 7 in this case, is used when calling the RSI indicator to ide...
Nacho Buenos días Raul, tengo puesto este sistema desde hace unos días en una cuenta demo en la ve...
Dominik Hola Raul ... it looks wonderful :-) Why does it not work if I use less than 100,000 € capi...
Bobbi Hola y gracias por compartir! Descubrí que en 5 minutos teníamos algo muy bueno! Pero no ...
Nicolas You'll need to preload bars to get the good calculations of you indicators. I did not test i...
David Nicolas I tried DEFPARAM Preloadbars = 5000 And still the same drawn output of entries/exit...
marcara Hi, Thank you very much for the Moving Average Daily indicator, I am using it as indicator i...
danhei Hi I am tryong to figure out how trist strategy works. I am new to pro real time. Can some...
Plop61 Hello,Thank you for sharing this beautiful strategy.Is it possible to indicate the code for ...
NoName Thank you very much for this fascinating trading system. It is still proving to be extremely...
ALE
8 years ago
pollon Ciao Ale,  anche a me da questo errore  "QQE_QUDAX1HBUY"  "QQE_QUDAX1HSELL"  "UNIV_QUDAX...
reb Hi Ale do you trade these QU strategies?  Are the results same as backtests Thnaks in adv...
avatar
crazytrader Hi anyone that has run this lately?

Top