Strategy DayOpen Straddle for DAX

Viewing 15 posts - 16 through 30 (of 242 total)
  • Author
    Posts
  • #84444 quote
    ullle73
    Participant
    Senior

    does not look like this is correct

    Make it easier for us … please post the snippet of code you are referring to and a link to the post in which that snippet appears.

    or can you explain in plain english what a buy signal for this system is?

    #84445 quote
    Paul
    Participant
    Master
    min1 = MIN(dhigh(0),dhigh(1))
    min2 = MIN(dhigh(1),dhigh(2))

    This code above finds the lowest value from the daily high’s, today, yesterday and day before

    tcxLong = high < MIN(min1,min2)

    This code above checks that the high of the i.e. 10min bar is lower than the lowest value from first code.

    My reasoning  for this long criteria, is that a previous daily high’s are a selling level, a resistance.

    So, if the current high is below that, it has generally speaking a bit of room to increase and therefore also has more chances to make a profit.

    #84446 quote
    ullle73
    Participant
    Senior

    This code above finds the lowest value from the daily high’s, today, yesterday and day before

    This code above checks that the high of the i.e. 10min bar is lower than the lowest value from first code.

    My reasoning for this long criteria, is that a previous daily high’s are a selling level, a resistance.

    So, if the current high is below that, it has generally speaking a bit of room to increase and therefore also has more chances to make a profit.

    could you explain in the most simple english what a buy signal for this system is? if i would like to try it manually

    #84514 quote
    volpiemanuele
    Participant
    Veteran

    Hi, It make some optimisation with time frame 3 minute and 10 minute with the combine william & trailing and the result are very good. In your opinini which time frame is the best ? Thanks

    sl = 0.94  // % Stoploss
    pt = 1.41 // % Profit Target
    ts = 0.35  // % MFETrailing
    
    // indicator settigns
    NOP=15 //number of points
    sl = 1.15  // % Stoploss
    pt = 1.5 // % Profit Target
    ts = 0.35  // % MFETrailing
    
    // indicator settigns
    NOP=24 //number of points
    GraHal thanked this post
    dax3.png dax3.png dax10.png dax10.png
    #84549 quote
    Paul
    Participant
    Master

    Good results!

    You can optimise each timeframe to to smallest details. However I like to compare it with the same basic parameters.

    SL 1.0, PT 1.5 and MFE 0.35

    Also important. take 200k bars for the 3minute and set the same startdate to the 10 minute timeframe.

    Now you compare the same periode, with the same basic parameters.

    That’s means only the NOP is left. (number of points difference to dayopen at 9u)

    In testing it seemed that the NOP for long can be a bit lower then NOP for short. So you can split them and have better results.

    for 3 min. NOP long at 12, NOP short at 15 (i use 3 points incremental)

    for 10 min NOP long at 18, NOP short at 21 or 24

    GraHal thanked this post
    #84553 quote
    Inertia
    Participant
    Master

    Thank you Paul for your strategy.

    Probabiliste looks interesting. I was even close to go live but i left them on “incubation” for couple of trades. Will see.

    However, instead of Nop in pts, i replaced it by:

    // indicator settigns
    NOP= (close*0.0022)/pointsize

    It seems more adaptative (IMO).

    #84559 quote
    Paul
    Participant
    Master

    Thnx for your input.

    At the moment the code has an option to use a percentage.

    If Usepercentage Then
    Nopl=(Dayopen/100)*0.15
    Nops=(Dayopen/100)*0.15
    Else
    Nopl=27
    Nops=25
    Endif

    I changed that now so it uses also pointsize.

    If Usepercentage Then
    Nopl=((Dayopen*0.27)/100)/pointsize
    Nops=((Dayopen*0.25)/100)/pointsize
    Else
    Nopl=27
    Nops=25
    Endif
    #84560 quote
    Paul
    Participant
    Master

    Here’s an update of the code. If anyone find improvements or other markets plz post!

    Attached screenshot of 3 min bar 200k and same period for 10 minutes.

     

    //-------------------------------------------------------------------------
    // Main Code : Straddle Dayopen V2.0
    //-------------------------------------------------------------------------
    // Test On DAX 30 Cash 10 Minute Timeframe 200k bars or from 1/1/2015
    
    // Common Rules
    Defparam Cumulateorders = False
    Defparam Preloadbars = 1000
    
    // On/off
    Extratradecriteria   = 1 // I.e. Long; Only Enters When The Current Bar High Is Lower Then The Lowest Daily High From Today, Yesterday And Day Before.
    Usepercentage        = 0 // The Minimum Difference In Percentage [[1] From Dayopen Or In Points [0] From Dayopen
    Mfetrailing          = 1 // Mfe Trailing Stop
    Wtrailing            = 1 // Williams 3 Bar Trailing Stop
    Breakevenstop        = 1 // Breakevenstop, Move Stoploss When Position Is In Profit.
    Excludefirsttwoweeks = 1 // Exclude The First 2 Weeks Of Every Year (Weeknumber 1 And 2)
    
    // Settings
    Positionsize = 1
    SL    = 1.00 // % Stoploss
    PT    = 1.50 // % Profit Target
    MFETS = 0.35 // % Mfe Trailing Stop
    BES   = 0.35 // % Break Even Stop
    BESMP = 0.05 // % Break Even Stop Minimum Profit
    WTSMP = 0.50 // % Williams Trailing Stop Minimum Profit If Mfe Trailing Stop Is Not Used
    ETD   = 0    //   Exclude a Trade Day; Sunday = 0
    If Usepercentage Then
    Nopl=((Dayopen*0.15)/100)/pointsize
    Nops=((Dayopen*0.15)/100)/pointsize
    Else
    Nopl=24 //number of points long
    Nops=24 //number of points short
    Endif
    
    // Day & Time
    Once Entertime = 090000
    Once Lasttime  = 100000
    Once Closetime = 240000 // Greater Then 23.59 Means It Continues Position Overnight
    Once Closetimefr=173000
    
    If Excludefirsttwoweeks=1 Then
    If Year=2015 And Month=1 And (Day>=1 And Day<=18) Then
    Notrading = 1
    Elsif Year=2016 And Month=1 And (Day>=1 And Day<=24) Then
    Notrading = 1
    Elsif Year=2017 And Month=1 And (Day>=1 And Day<=22) Then
    Notrading = 1
    Elsif Year=2018 And Month=1 And (Day>=1 And Day<=21) Then
    Notrading = 1
    Elsif Year=2019 And Month=1 And (Day>=1 And Day<=20) Then
    Notrading = 1
    Else
    Notrading = 0
    Endif
    Endif
    
    Tt1 = Time >= Entertime
    Tt2 = Time <= Lasttime
    Tradetime = Tt1 And Tt2 and Notrading = 0 And Dayofweek <> ETD
    
    // Reset At Start
    If Intradaybarindex = 0 Then
    Longtradecounter = 0
    Shorttradecounter = 0
    Tradecounter = 0
    Mclong = 0
    Mcshort = 0
    Endif
    
    // [pc] Position Criteria
    Pclong  = Countoflongshares < 1 And Longtradecounter < 1 And Tradecounter < 1
    Pcshort = Countofshortshares < 1 And Shorttradecounter < 1 And Tradecounter < 1
    
    // [mc] Main Criteria
    If Time = Entertime Then
    Dayopen=open
    Endif
    
    If High > Dayopen+nopl Then
    Mclong=1
    Else
    Mclong=0
    Endif
    
    If Low < Dayopen-nops Then
    Mcshort=1
    Else
    Mcshort=0
    Endif
    
    // [ec] Extra Criteria
    If Extratradecriteria Then
    Min1 = Min(Dhigh(0),dhigh(1))
    Min2 = Min(Dhigh(1),dhigh(2))
    
    Max1 = Max(Dlow(0),dlow(1))
    Max2 = Max(Dlow(1),dlow(2))
    
    Eclong = High < Min(Min1,min2)
    Ecshort = Low > Max(Max1,max2)
    else
    Eclong=1
    Ecshort=1
    Endif
    
    // Long & Short Entry
    If Tradetime Then
    If Pclong and Mclong And Eclong Then
    Buy Positionsize Contract At Market
    Longtradecounter=longtradecounter + 1
    Tradecounter=tradecounter+1
    Endif
    If Pcshort and Mcshort And Ecshort Then
    Sellshort Positionsize Contract At Market
    Shorttradecounter=shorttradecounter + 1
    Tradecounter=tradecounter+1
    Endif
    Endif
    
    // Break Even Stop
    If Breakevenstop Then
    If Not Onmarket Then
    Newsl=0
    Endif
    If Longonmarket And close-tradeprice(1)>=((Tradeprice/100)*BES)*pipsize Then
    Newsl = Tradeprice(1)+((Tradeprice/100)*BESMP)*pipsize
    Endif
    If Shortonmarket And Tradeprice(1)-close>=((Tradeprice/100)*BES)*pipsize Then
    Newsl = Tradeprice(1)-((Tradeprice/100)*BESMP)*pipsize
    Endif
    If Newsl>0 Then
    Sell At Newsl Stop
    Exitshort At Newsl Stop
    Endif
    Endif
    
    // Exit Mfe Trailing Stop
    If Mfetrailing Then
    Trailingstop = (Tradeprice/100)*MFETS
    If Not Onmarket Then
    Maxprice = 0
    Minprice = Close
    Priceexit = 0
    Endif
    If Longonmarket Then
    Maxprice = Max(Maxprice,close)
    If Maxprice-tradeprice(1)>=trailingstop*pipsize Then
    Priceexit = Maxprice-trailingstop*pipsize
    Endif
    Endif
    If Shortonmarket Then
    Minprice = Min(Minprice,close)
    If Tradeprice(1)-minprice>=trailingstop*pipsize Then
    Priceexit = Minprice+trailingstop*pipsize
    Endif
    Endif
    If Onmarket And Wtrailing=0 And Priceexit>0 Then
    Sell At Market
    Exitshort At Market
    Endif
    Endif
    
    // Exit Williams Trailing Stop
    If Wtrailing Then
    Count=1
    I=0
    J=i+1
    Tot=0
    While Count<4 Do
    Tot=tot+1
    If (Low[j]>=low[i]) And (High[j]<=high[i]) Then
    J=j+1
    Else
    Count=count+1
    I=i+1
    J=i+1
    Endif
    Wend
    
    Basso=lowest[tot](Low)
    Alto=highest[tot](High)
    
    If Close>alto[1] Then
    Ref=basso
    Endif
    If Close<basso[1] Then
    Ref=alto
    Endif
    
    If Onmarket And Mfetrailing=0 And Positionperf>WTSMP Then
    If Low[1]>ref And High<ref Then
    Sell At Market
    Endif
    If High[1]<ref And Low>ref Then
    Exitshort At Market
    Endif
    Endif
    
    If Onmarket And Mfetrailing=1 And Priceexit>0 Then
    If High<ref Then
    Sell At Market
    Endif
    If Low>ref Then
    Exitshort At Market
    Endif
    Endif
    Endif
    
    // Exit At Closetime
    If Onmarket Then
    If Time >= Closetime Then
    Sell At Market
    Exitshort At Market
    Endif
    Endif
    
    // Exit At Closetime Friday
    If Onmarket Then
    If (Currentdayofweek=5 And Time>=closetimefr) Then
    Sell At Market
    Exitshort At Market
    Endif
    Endif
    
    // Build-in Exit
    Set Stop %loss SL
    Set Target %profit PT
    
    //graph 0 Coloured(300,0,0) As "Zeroline"
    //graph (Positionperf*100)coloured(0,0,0,255) As "Positionperformance"
    
    GraHal, Inertia and pippo999 thanked this post
    Screenshot-2018-11-10-at-23.07.05-min.jpg Screenshot-2018-11-10-at-23.07.05-min.jpg
    #84575 quote
    volpiemanuele
    Participant
    Veteran

    @paul

    Hello, in the end we arrived at the same result. After the post I made the comparisons on 200k starting from the same period for 3 minutes and 0 minutes.
    Also I thought of dividing Nops between long and short. The results between 3 minutes and 10 minutes are similar. In your opinion, therefore, is it useful to use time frames 3 minutes or 10 minutes? Thanks

    #84583 quote
    pippo999
    Participant
    Junior

    @Paul, thanks a lot for sharing.

    Do you use the mentioned code in a real account ?

    #84584 quote
    pippo999
    Participant
    Junior

    What is the capital minimum required for this strategy ?

    #84585 quote
    ullle73
    Participant
    Senior

    what would be the easiest way to spot an entry manually? Could someone write in simple english the entry rules? Dont understand all the coding…

    #84586 quote
    Paul
    Participant
    Master

    @pippo999, yeah real account. 1 contract minimum is about €600 (dax 30 1€), but to cover initial losses you should’ve €1200 capital to be comfortable.


    @volpiemanuele
    . Both are good and tradable. If you look at the profits, I would say they complement each other.

    pippo999 thanked this post
    #84587 quote
    Paul
    Participant
    Master

    Sorry can’t help you Jonas, I tried. But maybe someone else can!

    #84632 quote
    ullle73
    Participant
    Senior

    Sorry can’t help you Jonas, I tried. But maybe someone else can!

    where did you try? have not seen a reply to my comment?

Viewing 15 posts - 16 through 30 (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...