DI TEMA Trendfollowing strategy (on DAX 5 min)
Forums › ProRealTime English forum › ProOrder support › DI TEMA Trendfollowing strategy (on DAX 5 min)
- This topic has 18 replies, 2 voices, and was last updated 2 years ago by nonetheless.
-
-
06/15/2019 at 11:12 PM #10077406/16/2019 at 11:04 AM #10078906/16/2019 at 11:34 AM #100791
You can find it in the library.
06/16/2019 at 12:26 PM #10079306/16/2019 at 12:36 PM #10079607/29/2019 at 10:28 PM #10373908/22/2019 at 1:52 PM #10529509/05/2019 at 5:54 PM #106633I´m using this now with real $ and its working good i use the 30 min chart with settings.
12345678910111213DEFPARAM CumulateOrders = false // Cumulating positions deactivated//VARIABLESonce SLperc = 105 // Stoploss percentage 105/10000 * Close (150)once TrailSLPerc = 60 // Trailng Stoploss percentage 85/10000 * Close 60once Tema2 = 10 // Tema setting for opening long/short positions 10once DI2 = 7 //DI setting for opening long/short positions 7once Duration = 12 // number of bars in trade before reducing the trailing stop 12once Factor = 7/10//factor to reduce trailing stoploss after some time in the tradeonce StartE = 74500 //start time for opening positionsonce StartL = 103000 //ending time for opening positions (only trading in the morning)once N = 1 // initieel aantal contractenOTD = Barindex - TradeIndex(2) > IntradayBarIndex // limits the (opening) trades till 1 per day09/05/2019 at 7:11 PM #106639kalleklovn – please use the ‘Insert PRT Code’ button to embed code when posting as it makes it much easier for every one to read. I have tidied up your post for you. 🙂
1 user thanked author for this post.
09/05/2019 at 7:30 PM #106642Thanks i´m still new and never really been active on any forums 🙂
09/05/2019 at 9:01 PM #106645@kalleklovn thank you for sharing your settings.
Your share prompted me to look at the 5 min version and I can see that it dropped off in performance after publishing in the library (as so many Systems do).
As seen from attached the drop off just needs a bit of re-opti to get back on track. I found the variables very very responsive!
I’ll try and remember to check the settings regularly! 🙂
Thank you @Jan Wind for sharing this Strategy with us all.
EDIT / PS
The .itf should state DAX (not DJI) … one eye on the TV again, sorry! 🙂
10/10/2019 at 12:08 AM #109771Hello GraHal
“As seen from attached the drop off just needs a bit of re-opti to get back on track. I found the variables very very responsive!
I’ll try and remember to check the settings regularly! 🙂 ”
Do you have any guidelines of re optimizing your auto trading model ? Do you do it every week, and than for 1 year of history for instance ? Or how do you do this ? Re-optimizing implicitly means that you are assuming that the last data gives the best change of predicting future movements. Then a very important question is what is “the best” set of data ?
Kind regards, Jan Wind
10/10/2019 at 7:07 AM #109775A new strategy for Jan Wind !
Works on EUR/USD 15 minutes timeframe.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106DEFPARAM CumulateOrders = TrueDEFPARAM PRELOADBARS = 10000daysForbiddenEntry = OpenDayOfWeek = 6 OR OpenDayOfWeek = 0Horaire = time >= 000000 and time <= 200000CloturePartielle = 1// 1 = ON, 0 = OFFPositionsizeA = 1PositionsizeV = 1MAXSHARES = abs(COUNTOFPOSITION) <= 19IF CloturePartielle THENPositionsizeA = 4PositionsizeV = 3ENDIFMM = Average[56,3](totalprice)Newhighest = max(DHigh(0),DHigh(1))Newlowest = min(DLow(0),DLow(1))Milieu = (Newhighest+Newlowest)/2Surachat = average[10,4]((Newhighest+Milieu)/2)Survente = average[10,4]((Newlowest+Milieu)/2)CA = (MM > Surachat) and (close crosses over Milieu)CV = (MM < Survente) and (close crosses under Milieu)// Long EntriesIF Horaire AND CA AND MAXSHARES AND not daysForbiddenEntry AND NOT SHORTONMARKET THENBUY PositionsizeA CONTRACTS AT MARKETENDIFIF CloturePartielle THENIF LONGONMARKET AND COUNTOFLONGSHARES <= 16 THENSELL 1 CONTRACTS AT TRADEPRICE + 40*pointsize LIMITENDIFIF LONGONMARKET AND COUNTOFLONGSHARES <= 4 THENSELL 1 CONTRACTS AT TRADEPRICE + 20*pointsize LIMITENDIFIF LONGONMARKET AND COUNTOFLONGSHARES <= 6 THENSELL 1 CONTRACTS AT TRADEPRICE + 18*pointsize LIMITENDIFENDIFIF LONGONMARKET AND summation[35](close < close[6]) = 35 THENSELL AT MARKETENDIF// Short EntriesIF Horaire AND CV AND MAXSHARES AND not daysForbiddenEntry AND NOT LONGONMARKET THENSELLSHORT PositionsizeV CONTRACTS AT MARKETENDIFIF CloturePartielle THENIF SHORTONMARKET AND COUNTOFSHORTSHARES <= 20 THENEXITSHORT 1 CONTRACTS AT TRADEPRICE - 78*pointsize LIMITENDIFIF SHORTONMARKET AND COUNTOFLONGSHARES <= 1 THENEXITSHORT 1 CONTRACTS AT TRADEPRICE - 40*pointsize LIMITENDIFENDIFIF SHORTONMARKET AND summation[32](close > close[6]) = 32 THENEXITSHORT AT MARKETENDIF//MFE//trailing stoptrailingstop = 33//resetting variables when no trades are on marketif not onmarket thenMAXPRICE = 0MINPRICE = closepriceexit = 0endif//case SHORT orderif shortonmarket thenMINPRICE = MIN(MINPRICE,close) //saving the MFE of the current tradeif tradeprice(1)-MINPRICE>=trailingstop*pointsize then //if the MFE is higher than the trailingstop thenpriceexit = MINPRICE+trailingstop*pointsize //set the exit price at the MFE + trailing stop price levelendifendif//case LONG orderif longonmarket thenMAXPRICE = MAX(MAXPRICE,close) //saving the MFE of the current tradeif MAXPRICE-tradeprice(1)>=trailingstop*pointsize then //if the MFE is higher than the trailingstop thenpriceexit = MAXPRICE-trailingstop*pointsize //set the exit price at the MFE - trailing stop price levelendifendif//exit on trailing stop price levelsif onmarket and priceexit>0 thenEXITSHORT AT priceexit STOPSELL AT priceexit STOPendif//SET TARGET pPROFIT 46SET STOP pLOSS 2001 user thanked author for this post.
10/10/2019 at 3:51 PM #109831Thank you for your excellent work @Matriciel, but as it is a different strategy than this Topic (DI TEMA) would it not be better posted as a separate topic then the Community can easier discuss / comment / improve your strategy?
Not that it needs much improving! 🙂
I reduced to 1 Lot for easier comparison to other Systems, but we can’t do Fwd Test anyway with a strategy that Sells / ExitShort on partial Lot size (as your code does)… it has to be for example Sell at ….
I have enabled tick by tick mode! 🙂
10/10/2019 at 9:20 PM #109880 -
AuthorPosts
Find exclusive trading pro-tools on