Strategy DayOpen Straddle for DAX

Viewing 15 posts - 136 through 150 (of 242 total)
  • Author
    Posts
  • #102062 quote
    Paul
    Participant
    Master

    Too bad! But perhaps there’s a better way then I coded.

    Will post back soon. In the meantime, did you change the values nopl/nops 2 and 14 or made other modification?

    #102063 quote
    Paul
    Participant
    Master

    It’s a problem I experienced earlier, especially when you have the values nopl/nops both low.

    Criteria for long and short can both be true and at the same bar.

    I removed the workaround. Another permanent fix is using “crosses over/under”.

    
    if tradetime then
    if time = entertime then
    dayopen=open
    endif
    
    donopl=dayopen+nopl
    donops=dayopen-nops
    
    if high > donopl and c10 then
    mclong=1
    else
    mclong=0
    endif
    
    if low < donops and c10 then
    mcshort=1
    else
    mcshort=0
    endif
    endif
    
    // [ec] extra criteria
    if extratradecriteria then
    eclong = high < dhigh(1)
    ecshort = low > dlow(1)
    else
    eclong=1
    ecshort=1
    endif
    
    // long & short entry
    if not onmarket and tradetime then
    if pclong and mclong and eclong then
    if ordertype=1 then
    buy positionsize contract at market
    longtradecounter=longtradecounter + 1
    tradecounter=tradecounter+1
    elsif ordertype=2 then
    buy positionsize contract at donopl stop
    longtradecounter=longtradecounter + 1
    tradecounter=tradecounter+1
    elsif ordertype=3 then
    buy positionsize contract at donopl limit
    longtradecounter=longtradecounter + 1
    tradecounter=tradecounter+1
    endif
    endif
    if pcshort and mcshort and ecshort then
    if ordertype=1 then
    sellshort positionsize contract at market
    shorttradecounter=shorttradecounter + 1
    tradecounter=tradecounter+1
    elsif ordertype=2 then
    sellshort positionsize contract at donops stop
    shorttradecounter=shorttradecounter + 1
    tradecounter=tradecounter+1
    elsif ordertype=3 then
    sellshort positionsize contract at donops limit
    shorttradecounter=shorttradecounter + 1
    tradecounter=tradecounter+1
    endif
    endif
    endif
    winnie37 thanked this post
    #102064 quote
    Paul
    Participant
    Master

    This code uses trailing stop. I’am working on a bollingerband exits as alternative.

    It’s coming on nicely. This is with a disabled trailing stop on the V2.

    Screenshot-2019-07-07-at-01.21.19.jpg Screenshot-2019-07-07-at-01.21.19.jpg
    #102105 quote
    winnie37
    Participant
    Veteran

    Nice; could you post it soon?

    #102106 quote
    winnie37
    Participant
    Veteran

    no, no values changed…

    #102109 quote
    Paul
    Participant
    Master

    sure, it’s about the same concept as in the other strategy.

    normally I use 1% stoploss, but 0.5% worked too.

    goodluck

    bu=bollingerup[20](close)
    bd=bollingerdown[20](close)
    br=(bu-bd)
    
    pp=(positionperf*100)
    
    if not onmarket or ((longonmarket and shortonmarket[1]) or (longonmarket[1] and shortonmarket)) then
    flag=0
    endif
    
    if pp>=0.35 and (open>bu or open<bd) then
    flag=1
    endif
    
    if longonmarket and (flag=1) and high<bu and  (br<br[1] and br[1]<br[2] and br[2]<br[3] and br[3]<br[4]) then
    sell at market
    endif
    
    if shortonmarket and (flag=1) and low>bd and  (br<br[1] and br[1]<br[2] and br[2]<br[3] and br[3]<br[4]) then
    exitshort at market
    endif
    
    winnie37 thanked this post
    #102124 quote
    winnie37
    Participant
    Veteran

    A bit lost in the codes, sorry?. Could you post the entire code with BB? A favorite one for you/compared on 200k? Thanks for your kindness 🙂

    GraHal thanked this post
    #102151 quote
    winnie37
    Participant
    Veteran

    Hi Paul,

    i was wondering if we could add this feature, with “fake orders” under the mean, and if it would be a good way to improve the strategy?

    https://www.prorealcode.com/blog/learning/how-to-improve-a-strategy-with-simulated-trades-1/

    Im’ not strong enough to code it, with our strategy….Would you be able to test iit?

    Another idea, maybe we could avoid losses when the gain is closed under its medium boll? And take news trades only when the opening of a new trade is opened above its medium boll, to follow the trend.

    Capture-d’écran-2019-07-08-à-12.11.11.png Capture-d’écran-2019-07-08-à-12.11.11.png Capture-d’écran-2019-07-08-à-12.28.21.png Capture-d’écran-2019-07-08-à-12.28.21.png
    #102158 quote
    Paul
    Participant
    Master

    @winnie37 Thnx for the link.

    Here’s the difference with the code from above.

    Bollinger exit v2 vs trailing stop exit v1.

    I will review the code v2 and post it later. Both exits have their strengths.

    GraHal and winnie37 thanked this post
    Screenshot-2019-07-08-at-12.47.03.jpg Screenshot-2019-07-08-at-12.47.03.jpg
    #102172 quote
    winnie37
    Participant
    Veteran

    Thanks Paul. What do you think about the idea around the mean of gains, with “fake order”? Very nice on the paper, but no idea if it could really improve our results…

    #102175 quote
    winnie37
    Participant
    Veteran

    @winnie37 Thnx for the link.

    Here’s the difference with the code from above.

    Bollinger exit v2 vs trailing stop exit v1.

    I will review the code v2 and post it later. Both exits have their strengths.

    I suppose it’s the lastest postion on this morning on the screen you posted. I took it with a large potential gain, which has been strongly reduced at the close. On your v2, it seems not to be the case. Surely, both have their strenghs, avantages and inconvenients…

    #102258 quote
    Paul
    Participant
    Master

    @winnie37

    I tried your link & to insert the code in the strategy. Only focused on PT&SL

    It created an infinite loop and didn’t work. At the moment I will leave it at that, perhaps I will ‘ve a look later on again.

    The strategy is supposed to do only one trade a day.

    About the closing tip, you could try to adjust the bb strategy. Hopefully you find an exit with better results.

    winnie37 thanked this post
    #102269 quote
    Paul
    Participant
    Master

    v3

    a few changes;

    • slightly changed the way it goes to market
    • expanded holidays
    • exit if position is hold overnight into a holiday
    • add bollingerband exits
    • add trend safety exit flexibility

    note

    • only bb, no ts, potential profit >=0.35 can turn into loss
    • only ts, no bb, potential profit >=0.35 can turn to breakeven

    safest is to combine both.

    winnie37 and Gregg thanked this post
    dayopen-straddle-V3-DAX-1min.itf
    #102283 quote
    winnie37
    Participant
    Veteran

    @winnie37

    I tried your link & to insert the code in the strategy. Only focused on PT&SL

    It created an infinite loop and didn’t work. At the moment I will leave it at that, perhaps I will ‘ve a look later on again.

    The strategy is supposed to do only one trade a day.

    About the closing tip, you could try to adjust the bb strategy. Hopefully you find an exit with better results.

    thanks for the quick test. The idea of creating ineffective orders below the average of the gains seems to me good to take position only in trend of good average performance. The concept seems good to me. Tell me in the future if you want to work on it, if you have time. Thank you in any case for your precious help!
    #102286 quote
    winnie37
    Participant
    Veteran

    v3

    a few changes;

    • slightly changed the way it goes to market
    • expanded holidays
    • exit if position is hold overnight into a holiday
    • add bollingerband exits
    • add trend safety exit flexibility

    note

    • only bb, no ts, potential profit >=0.35 can turn into loss
    • only ts, no bb, potential profit >=0.35 can turn to breakeven

    safest is to combine both.

    It sounds good! A compared test on 200K?

Viewing 15 posts - 136 through 150 (of 242 total)
  • You must be logged in to reply to this topic.

Strategy DayOpen Straddle for DAX


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
Paul @micky75d Participant
Summary

This topic contains 241 replies,
has 39 voices, and was last updated by Monobrow
5 years, 1 month ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 11/04/2018
Status: Active
Attachments: 100 files
Logo Logo
Loading...