Strategy DayOpen Straddle for DAX
Forums › ProRealTime English forum › ProOrder support › Strategy DayOpen Straddle for DAX
- This topic has 241 replies, 39 voices, and was last updated 3 years ago by Monobrow.
-
-
07/06/2019 at 11:25 PM #10206207/07/2019 at 12:10 AM #102063
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”.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263if tradetime thenif time = entertime thendayopen=openendifdonopl=dayopen+nopldonops=dayopen-nopsif high > donopl and c10 thenmclong=1elsemclong=0endifif low < donops and c10 thenmcshort=1elsemcshort=0endifendif// [ec] extra criteriaif extratradecriteria theneclong = high < dhigh(1)ecshort = low > dlow(1)elseeclong=1ecshort=1endif// long & short entryif not onmarket and tradetime thenif pclong and mclong and eclong thenif ordertype=1 thenbuy positionsize contract at marketlongtradecounter=longtradecounter + 1tradecounter=tradecounter+1elsif ordertype=2 thenbuy positionsize contract at donopl stoplongtradecounter=longtradecounter + 1tradecounter=tradecounter+1elsif ordertype=3 thenbuy positionsize contract at donopl limitlongtradecounter=longtradecounter + 1tradecounter=tradecounter+1endifendifif pcshort and mcshort and ecshort thenif ordertype=1 thensellshort positionsize contract at marketshorttradecounter=shorttradecounter + 1tradecounter=tradecounter+1elsif ordertype=2 thensellshort positionsize contract at donops stopshorttradecounter=shorttradecounter + 1tradecounter=tradecounter+1elsif ordertype=3 thensellshort positionsize contract at donops limitshorttradecounter=shorttradecounter + 1tradecounter=tradecounter+1endifendifendif1 user thanked author for this post.
07/07/2019 at 12:22 AM #10206407/07/2019 at 11:24 PM #10210507/07/2019 at 11:25 PM #10210607/08/2019 at 4:18 AM #102109sure, it’s about the same concept as in the other strategy.
normally I use 1% stoploss, but 0.5% worked too.
goodluck
123456789101112131415161718192021bu=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)) thenflag=0endifif pp>=0.35 and (open>bu or open<bd) thenflag=1endifif 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]) thensell at marketendifif 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]) thenexitshort at marketendif1 user thanked author for this post.
07/08/2019 at 8:47 AM #10212407/08/2019 at 11:08 AM #102151Hi 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.
07/08/2019 at 11:47 AM #10215807/08/2019 at 3:03 PM #10217207/08/2019 at 3:37 PM #102175@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…
07/09/2019 at 12:11 PM #102258I 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.
1 user thanked author for this post.
07/09/2019 at 1:35 PM #102269v3
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.
07/09/2019 at 4:28 PM #102283I 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!07/09/2019 at 4:38 PM #102286v3
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?
-
AuthorPosts
Find exclusive trading pro-tools on