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
ak5hay2 Works like crazy on bitcoin. Use different timeframes. Thanks a lot Doc!!!
richyowen Hi, great code thanks. Very new to this forum. Is there a way to add a 100point target on an...
lisamitch50 Morning all, Just backtested on quite a few instruments, worked well on backtesting, but tel...
FULVIO09 Attualmente non c'è sufficiente volatilità : la condizione "C0 = AverageTrueRange[1500](Clos...
vlongobardo67 Ma io intendevo in backtest ! Scusa non l’ho menzionato.
ciniselloftse salve fulvio .il trading sistem e sempre profittevole?
reb Hello have you used this strat since last year ? live or Back test ? What are the results ?
beeb Yes last Year. But only back test
drysheep Hi all, did anyone test this strategy recently? As i dont get a single trade in the backt...
Yannick TradingDayLong = dayofweek = 1 or dayofweek = 2 or dayofweek = 3 or dayofweek = 4 or dayof...
Marlon Hey JohnScher, your code works fine, but my results aren't as good as yours. Even if I use ...
DarioMazza Bha... this code dont work. gg
ALE
7 years ago
settival CIAO ALE CREDO DI AVER SETTATO PER BENINO LO SCALPING INDICATOR MA NON VISUALIZZO I SEGNALI ...
graff.laetitia Hello, I'm sorry to bother you, I'm new to trading, I managed to download the indicator but ...
Alby118 i can get it to work? dax 1 min. upload indicator on the4 chart. thank you
Yannick Hello There is a mistake in trailing stop code, I think that this should fix the problem s...
Paul About the trailing-stop the way it's coded. That works for backtesting only, just look at th...
Jonny sorry paul, but system says that is not possible to put many stop order combined...what have...
BC
7 years ago
TempusFugit Thanks Bin, nice code, I can use several ideas of the way you build it
DarioMazza Thanks Bin, great concentration, i understand the first idea, but may u indicate me the asse...
Bin Hi Mazza This robot is optimized for DAX30.
GraHal Is this the Discussion Topic you need @Gregg https://www.prorealcode.com/topic/scalping-i...
bertrandpinoy bonjour Nicolas y a t il une possibilité de signal sonore dès qu une vente ou un achat serai...
Nicolas Oui cela nécessitera une adaptation du code cependant, merci de formuler une demande sur le ...
crolakstrading Hi Nicolas.. I'm really big fan of this indicator! is there any possibility to make this ind...
Nicolas Yes, that's possible. Please open a new topic in the forum.
crolakstrading Just saw your reply thank you!! I will open up a new topic!!
TempusFugit Masala, thanks for your contribution. I don´t like the offmarket spreads neither ;) I unders...
Uveus Tempus, me da un error al validar el codigo, sobre la variable N. Al crear el indicador me ...
TempusFugit Hi Uveus, I am guessing you inserted the code of the indicator into the system code, is ...
Paul Thanks for posting. I was currently searching how to improve day-trading based on support an...
Jessar Könntest du im Forum etwas öffnen und später darüber zu sprechen?
arahussein Hi All, I am new to trading and i find this indicator very logicail! Hence my (dumb?) quest...
teddy58 This system is the only one running on my PC, which i didn´t developed my myself. My forcast...
xpiga Hi! Is this system still working good? Anyone has it in the live account? It looks great. T...
Paul_Going Dutch Proformence will be beter with other starting hours and closing hours @Inertia
EchnatonX Hallo Im Demomodus bei IG habe ich das Problem, dass oft keine Orders ausgeführt werden kön...
Jan EchnatonX, nice late answer of me: Make the stop loss a percentage of the close, like 100/...
guleny Hello I made some optimization to make it better. But there are 5 transacttion which incr...
rejo007 hello david, i'll try it could you tell me wich strategy do you use in real? thanks
David Somogyi Hello, I have a couple of DAX strategies of breakout and mean reversion. I'll try to post...
Roberto Blázquez Hi David, I just saw your strategy and it's good!!! I'm going to try it from today in real a...
stratobast Good afternoon everyone. Thanks Doctrading for your work. I have an issue while using this ...
stratobast My bad guys. I understood what was the problem. The indicator uses highs and lows for the Re...
samwarduk Has anyone tried this on Bitcoin GBP1? The results look amazing but every time mine trie...
gackeen Scusa Pier, scusate tutti, sono nuovo. Ho caricato il file e mi viene restituito il messaggi...
JR1976 HI Nicolas , I tried to copy paste but not import directly and the code works well I hav...
mcosta This code doesn't work on 10.3 platform(IG), neither with copy/paste nor with itf import, an...
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...
ALE
8 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?
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...

Top