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.
-
-
11/21/2018 at 11:50 PM #8544711/22/2018 at 4:07 PM #8549512/02/2018 at 10:43 AM #86172
buongiorno paolo volevo mostrarti alcune modifiche sul tuo lavoro , io sono neofita ho appena iniziato a capirci qualcosa ,
quindi mi scuserai se mostro cavolate , ho fatto anche il djons a 10 minuti e funziona bene , i dati che ti mostro sono non più di un anno ma li ho testi anche sui 2 anni e funzionano bene .
ho escluso il Trailing stop da tutti perché funziona meglio e da risultati migliori .
domani inizio a metterli sul reale con piccola size , cosa ne pensi ?
grazie ancora x il lavoro che hai svolto
eugenio
12/02/2018 at 10:53 AM #8617712/02/2018 at 11:03 AM #8617912/02/2018 at 11:20 AM #86180sul forum inglese scrivi in inglese. Grazie.
12/02/2018 at 11:35 AM #86182I apologize again in English
hello paolo I wanted to show you some changes on your work, I’m neophyte I just started to understand something,
so you will excuse me if I show stupid things, I have also done the djons 10 minutes and it works well, the data I show you are not more than a year but I have them even on 2 years and they work well.
I have excluded the Trailing stop from everyone because it works better and results better.
Tomorrow I start to put them on the real with a small size, what do you think?
I made all the accounts and the yield of the months of 2018 and I noticed that the month of August is not to be traded,
I excluded January that does not make
thanks again for the work you have done
clearly I would like an opinion from everyone,eugenio
12/02/2018 at 12:05 PM #86187Hi,
can you share the strategy version for SP500 ?
@eugenio: It could be a solution, but I preferred to do an optimization to keep high percentage of positive trade minimizing the DD. So I kept the trailing.thanks
12/02/2018 at 12:08 PM #86188123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226//-------------------------------------------------------------------------// Main code : Open SP500 3 minuti NY//------------------------------------------------------------------------// Common RulesDefparam Cumulateorders = FalseDefparam Preloadbars = 1000// On/offExtratradecriteria = 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 DayopenMfetrailing = 1 // Mfe Trailing StopWtrailing = 1 // Williams 3 Bar Trailing StopBreakevenstop = 1 // Breakevenstop, Move Stoploss When Position Is In Profit.Excludefirsttwoweeks = 1 // Exclude The First 2 Weeks Of Every Year (Weeknumber 1 And 2)// SettingsPositionsize = 10SL = 0.5 // % StoplossPT = 1.30 // % Profit TargetMFETS = 2// % Mfe Trailing StopBES = 2 // % Break Even StopBESMP = 2 // % Break Even Stop Minimum ProfitWTSMP = 2 // % Williams Trailing Stop Minimum Profit If Mfe Trailing Stop Is Not UsedETD = 0 // Exclude a Trade Day; Sunday = 0If Usepercentage ThenNopl=((Dayopen*0.15)/100)/pointsizeNops=((Dayopen*0.15)/100)/pointsizeElseNopl=4 //number of points longNops=5//number of points shortEndif// Day & TimeOnce Entertime = 153000Once Lasttime = 160000Once Closetime = 240000 // Greater Then 23.59 Means It Continues Position OvernightOnce Closetimefr=220000If Excludefirsttwoweeks=1 ThenIf Year=2015 And Month=1 And (Day>=1 And Day<=18) ThenNotrading = 1Elsif Year=2016 And Month=1 And (Day>=1 And Day<=24) ThenNotrading = 1Elsif Year=2017 And Month=1 And (Day>=1 And Day<=22) ThenNotrading = 1Elsif Year=2018 And Month=1 And (Day>=1 And Day<=21) ThenNotrading = 1Elsif Year=2019 And Month=1 And (Day>=1 And Day<=20) ThenNotrading = 1ElseNotrading = 0EndifEndifTt1 = Time >= EntertimeTt2 = Time <= LasttimeTradetime = Tt1 And Tt2 and Notrading = 0 And Dayofweek <> ETD// Reset At StartIf Intradaybarindex = 0 ThenLongtradecounter = 0Shorttradecounter = 0Tradecounter = 0Mclong = 0Mcshort = 0Endif// [pc] Position CriteriaPclong = Countoflongshares < 1 And Longtradecounter < 1 And Tradecounter < 1Pcshort = Countofshortshares < 1 And Shorttradecounter < 1 And Tradecounter < 1// [mc] Main CriteriaIf Time = Entertime ThenDayopen=openEndifIf High > Dayopen+nopl ThenMclong=1ElseMclong=0EndifIf Low < Dayopen-nops ThenMcshort=1ElseMcshort=0Endif// [ec] Extra CriteriaIf Extratradecriteria ThenMin1 = 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)elseEclong=1Ecshort=1Endif// Long & Short EntryIf Tradetime ThenIf Pclong and Mclong And Eclong ThenBuy Positionsize Contract At MarketLongtradecounter=longtradecounter + 1Tradecounter=tradecounter+1EndifIf Pcshort and Mcshort And Ecshort ThenSellshort Positionsize Contract At MarketShorttradecounter=shorttradecounter + 1Tradecounter=tradecounter+1EndifEndif// Break Even StopIf Breakevenstop ThenIf Not Onmarket ThenNewsl=0EndifIf Longonmarket And close-tradeprice(1)>=((Tradeprice/100)*BES)*pipsize ThenNewsl = Tradeprice(1)+((Tradeprice/100)*BESMP)*pipsizeEndifIf Shortonmarket And Tradeprice(1)-close>=((Tradeprice/100)*BES)*pipsize ThenNewsl = Tradeprice(1)-((Tradeprice/100)*BESMP)*pipsizeEndifIf Newsl>0 ThenSell At Newsl StopExitshort At Newsl StopEndifEndif// Exit Mfe Trailing StopIf Mfetrailing ThenTrailingstop = (Tradeprice/100)*MFETSIf Not Onmarket ThenMaxprice = 0Minprice = ClosePriceexit = 0EndifIf Longonmarket ThenMaxprice = Max(Maxprice,close)If Maxprice-tradeprice(1)>=trailingstop*pipsize ThenPriceexit = Maxprice-trailingstop*pipsizeEndifEndifIf Shortonmarket ThenMinprice = Min(Minprice,close)If Tradeprice(1)-minprice>=trailingstop*pipsize ThenPriceexit = Minprice+trailingstop*pipsizeEndifEndifIf Onmarket And Wtrailing=0 And Priceexit>0 ThenSell At MarketExitshort At MarketEndifEndif// Exit Williams Trailing StopIf Wtrailing ThenCount=1I=0J=i+1Tot=0While Count<4 DoTot=tot+1If (Low[j]>=low[i]) And (High[j]<=high[i]) ThenJ=j+1ElseCount=count+1I=i+1J=i+1EndifWendBasso=lowest[tot](Low)Alto=highest[tot](High)If Close>alto[1] ThenRef=bassoEndifIf Close<basso[1] ThenRef=altoEndifIf Onmarket And Mfetrailing=0 And Positionperf>WTSMP ThenIf Low[1]>ref And High<ref ThenSell At MarketEndifIf High[1]<ref And Low>ref ThenExitshort At MarketEndifEndifIf Onmarket And Mfetrailing=1 And Priceexit>0 ThenIf High<ref ThenSell At MarketEndifIf Low>ref ThenExitshort At MarketEndifEndifEndif// Exit At ClosetimeIf Onmarket ThenIf Time >= Closetime ThenSell At MarketExitshort At MarketEndifEndif// Exit At Closetime FridayIf Onmarket ThenIf (Currentdayofweek=5 And Time>=closetimefr) ThenSell At MarketExitshort At MarketEndifEndif// Build-in ExitSet Stop %loss SLSet Target %profit PT12/02/2018 at 1:52 PM #86193eugenio – Please use the ‘Insert PRT Code’ button when putting code in your posts as it makes it far easier for others to read. I have tidied up your post for you. 🙂
Attaching an exported ITF file can also be a useful alternative when the code is quite large.
12/02/2018 at 2:32 PM #8619712/02/2018 at 3:20 PM #86198Thanks for posting!
I like to keep the mfe trailing stop and the breakeven.
It may look that the total results are better with trailing stop disabled, but are you ready to see a gain nearing a profit target go back to your stoploss level?
A SL too small may get you out quickly.
a correction in the code
12// Long & Short EntryIf not onmarket and Tradetime Then12/02/2018 at 4:21 PM #86200true what you say Paul, but the results speak clearly, the trailing too many times affect the overall gain, if I know, as from the test that the total and greater gain I prefer lose,
clearly this consideration is very personal, so I fully share your expression, you did well to put the trailing stop, then it’s up to everyone to do what they think.
however, the fact remains that your work is fantastic.
Have you already used it in real?
I start tomorrow
Thanks again
eugenio12/02/2018 at 4:38 PM #8620112/02/2018 at 5:15 PM #86205Yes, i’am running it live and the results are similar to the backtest!
A trailing stop, especially the small one, can get you out quickly.
If you prefer to disable the trailing stop, you can still use the breakeven.
i.e. when a position is in profit for 0.35% it moves the breakeven stop from -1.00 to -.0.50%
At a quick glance, it improves the results.
edit; tested the sp500 3min
-
AuthorPosts
Find exclusive trading pro-tools on