Quadrant DAX intraday Strategy

Quadrant DAX intraday Strategy

Hey there,

I like the ProRealCode community very much – so many ideas and solved problems!

Now, this is my first post of a strategy I developed long ago, when I still worked with MetaStock. Programming in Prorealtime is much more comfortable. Im not a master-programmer but I like to share my idea here:

The idea is  that after a bearish phase the market makes it often the other way round and we can cut a little piece out of this “swing back”. But the swing back has to reach a certain level. I know this is a kind of Fibo-Trading, but I divided the downtrend with help of the donchian channel into 4 sections. The first section is the bottom, the second and the third are in the middle and the fourth is the top.

When the market crosses from the first to second section we go long. Target could be the level from second to third section. Sometimes you can risk more… This is the variable “zl” in the code.

In addition to the first signal the standard macd has to show an upwards trend.

Also I added a very, very light progression in it. I know – things like martingale always lead to a catastrophe. But I think at certain winning rate it can “help” a little bit – its a limited progression. The progression can also be sharpened or smoothed with the “ff”-variable.

The starting ordersize “os” can be adapted to your account. An ordersize of 1 makes a drawdown of 293,- Euro, what is acceptable while gaining 3400,-. For me a draw down of 1/10 of the win is very acceptable. The maximum os is 7 in this case.

Increasing the ordersize to 3 makes a dd of 1022, while gaining 10600. Maximum os is 21.

Please feel free to change, prove and test the code….

Thanks for any responses….

