DAX 15Min – False Breakout / SuperTrend

DAX 15Min – False Breakout / SuperTrend
Hi everyone, First I'd like to thank you all for your contribution on this website. It's been a goldmine for me so far ;) You all found good names for your strategies but to be honest I haven't find mine yet.. Anyway, here is the thing:
  • Index: Dax 1€
  • TF: 15M
  • $Risk: You choose ! ;) - 1.5% of capital per trade in my backtest. Up to 3.7% due to seasonality (Thanks ALE for your piece of code about seasonality)
  • Spread: 2 pips
Variables were optimized different ways. Optimization from the beggining of PRT datas to 31/12/13 shows substantially the same trend. I hope my curve remains not so fitted.. Drawbacks:
  • Not so many trades
  • Several trades could last a very long time
  • Time between trades is also too long
  • The reverse short strategy does not lead to gains..
Thus, if you have any comments, ideas or anything that could improve this strategy, it would be really appreciated ! ;) Thank you all and keep posting interesting things here, I like it ! Maxime
DEFPARAM CumulateOrders = false
//DAX - 15M

sl=80
tp=150
p=18
d=20
m=1.5
Rg = 0.5

ONCE Januaryl = 1
ONCE Februaryl = 2
ONCE Marchl = 3
ONCE Aprill = 1
ONCE Mayl = 1
ONCE Junel = 2
ONCE Julyl = 3
ONCE Augustl = 1
ONCE Septemberl = 1
ONCE Octoberl = 1
ONCE Novemberl =2
ONCE Decemberl = 2
ONCE Monday = 2
ONCE Tuesday = 2
ONCE Wednesday = 1
Once Thursday = 1
Once Friday = 1
Once Saturday = 1
Once Sunday = 1

If Opendayofweek = 1 then
 DayMult = Monday
ElsIf Opendayofweek = 2 then
 DayMult = Tuesday
ElsIf Opendayofweek = 3 then
 DayMult = Wednesday
ElsIf Opendayofweek = 4 then
 DayMult = Thursday
ElsIf Opendayofweek = 5 then
 DayMult = Friday
ElsIf Opendayofweek = 6 then
 DayMult = Saturday
ElsIf Opendayofweek = 7 then
 DayMult = Sunday
Endif
// saisonal pattern long position
IF CurrentMonth = 1 THEN
 saisonalPatternMultiplierl = Januaryl
ELSIF CurrentMonth = 2 THEN
 saisonalPatternMultiplierl = Februaryl
ELSIF CurrentMonth = 3 THEN
 saisonalPatternMultiplierl = Marchl
ELSIF CurrentMonth = 4 THEN
 saisonalPatternMultiplierl = Aprill
ELSIF CurrentMonth = 5 THEN
 saisonalPatternMultiplierl = Mayl
ELSIF CurrentMonth = 6 THEN
 saisonalPatternMultiplierl = Junel
ELSIF CurrentMonth = 7 THEN
 saisonalPatternMultiplierl = Julyl
ELSIF CurrentMonth = 8 THEN
 saisonalPatternMultiplierl = Augustl
ELSIF CurrentMonth = 9 THEN
 saisonalPatternMultiplierl = Septemberl
ELSIF CurrentMonth = 10 THEN
 saisonalPatternMultiplierl = Octoberl
ELSIF CurrentMonth = 11 THEN
 saisonalPatternMultiplierl = Novemberl
ELSIF CurrentMonth = 12 THEN
 saisonalPatternMultiplierl = Decemberl
ENDIF

aMax = Highest[d](High)
aMin = Lowest[d](Low)
SupTnd = SuperTrend[m,p]
RngOk = (High-Low)/(aMax-aMin)<Rg

Equity = 10000+StrategyProfit
Risk = 0.015
n = Max(1,Equity*Risk/Sl/PipValue*SQRT(DayMult*saisonalPatternMultiplierl))
//n=1
cBuy = aMin[1]<aMin[2] And High<aMax[1] And Close>Open And RngOk And Close>SupTnd

If cBuy Then
 Buy n Shares at Market
EndIf

