Day-Trading the DAX with the Trend

Day-Trading the DAX with the Trend

Hi all !

Here is a very simple code, but very effective, in order to trade the DAX.

It’s a Day trading strategy, but it is designed for H4 timeframe.
It concerns the 3 candles : from 9AM to 21PM.

We go long at 09AM if :
close > 200 moving average
MACD > 0

We close positions at 21PM.

Stop loss and take profit : 1% and 3%

That’s all !

As you see, this very simple trend following strategy is positive (with spread : 1 point), on the last 10 years.
It is’nt before, but I think the DAX CFD trading hours were different.

It should be easy to improve this code, I’ve already made some improvements.
But I prefer giving you the basic and simple (but effective !) code.

 

 

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. Samsam13 • 04/30/2016 #

    Hi
    TP at 3%, isn’t it a bit too much ? Someone knows how many trading days saw the DAX moving than more than 3 % ?
    thanks 

  2. Doctrading • 04/30/2016 #

    You reach TP very very few times.
    Buy it happens on some days.
    Most of the time, you close at evening, that’s all.Without TP ans SL, the strategy is still profitable.

  3. Samsam13 • 04/30/2016 #

    so you count more on the “flatafter” than on tp ?

  4. Doctrading • 04/30/2016 #

    Yes, that’s the way. 

  5. keshejo • 04/30/2016 #

    Hi, i’m from Perú
    The time is 09:00 to 21:00 GMT? 

  6. Doctrading • 04/30/2016 #

    It’s 9:00 on my broker (ProRealTime CFD), so I think it is GMT+1.

  7. Doctrading • 04/30/2016 #

    Hi all,
    Would you trade using this strategy, as it is really profitable since 2014 ?Thanks.

  8. Yngve • 04/30/2016 #

    Hi
    So between 2009 and 2012 you take no profit, thats a long time to sit around and see it do nothing.
    Yngve

    • Nicolas • 04/30/2016 #

      Yes and that’s why a lot of strategies are never published, because people are impatient… This strategy are proof that automated trading work, so just sit and relax, and make profit while doing nothing. 😉

  9. Ad • 04/30/2016 #

    Hi, I am not sure if this is the right way to do this but I see here many professionals that maybe can help here to figure this up…
    I wrote a simple, similar code and its opposite one, i.e., entering in the counter position when exact the same condition occurs, TP3% and SL1%.
    To my overwhelming, when activating the both on the same time frame (Daily) at the same period (last month) I saw days where both came profit.
    Can you explain? Attached is added 
    // Conditions First code// Condition to enter long

    c3L = MACD[12,26,9](close)<0//close < open

    IF c3L and NOT ONMARKET and currenttime > 100000 THEN
    Buy 1000 Cash ROUNDEDDOWN AT MARKET
    ENDIF

    // Conditions to enter short

    c3S = MACD[12,26,9](close)>0//close > open

    IF c3S and NOT ONMARKET and currenttime > 100000 THEN
    SELLSHORT 1000 Cash ROUNDEDDOWN AT MARKET
    ENDIF

    SET TARGET %PROFIT 3
    SET STOP %LOSS 1
    //--- Conditions Second code----
    // Conditions to enter longc3L = MACD[12,26,9](close)>0//close > openIF c3L and NOT ONMARKET and currenttime > 100000 THENBuy 1000 Cash ROUNDEDDOWN AT MARKETENDIF// Conditions to enter shortc3S = MACD[12,26,9](close)<0//close < openIF c3S and NOT ONMARKET and currenttime > 100000 THENSELLSHORT 1000 Cash ROUNDEDDOWN AT MARKETENDIFSET TARGET %PROFIT 3SET STOP %LOSS 1
     

  10. Samsam13 • 04/30/2016 #

    We’re talking about trading, on derivatives, when you could potentially lose a lot. You shouldn’t be talking about “making profit while doing nothing” Nicolas, that sounds so awkward and untrue. I’m testing this strategy and i just had a drawdown of 8 losses, losing 2000 € (in test hopefully).

    • Nicolas • 04/30/2016 #

      8 losses in a row sounds possible in trading. Strategies in library are there because people were kind enough to share what they discovered while coding. FYI, there are a lot of codes that I don’t approve to be featured in. My answer to Yngve may be sound sarcastic, but that’s the way how I talk sorry for that, did I mention I put a smiley? Anyway, 2k€ is how much percent of your demo account?

    • Doctrading • 04/30/2016 #

      The backtest shows a maximum loosing streak of 8 consecutive trades. So it is possible.
      That’s trading, you could also have 8 winning trades.
      That’s also why I don’t like martingale.

  11. Samsam13 • 04/30/2016 #

    hopefully – thankfully

  12. Samsam13 • 04/30/2016 #

    then i’ll have a smiley too
    :-p

  13. Samsam13 • 04/30/2016 #

     
    and thanks for all the advice

  14. Samsam13 • 04/30/2016 #

     
    what i wanted to say, is that if you enter now into this pattern of auto trading, you would have a drawdown of 9 consecutive losses, wich could kill your account, so even with a smiley, please do consider that people that would read you would take what you say very seriously (either clients, or regulators). Some are really seeking for a way to earn money doing nothing in a secure way, we have to be very careful in what we say and the way we say.

    • Nicolas • 04/30/2016 #

      Yes you are right, maybe I need to add more disclaimer? I’m actually trading some automated system that can kill my account and I assume myself the responsibility of my own trading decision. There are no “blackbox” system here, all codes are readable by everyone, they are free and no one are earning money by putting them on this website. I’m not selling ebook or magical potion to make everyone a millionaire, there are also no publicity on the site.
      My attention for the answer I made were to say that criticism is easy when you just click and download. Trading systems that do not make profit even in 2 consecutive years do not invalidate a strategy that work well over a decade. We could have this discussion in every code shared here, sometimes things go bad, sometimes trades go well.. that’s how it goes and no one can change this..

  15. Doctrading • 04/30/2016 #

    Hello Samsam13,
    I hope you are well.  As you can see, some of us post various strategies. But you must understand that :

    these are not definitive and commercial strategies. These a good strategies that we publish for free, as “open codes”. So everyone can use and improve those strategies (the goal is to improve them), but it doesn’t mean that these strategies are always used by ourselves.
    myself, I don’t use all the strategies that I did post, of course ! I use only 3 strategies of my own. And it is less than 10% of my capital. The > 90% of my capital is secured investment.
    Even the better traders who get 100% annual return in trading tournaments have drawdowns… usually 50% drawdown.
    9 consecutive losses doesn’t have to make afraid, depending of the strategy. The rule n°1 of trading is : PROTECT your capital ! So I don’t bet more than 1% risk per trade (when I was a beginner, I did bet 5 to 10% sometimes… it did annihilate my account twice, and nearly a third time). 9 consecutive losses would be 9%. But if the reward ratio is 3:1, only 5 wins would make +15%. See for example the “Breakout ProOrder CAC40” : the winning ratio is low, but the strategy wins on the long term, because average wins are greater than average losses.
    This is what Nicolas wisely said : some losses do not invalidate a good strategy. Maybe we will have soon a “disclaimer” word.

    I hope this helps, and I wish you good trades. You can ask for help whenever.Best regards,

  16. Wilko • 04/30/2016 #

    Dear Nicolas,
    Thanks for posting this! It is always interesting to see what people have found to work. One question: In the picture for the article, the results page shows both long and short positions, while the code is strictly long-only. Is the picture relevant for this code?
    Kind regards,
    Wilko

  17. Wilko • 04/30/2016 #

    Please accept my apologies, I believe I should go to bed instead of posting irrelevant questions. Anyway, thanks again for this post!

    • Nicolas • 04/30/2016 #

      Ahah, I’m not the author of this one 🙂
      I know you are a great coder Wilko, why don’t you post one or two of your findings? Hope to see content from you very soon 🙂

  18. Wilko • 04/30/2016 #

    Thanks for the flattery! I will, I promise. 
    /F

    • Nicolas • 04/30/2016 #

      Still don’t have seen anything from your own 🙂 You promised me! Ahaha 