Lotar

 

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. Nicolas • 02/28/2017 #

    Hi Lotar, thanks a lot for your contribution and for your feedback about our website 🙂
    I’m filtering a lot what people are posting in the Library, that’s why you’ll find sometimes their posts directly in the forums instead of here. I must admit that this time I were wondering if this one should or not be part of it. The result of the strategy isn’t so good before 2016 ( https://www.prorealcode.com/wp-content/uploads/2017/02/quadrant-strategy-results.png )  But because the strategy is interesting and well coded and commented, I decide to make it features here instead for everyone’s benefit. I think you might find people to improve your ideas in the forums too, I’m looking forward for your next post 🙂 Thanks again.

    • Lotar • 02/28/2017 #

      Hello Nicolas,
      thanks for your backtest. Unfortunately IG (at least my account) offers me only 100.000 units for backtesting 🙁
      But – generally – I think that a strategy has to be adjusted regularly to the market. So: Does it make sense to backtest so far in the past? What I did is – and I got positive results – adjust variables every month. I backtested a timeframe of 5 months. I adjust the variables (in my case the “mgr” and the “zl” and the “ff”) depending on this backtest and then make a backtest for the next month.. and so forth. I think this is called “forward”-test !? I have to notice the results on paper. Besides – If this would be sometime an automatically feature of PRT – this would be unique I think! A window in PRT that asks: How long backtest? Which variables to take over in the forward-test (for exemple only best 3 results)? How long forward-test? And than just push a button and look at the results… maybe in one of the next updates?
      Now I cant do this kind of (manually) forward-test back to 2013 because of my limited 100.000 units….
       
      Regards
      Lotar

    • Nicolas • 02/28/2017 #

      A new feature for variables optimisation is already coming to IG users in a few weeks: the walk forward module. You can have a quick view here in the blog: https://www.prorealcode.com/blog/learning/strategy-optimisation-walk-analysis/
      It will help users to their optimised variables in OOS (out of sample) periods, like forward-test, but in the past. This interesting tool will be valuable to avoid overfit.

  2. Joachim Nilsson • 02/28/2017 #

    Thanks for your code. A walk forward test would be much needed with a system like this. I´m a bit concerned with your “martingale” like money managment system. How does it perform without it?

  3. Benjamin • 02/28/2017 #

    Hi all, really love the community that is going on here, I am desperately trying to improve my coding so hopefully I will be contributing soon! 
    Just a question when I am backtesting my strategies, currently I have only been able to date back to 10,000 units, however many of the strategies I have seen on here go back much further. Is there a simple way I can solve this?
     
    Cheers:)

    • Nicolas • 02/28/2017 #

      You should have a look at the complete list of benefits you’ll get to be a PRT CFDs premium customer : https://trading.prorealtime.com/en/brokerage/cfd-forex-trading

  4. manel • 02/28/2017 #

    Hi Benjamin – If you look at the chart window on the top there is a dropdown box which starts at 25 units all the way up to x years. If You then select (x) units a box will appear to the immediate left and then you can input the number of units in that box. If you have the Premium version of PRT you can get 200,000 units of data. If you have the standard PRT Complete version then you will have access to 100,000 units of data. Hope that helps.

  5. jonjon • 02/28/2017 #

    Hi Lotar. Thanks for the code. I have gone through it line by line and I’m having trouble understanding this section:
    if hour=8 and minute>45 then // default setting of parameters outside tradingtime
    if strategyprofit>sp then // and if equity reaches maximum again.
    os=osa
    sp=strategyprofit
    endif
    start=0
    endif
     
    I’ve been thinking about it for a few days and I don’t think I can completely understand it. I also don’t really understand the difference in the code between os and osa. Please can you explain a little more for a beginner?
    Many thanks in advance.

  6. Lotar • 02/28/2017 #

    Hi Jonjon,
    no problem!
    Every morning between 8.45 and 8.59 the system checks if the strategyprofit hits the last high.
    When you had a losing trade the os (ordersize) is increased. The system trades as long with the new ordersize (or even more – up the the set maximum) as it reaches its former high again.
    Example:
    You start with 1000 Euro. First order with 1 contract (os=1). You win. Now you have 1025 E (strategyprofit=25). Next order is a losing trade -10 E. Now equity is 1015 (strategyprofit=15). The variable “sp” is the memory of the highest strategyprofit (sp=25). After a losing trade ordersize is increased to 2. (os=2). Next trade is a winner – lets say +30. Now equity is 1045 (strategyproft=45). At 8.45 (out of trading time) the system noticed: strategyprofit is bigger than sp (45>25) –> A new high of the strategyprofit. No the ordersize is set to the beginning (osa). In this case osa=1 –> os=1.  “osa” = ordersizeanfang (german: ordersize at the beginning). Also sp is set to 45 –> sp=45.   The variable start is set to 0 “zero” – that means the system is allowed to trade again. After 1 trade the “start” is set to “1” to tell the system only to make 1 trade a day.
     
    Hope I could help.
     
    Regards
    Lotar

  7. jonjon • 02/28/2017 #

    Thanks Lotar for your time explaining this. In your example above I still don’t understand why sp = 25 and not sp = 45 (after you had the winner of +30)? Is sp calculated once per day?

  8. François Gonin • 02/28/2017 #

    Hi Lotar, vey nice ! I will try it thank you 😉

  9. François Gonin • 02/28/2017 #

    When i backtest the strategy it looks working well…
    I try with The :
    Dax  5€ 10 contract Max
    capital 10 000€
    Dax 1€ 5 contract Max
    capital 1000 €
     
    The question I have is How works the stop loss and the take profit ?
    Because when I backtest with a capital of 1000€ and the Dax 25€ for exemple… It crash to – 52 000€… Is that min that we can lose more than what we have ?

  10. Lotar • 02/28/2017 #

    @ Jonjon: First the strategyprofit has to be higher than sp. After that sp is set to the new level… yes its checked once a day.
    @ François: I only tested this strategy with the Dax 1 Euro Mini. I would not run it with the “normal” Dax (1 Point = 25€).
     

  11. Plop61 • 02/28/2017 #

    Hello,Your strategy is amazing, thanks for sharing.Is it possible to make the same code for short positions? If so, could you tell me the code?Thank you in advance.

  12. Lotar • 02/28/2017 #

    Hi Plop61,
    thanks for your comment.
    To make the code for short positions is possible. But its difficult because you have flip the Quadrants. But I am working on that.
    Another thing I am workin on is to test/ transform the code with/to other time scales…
    Regards
    Lotar

  13. JvdG • 02/28/2017 #

    Hi Lotar,
    your strategy raised my interest; I did some tests and made a few adjustments fit for my own situation;
    above all I did not change your main idea of using Donchian and the macd; I made some other changes and additions, to serve the following two purposes:

    raising the % of winning trades from the 50%- to the 80%-zone; then the strategy is less of a tossing and more of a real strategy;

    raising the profit/loss-ratio 

              reducing the drawdown
    I commented my adjustments inside the the strategy.
    1.  I adjusted the os; your strategy has positions like 2.66; since I use cfd’s at IG, my position should always be an integer; then I allowed os to be either 1 or 2;
    2. I added another indicator for the trend: the MA based on HULL;
    3. I limited the length of the trade to 29 bars, to prevent going overnight; moreover: the longer the trades, the bigger the chance of losing;
    Based on 100.000 units my strategy has 126 trades, yours 176; but I guess that 126 is still statistically significant. I used WFA to optimize. My system has less total gain, but with 85% winning trades and a p/l ratio of 2.51 in combination with a much smaller os there is a considerable reduction of loss. I have to admit that your system makes big gains, however I would not yet be prepared to pay such great losses for that.
    A final note on WFA: it’s not only useful against curvefitting, but also a method to converge a parametervalue. I already apply WFA manually for some years: I optimize on a certain period and then test the strategy on the adjacent out-of-sample period. Hoping that my parameters in the end converge to certain stable, profitable values. However, the basis remains that one knows how to optimize, and that one knows which parameter influences which result. I always optimize by analyzing the data in excel charts. 
    Well, I will check how this strategy works in April, then optimize and see how the new version works in May and so on; the goal being that the differences between two version eventually get smaller. 
    I think you did a great job. I hope you will consider to make a short strategy, it would be my pleasure to elaborate that one. It would also be nice to make an indicator that belongs specifically to this strategy, so that we can study why certain trades go wrong…
    All the best, Jerke vd Geest
    Netherlands
    Here is the link to download my version of the strategy: https://www.prorealcode.com/wp-content/uploads/2017/04/Quadrant-2.0-DAX-5-min.itf
     
     

    • Nicolas • 02/28/2017 #

      You can send it to contact@prorealcode.com and I’ll attach it here. Thanks for your sharing!

  14. Francesco78 • 02/28/2017 #

    Hi Lotar, which variables would you choose to recalibrate it to the present market conditions?
    Thanks!!

  15. Degardin Arnaud • 02/28/2017 #

    unfortunatly in today’s market it’s not working at all…

avatar
Register or

Likes

avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar

+7 more likes

Related users ' posts
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
6 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
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...
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
6 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
6 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.
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 ...
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
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...

Top