SET STOP ploss sl
SET TARGET pPROFIT tp
 
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?

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

  1. ALE • 62 days ago #

    Thank you for your new ideas, it’ very good.. !! seasonalty is reiner’s idea..but thank you for your Credit!!

  2. DESCOUMA • 61 days ago #

    Hi!

     

    Thanks for your comments and thanks Reiner for your syntax on seasonality.

     

    I did some walk forward testing and found quite good results particularly in the recent period (see attached .xlsx file).

    In my testing, I just managed to solve for the tp and sl (changed from pips to percentages in this study) which give me the best Return/Drawdown ratio using a 2 years period. Then I used those parameters for the next 6 months. And again, and again !

     

    Here is my last version of the code used for this test:

     

    DEFPARAM CumulateOrders = false
    //DAX - 15M
    
    ONCE p=18
    ONCE d=20
    ONCE m=1.5
    ONCE Rg = 0.5
    ONCE Risk = 0.015
    ONCE Monday =2
    ONCE Tuesday = 2
    ONCE Wednesday = 1
    Once Thursday = 1
    Once Friday = 1
    
    If Opendayofweek = 1 then
    DayMult = Monday
    ElsIf Opendayofweek = 2 then
    DayMult = Tuesday
    ElsIf Opendayofweek = 3 then
    DayMult = Wednesday
    ElsIf Opendayofweek = 4 then
    DayMult = Thursday
    ElsIf Opendayofweek = 5 then
    DayMult = Friday
    Endif
    
    aMax = Highest[d](High)
    aMin = Lowest[d](Low)
    SupTnd = SuperTrend[m,p]
    RngOk = (High-Low)/(aMax-aMin)<Rg
    sl=0.5
    tp=1.5
    Reinv = 1
    Coef = 0
    Balance = 23827.1
    If Reinv = 1 Then
    Equity = Balance+StrategyProfit
    Else
    Equity = 10000
    EndIf
    If Coef<>1 Then
    DayMult=1
    EndIf
    
    n = Max(1,Equity*Risk/(Close*Sl/100)*SQRT(DayMult))
    
    cBuy = aMin[1]<aMin[2] And High<aMax[1] And Close>Open And RngOk And Close>SupTnd
    
    If cBuy Then
    Buy n Shares at Market
    EndIf
    
    SET STOP %loss sl
    SET TARGET %PROFIT tp

     

    Maxime

  3. Cosmic1 • 61 days ago #

    Great work in trying to avoid curve fitting and walk forward test. Good to know that you have done this as gives some confidence moving forward to demo/live test. Are you planning running this on demo, live with minimum stakes or the code posted? 

    • Daniel da Costa • 38 days ago #

      Hi Cosmic! What is meant by curve fitting and walk forward test?

  4. DESCOUMA • 60 days ago #

    Yes. I’ll probably give it a try with 1% $risk / no reinvestment until I find a way to reduce the drawdown.

  5. jonjon • 54 days ago #

     This is very cool. Thank you very much.

    I’ve been playing a bit with it. How did you get your m, p and d values? m and p relate to the Supertrend indicator….as I’m new to this indicator can you tell me if these are pretty standard variables? d = 20 seems reasonable to me.

    I have just started paper trading the strategy. Adjusted the variables slightly to make a little more conservative: Rg = 0.4, Risk = 0.01, No reinvest. I’ve also optimised the p and d to 26 and 21 respectively (hence my question above).

    Back tested in tick mode from Sept 2012 which is just 60,000 units back (round number, nothing scientific there however thought it appropriate to base test from period post Draghi saying that ECB would do anything to stop Euro failing in July 2012 and then subsequent quieting down of volatility / market).

    I can’t attach my results (is this as I’m a Junior Member?)

    % winning trades = 40%

    Gain / Loss: 2.01

     

    I still want to get the loss of the worse trade down (-3,752) and the size of the Maxdrawdown is too large (-19,291 with 8 consecutive losses).

    I’ll look further into it however anyone looked at the poor performance in Q2 2013 and last quarter of this year? Down periods are to be expected but just wondering whether there was anything macro going on that we should bear in mind going forward.

    I’ll let you know how my trades go with this. Looking forward to hearing from any other of you guys paper trading this.

    Cheers

     

  6. K12AN • 53 days ago #

    Have you backtested using tick data?

  7. jonjon • 53 days ago #

    Yes. Well I think I am. I’m running v. 10.3 and I ticked “ProBacktest in tick by tick mode”

  8. DESCOUMA • 47 days ago #

    Hi,

    Thanks for your comments and sorry for my late answer 🙂

    m, d & p are optimized variables which I chose to maximize the Profit/Drawdown Ratio. Hence, since September 2012 using my last settings (0.5 %Loss / 1.5 %Profit / No reinvestment / No multipliers) it gives a worst loss of 1.77%, a DD of 12.8% and a profit of 94.17% with gain/loss = 1.51 and 33.21 winning trades.

    As all except 1 of the winning trades came after more than 5 candles in this last backtest, my guess is that tick mode or not it won’t change many things.

    Maxime

     

  9. jonjon • 47 days ago #

    Thanks Maxime. Appreciate it.

    I’ll let you know how it goes. I’ve been running it in demo in the background whilst I have been focusing on other strategies. No trades yet though so I’ll take another look at the code probably next week.

     

    Cheers

  10. Kenneth Kvistad • 47 days ago #

    Jonjon, do you have screenshoot of this strategy in tick by tick mode?

  11. jonjon • 43 days ago #

    Hi Kenneth. I can’t attach the screenshot I’m afraid. Unless I’m doing something stupid. I pasted the screenshot into Word and tried to attach the file.

  12. triss1965@gmail.com • 35 days ago #

    why do I get error ond line whit DAX? Eihter cod works. Can you chare the file?

  13. Elsborgtrading • 31 days ago #

    Hi Triss. the File is in the post for download. There is nothing wrong with the code. Your error describes 2 line- but it empty- perhaps some character sneaked in yours? . Please check that you code is correct copied. or download the file dax-15m-longonly.itf

    Cheers Kasper

avatar
Register or

Likes

avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar
Related users ' posts
Raul Vg It is true, I had forgotten, for the current configuration is necessary a capital of 3000 € ...
akira220984 I used this on a demo IG account today and used the following values: DEFPARAM FlatAfter =1...
akira220984 I used this on a demo IG account today and used the following values: DEFPARAM FlatAfter =1...
Jake26 Thanks for sharing your work with this code, Doc. Impressive results in backtests with shor...
Doctrading Hello, Actually I'm not trading this strategy. I'm looking to make a good automated tradin...
Rohan Hello Doctrading,  I am also very interested in the Ichimoku (I am trading it but discretio...
Doctrading Nice Job ! Here is my version of the code :  KBO = 0 Tenkansen = (highest[9](high)+lowe...
ALE
2 months ago
ALE CiaoGuadagno.
alemaliz Ciao Ale scusa se ti disturbo ancora possiamo sentirci in privato per un chiarimento su ques...
ALE Ma certo nel mio profilo trovi le info
DANY I did it on demo account; it's too dangerous for mea and I can not resist psychologically  ....
demoz How can a demo account be dangerous? Did you have it run live (on a demo account for exampl...
DANY Yes, I mean that I tried on a demo account for 2 months and it had work fine, like the BackT...
ALE Hello Luca,no this strategy is overfitted. 
traderfred Hello ALE is that mean you are not going to use it live? I don't understand what is "overf...
ALE Hello Traderfed, because it run many operations over the past three years, instead of havin...
ALE
3 months ago
enzo_52 Hi Ale, so you have the same results with german 30 mini 1e cash TF 1h?  
ALE no, only with TF 15m
enzo_52 Grazie tante, Thanks so much 
Nicolas
4 months ago
century hi, can we have more explanations please ? about parameters and time unit ? thanks
Nicolas Line 10: Volume of current candlestick must be at least 1.5 higher than the previous one and...
Cosmic1
4 months ago
Cosmic1 Hi Yngve, Amplitude relates to the range of the price action for the given times stipulated...
GAMMA I try as per your advise and change the time to usa time still no luck, may be I am doing so...
Cosmic1 Post the code you are using, will try and figure it out. What broker?
Elsborgtrading Hi Nicolas, and thanks for updating the file. When I backtest the code now I get a complete...
Elsborgtrading Hi Nicolas. I made a mistake. a FTSE chart had sneaked under the DAX and when backtesting I ...
Nicolas "set stop loss" are individual for each order with IG.
Cosmic1
4 months ago
Cosmic1 Hi Vish, Yes it was a good Thursday and Friday where between DAX and DOW breakout +800 point...
JakeDB I cannot get my time conversions correct for Sydney Australia to get any data for this code....
Cosmic1 @JadeDB What times are you putting in?
Philip Raphael Hey! Thank so much for sharing this wonderful indicator! I have always tried to code a simil...
CKW Hi Philip, What do you mean "Years" are not defined ? candle? If to code yearly candle size...
gianpiero75 sorry....now it's correct error ST = Supertrend[a,b] a=17 // default 10 b=58 correct...
MikeGC I don't know if you have used the variables a and b to optimise the parameters for the Super...
gianpiero75 I have not optimized, I multiplied the parameters for 6 (5,8), to use them on the 4  hoursTF...
zilliq The reasons why I think it's time consuming and we loose time to try to do backests and Auto...
filiprb Hello Zilliq, You don't need a system to produce a walk forward test. You can easily create...
Philip Raphael It is incredible! Thanks for sharing, Doctrading!
Doctrading Hello, As I said, I didn't use spread for the screenshot as I don't trade Gold and I don't ...
smurfy Hi, I had been losing on gold and after I manually go through the 5min chart using IG and w...
Reiner
7 months ago
Pathfinder DAX 4H
Pathfinder DAX 4H
182
Strategies
volpiemanuele Good morning, I would use the strategy on my IG account on FTSE 100 futures, rometime (9/22)...
Bandido Emanuele, vai nel forum e troverai di tutto e di più ;-)
Reiner Hi Emanuele and welcome, You'll find the latest versions at the first post in the related f...
Reiner
7 months ago
tradex Hello, what is the simple average period on equity curve ? Thank you in advance
Reiner tradex, open the settings dialog (click on wrench symbol) on the equity curve window and add...
Daniel da Costa Hi Nicolas! Is it possible too reference the MA in the equity curve so as too know whether t...
Tomax is Background colour only available from 10.3 and not possible with 10.2 ?
Nicolas Yes, colouring background by code is only available in the version 10.3. with the instructio...
ludo7769 Hello , J'ai la version 10.2 et ca ne marche pas, qu'est ce qui coince ?  Merci a vous 
finplus Hi Wanjpt, I tried once only on AUD / USD in november 2016 during one day. No position has b...
finplus The backtest of the code works perfectly with 1 hour timeframe.
CN Anyone got a correct code for the setup?Used Minihax code with mixed results... Anyone that ...
GraHal I adjusted for GMT (minus 1 hour on all times) ... no trades. Might it be because the code ...
GraHal Ooops got that excited I sent that last one twice! ha (and can't delete it, sorry) I got it...
Eric n = 3  dont forget to allow 3 contract in proorder

Top