Long only 15 min DAX

Viewing 13 posts - 16 through 28 (of 28 total)
  • Author
    Posts
  • #28890 quote
    victormork
    Participant
    Veteran

    Yes I did. The drawdown I have now is coming from when the price is consolidation around the moving average. Hopefully the system is better on a longer history now.

    #28901 quote
    Nicolas
    Keymaster
    Master

    Yes, it’s a better now. 200k bars test attached.

    dax-intraday-trading.png dax-intraday-trading.png
    #28914 quote
    victormork
    Participant
    Veteran

    Nice. Still not super good until the more volatile market starts in 2015. I added one more short term moving average (100 periods). It didn’t improve the return on the 2 year timeframe I have but it did lower the draw down which is visible on the gain/loss ratio. Backtest with 2p spread.

    // Definition of code parameters
    DEFPARAM CumulateOrders = False // Cumulating positions deactivated
    
    // Prevents the system from placing new orders on specified days of the week
    daysForbiddenEntry = OpenDayOfWeek = 6 OR OpenDayOfWeek = 0
    
    // Conditions to enter long positions
    indicator1 = TEMA[10](close)
    indicator2 = SuperTrend[3,10]
    c1 = (indicator1 >= indicator2)
    indicator3 = CCI[20]
    c2 = (indicator3 CROSSES OVER -100)
    indicator4 = SuperTrend[3,10]
    indicator5 = Average[2200](close)
    c3 = (indicator4 > indicator5)
    indicator6 = TEMA[10](close)
    indicator7 = Average[100](close)
    c4 = (indicator6 > indicator7)
    
    IF (c1 AND c2 AND c3 AND c4) AND not daysForbiddenEntry THEN
    BUY 1 CONTRACT AT MARKET
    ENDIF
    
    // Conditions to exit long positions
    indicator8 = CCI[20]
    c5 = (indicator8 CROSSES UNDER 100)
    
    IF c5 THEN
    SELL AT MARKET
    ENDIF
    
    // Conditions to enter short positions
    indicator9 = TEMA[10](close)
    indicator10 = SuperTrend[3,10]
    c6 = (indicator9 < indicator10)
    indicator11 = CCI[20]
    c7 = (indicator11 CROSSES UNDER 200)
    indicator12 = TEMA[10](close)
    indicator13 = Average[2200](close)
    c8 = (indicator12 < indicator13)
    indicator14 = TEMA[10](close)
    indicator15 = Average[100](close)
    c9 = (indicator14 < indicator15)
    
    IF (c6 AND c7 AND c8 AND c9) AND not daysForbiddenEntry THEN
    SELLSHORT 1 CONTRACT AT MARKET
    ENDIF
    
    // Conditions to exit short positions
    indicator16 = CCI[20]
    c10 = (indicator16 CROSSES OVER -200)
    
    IF c10 THEN
    EXITSHORT AT MARKET
    ENDIF
    
    // Stops and targets
    SET STOP %LOSS 0.8
    Skärmavbild-2017-03-17-kl.-12.03.21.png Skärmavbild-2017-03-17-kl.-12.03.21.png Skärmavbild-2017-03-17-kl.-12.03.36.png Skärmavbild-2017-03-17-kl.-12.03.36.png Skärmavbild-2017-03-17-kl.-12.06.15.png Skärmavbild-2017-03-17-kl.-12.06.15.png
    #28919 quote
    Nicolas
    Keymaster
    Master

    Better is worse than good. Too much filtering reduce trades (almost 30% less for a limited increase in gain in my 200k bars test) and also statistics about robustness. It’s always difficult to be sure of what is a good filter or not. That’s why you should only make backtest with In Sample and Out Of Sample period, like I explain in this blog article: https://www.prorealcode.com/blog/avoid-equity-curve-fitting-with-probacktest-trading-strategy-optimisation/

    (it talks about optimisation, but the idea is the same for a normal backtest).

    Try to improve the strategy on IS period with as much ideas you can imagine. Then test the strategy on OOS period to see if it has improved the strategy result in the “future”, like if you were trading the strategy in real time. If the answer is “yes”, then your new ideas may be considered to be a good ones.

    #28922 quote
    victormork
    Participant
    Veteran

    Fair point! I have to start doing the OOS test you mention in your blog article. Very well written btw! On that point, do you know why the walk forward settings are not visible on my platform (v10.3)? (I have attached a picture of my screen).

    Skärmavbild-2017-03-17-kl.-12.49.06.png Skärmavbild-2017-03-17-kl.-12.49.06.png
    #28934 quote
    Nicolas
    Keymaster
    Master

    Walk Forward will be available to IG customers within the next weeks. It’s only available now for prorealtime trading customers.

    #29001 quote
    Paris
    Participant
    Veteran

    @ nicolas , could you post here the backtest on 200 k bars please .

    #29158 quote
    victormork
    Participant
    Veteran

    This is the latest update I have on the code. Now without the longer moving average which excluded a large amount of trades. All values have been selected by the optimisation function in PRT, apart from the stop loss which was suggested to be 1.05. In my opinon were the increase of risk greater than the increase of return. I have not yet tested on an OOS period.

    // Definition of code parameters
    DEFPARAM CumulateOrders = False // Cumulating positions deactivated
    
    // Prevents the system from placing new orders on specified days of the week
    daysForbiddenEntry = OpenDayOfWeek = 6 OR OpenDayOfWeek = 0
    
    // Conditions to enter long positions
    indicator1 = CCI[20]
    c1 = (indicator1 CROSSES OVER -100)
    indicator2 = TEMA[18](close)
    indicator3 = SuperTrend[3,10]
    c2 = (indicator2 > indicator3)
    indicator4 = TEMA[18](close)
    indicator5 = Average[130](close)
    c3 = (indicator4 > indicator5)
    
    IF (c1 AND c2 AND c3) AND not daysForbiddenEntry THEN
    BUY 1 CONTRACT AT MARKET
    ENDIF
    
    // Conditions to exit long positions
    indicator6 = CCI[20]
    c4 = (indicator6 CROSSES UNDER 200)
    
    IF c4 THEN
    SELL AT MARKET
    ENDIF
    
    // Conditions to enter short positions
    indicator7 = TEMA[18](close)
    indicator8 = SuperTrend[3,10]
    c5 = (indicator7 < indicator8)
    indicator9 = CCI[20]
    c6 = (indicator9 CROSSES UNDER 170)
    indicator10 = TEMA[18](close)
    indicator11 = Average[130](close)
    c7 = (indicator10 < indicator11)
    
    IF (c5 AND c6 AND c7) AND not daysForbiddenEntry THEN
    SELLSHORT 1 CONTRACT AT MARKET
    ENDIF
    
    // Conditions to exit short positions
    indicator12 = CCI[20]
    c8 = (indicator12 CROSSES OVER -160)
    
    IF c8 THEN
    EXITSHORT AT MARKET
    ENDIF
    
    // Stops and targets
    SET STOP %LOSS 0.8
    #29166 quote
    Nicolas
    Keymaster
    Master

    You should have optimised on 70% of history (IS) and test if it was correct on the last 30% by yourself (OOS) 🙂

    #29167 quote
    victormork
    Participant
    Veteran

    haha, why didn’t I think of that myself.. thanks a lot Nicolas!

    #29220 quote
    Paris
    Participant
    Veteran
    // Definition of code parameters
    DEFPARAM CumulateOrders = False // Cumulating positions deactivated
    
    // Prevents the system from placing new orders on specified days of the week
    daysForbiddenEntry = OpenDayOfWeek = 6 OR OpenDayOfWeek = 0
    
    once ordersize=1
    
    if Ordersize>18 then
    Ordersize=18
    endif
    
    // Riesgo, multiplicador de contratos.
    
    n=1
    
    // Conditions to enter long positions
    indicator1 = CCI[20]
    c1 = (indicator1 CROSSES OVER -100)
    indicator2 = TEMA[18](close)
    indicator3 = SuperTrend[3,10]
    c2 = (indicator2 > indicator3)
    indicator4 = TEMA[18](close)
    indicator5 = Average[130](close)
    c3 = (indicator4 > indicator5)
    
    IF (c1 AND c2 AND c3) AND not daysForbiddenEntry THEN
    IF PositionPerf(1) < 0 THEN
    OrderSize = OrderSize/2//+1
    if ordersize 0 THEN
    OrderSize =OrderSize+2
    endif
    BUY ordersize*n shares AT MARKET
    ENDIF
    
    // Conditions to exit long positions
    indicator6 = CCI[20]
    c4 = (indicator6 CROSSES UNDER 200)
    
    IF c4 THEN
    SELL AT MARKET
    ENDIF
    
    // Conditions to enter short positions
    indicator7 = TEMA[18](close)
    indicator8 = SuperTrend[3,10]
    c5 = (indicator7 < indicator8)
    indicator9 = CCI[20]
    c6 = (indicator9 CROSSES UNDER 170)
    indicator10 = TEMA[18](close)
    indicator11 = Average[130](close)
    c7 = (indicator10 < indicator11)
    
    IF (c5 AND c6 AND c7) AND not daysForbiddenEntry THEN
    iF PositionPerf(1) < 0 THEN
    OrderSize = OrderSize/2//+1
    if ordersize 0 THEN
    OrderSize =OrderSize+2
    ENDIF
    SELLSHORT ordersize*n shares AT MARKET
    ENDIF
    
    // Conditions to exit short positions
    indicator12 = CCI[20]
    c8 = (indicator12 CROSSES OVER -160)
    
    IF c8 THEN
    EXITSHORT AT MARKET
    ENDIF
    
    // Stops and targets
    SET STOP %LOSS 0.8
    #29222 quote
    Paris
    Participant
    Veteran

    just code your code with accumalation , here it is the backtest with 1 € per contract

    Capture-du-2017-03-20-18-55-12.png Capture-du-2017-03-20-18-55-12.png
    #30041 quote
    victormork
    Participant
    Veteran

    I wouldn’t recommend this. Better to have several systems which you size up simultaneously.

    manel thanked this post
Viewing 13 posts - 16 through 28 (of 28 total)
  • You must be logged in to reply to this topic.

Long only 15 min DAX


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
victormork @victormork Participant
Summary

This topic contains 27 replies,
has 5 voices, and was last updated by victormork
8 years, 11 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 03/15/2017
Status: Active
Attachments: No files
Logo Logo
Loading...