avatar
Register or

Likes

avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar
Related users ' posts
Dom Hello, hello....je commence le trading et découvre par la même occasion le codage....et ce n...
Nicolas Merci, ça fait plaisir !
Be-n Bonjour tout le monde ! Dans l'indicateur de tendance, j'ai du mal à saisir la nuance entre ...
YvesRobert @robertogozzi. It's done. Thank you
YvesRobert Hello Roberto, some questions about your strategy. 1 - Do the 2 lines SET TARGET pPROFIT T...
robertogozzi 1. The 2 lines SET TARGET pPROFIT TP and SET STOP pLOSS SL are always executed, each bar. Bu...
avatar
Anonymous Hi robertogozzi - thank you very much for sharing this strategy. I have performed various ...
robertogozzi Thank you samsampop.
Dotan Hello guys I really appreciate this coding effort but can I use this code for Mt5 Forex Trad...
Gubben So far so good. After a long drawdown it was winning four times in five weeks. Since 24 jul...
pat95162 Salut Pourquoi je n'ai pas les même résultats que vous
UkCoopDownUnder Any hints for us, on which variables we should be optimising ? As of November 2020, the cu...
Peter I recognized a possible problem with the timeframe / Defparam variables. As far as I know, t...
superfalcio Hello Peter, it is long time i have been watching this strategy, very good and interesting ...
Peter I indeed do have different modified strategies in the market. In the past my variants perfor...
JJ Tec Hola. Me gustaría contactar contigo para ver la estrategia..
nilsla1981 Has someone already tested in real ?
Lucas0000 Hola. estoy buscando un programador en proorder, para hacer un programa basado en el Q-trend...
JOKAMAURICE Thank you but I don't really understand. The values don't fit with what I see on my chart. I...
Alberto Aguilera Hi! Thanks for your strategy Anyone can check it with 200 bars?
TempusFugit Hi, this simple system for DOW and only shorts has worked quite well, maybe because of its q...
phoentzs Unfortunately, I never pursued this strategy further. Maybe I should take a look with what ...
tobytarczy Hi Vonasi, Sounds lovely, I race yachts around europe myself. Most regattas cancelled unfor...
mlouys Hello Vonasi thank for your work ! A question how can we do it for minutes ( or 15 min or x ...
Vonasi I think that would be possible but probably in a whole new indicator as detecting when a new...
darbes Hi How does it go on live ? JC
antonio73 Balmora74, io vedo che funziona anche su timeframe ad 1 minuto con piccole ottimizzazioni, t...
Juananantoniorodriguez hola buenas, a este sistema automático, Cómo se le podría poner un stoploss de beneficio sim...
Exalaxe Hey, i just noticed you optimized this strategy. Could i see your new version, please?
Andrea.1981 sorry i add my code but it not enter why i dont know
Andrea.1981 this is code simply stop , and you can see another version for stop / Codice principale...
avatar
unkown ;-) sfido chiunque a riuscirci!
avatar
unkown infatti basta leggere i post degli altri....
nicola papangelo ciao Francesco vorrei contattarti su facebook o in privato. Grazie
hartgeld Hallo Atxeel, sehr interessanter Code, habe das installiert und funktioniert. Danke! Kannst ...
atxeel Hallo hartgeld, die Ziele sind schlicht, bspw. die Range beträgt 10 Punkte, dann ist das Zie...
Maik2404 wie kann ich den Code bekommen Paul?
jens_kittner Works with US Crude at 1h as well!
Jean-Claude REGIS Je préconise de regarder les graphiques H1 et M15 pour visualiser la tendance de fond et d'...
Paul the last update can be found in topic Strategy DayOpen Straddle for DAX on page 14.
bertrandpinoy l instruction GRAPH pose problème sur PRT... pas vous? cordialement
Nicolas Supprimer simplement les lignes avec GRAPH pour passer en ProOrder, trading live.
TraderFelix
7 years ago
Bebbo Thank you for your contribution. I have tested your system on some instruments and I like i...
bertrandpinoy bonjour j ai tente l installation mais PRT m indique que ce code ne peut etre utilisé qu en ...
Nicolas en effet, il faut utiliser l'éditeur de code ProBacktest, il ne s'agit pas d'un indicateur m...
Xusto Hello, Fully Agree, I will update it with your advice. Btw Can would you like share you co...
Niklas johansson hägglund do you now if it's possible to use this strategy with this code in tradingview also?
Alexander9 This code for metastock ?, can for amibroker . Thanks
avatar
Anonymous Hi Odin, Thanks for this screener based on the popular criteria to trade trends from Marc...
Petersson Kristian Hi when I do back test I get 0 results, what do I do wrong? Trade Well Chris
JohnScher Yes i did before, see library/strategys/repulse and dpo https://www.prorealcode.com/proreal...
JohnScher Don't know what you're doing wrong. Import ITF and observe time zone settings. This should...
osupero https://www.screencast.com/t/2fCW8fkGsOeZ....solo posiciones largas por ahora
osupero https://www.screencast.com/t/MIaSZ2PRg
ALZ Hi JohnSher, Nice but not the same result Do you have the last itf of it ? Good result i...

Top