Automatic trading system DAX 1H mini 1€
Forums › ProRealTime English forum › ProOrder support › Automatic trading system DAX 1H mini 1€
- This topic has 113 replies, 12 voices, and was last updated 6 years ago by
JohnScher.
-
-
02/15/2017 at 10:09 AM #25128123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119DEFPARAM CumulateOrders = trueonce ordersize=1// ConditionsMA1 = Average [2]MA2 = Average [13]MA3 = Average [11]MA4 = Average [4]c1 = Ma1>MA2c122 = Ma3>MA4t1 = time >= 090000t2 = time = 180000d1 = dayofweek = 2d2 = dayofweek = 4if strategyprofit<=20000 thena=1endifif strategyprofit>20000 and strategyprofit<=40000 thena=2endifif strategyprofit>50000 thena=3endifif strategyprofit<=20000 thenif ordersize>16 thenordersize=16endifendifif strategyprofit>20000 and strategyprofit<=50000 thenif ordersize>32 thenordersize=32endifendifif strategyprofit>50000 thenif ordersize>64 thenordersize=64endifendif// buyindicator13 = MACD[12,26,9](close)c13 = (indicator13 < 30)indicator11 = ExponentialAverage[20](close)c11 = (close >= indicator11)indicator1 = MACDline[12,26,9](close)indicator2 = ExponentialAverage[12](indicator1)c12 = (indicator1 > indicator2)//sellindicator1111 = ExponentialAverage[20](close)c1111 = (close <= indicator1111)indicator111 = MACDline[12,26,9](close)indicator2111 = ExponentialAverage[9](indicator111)c1211 = (indicator111 < indicator2111)if not onmarket thenIf d1 And t1 and c1 and c11 and c12 and c13 THENIF PositionPerf(1) < 0 THENOrderSize = OrderSize*2if ordersize<1 thenordersize=1ENDIFELSIF PositionPerf(1) > 0 THENOrderSize = aif ordersize<1 thenordersize=1ENDIFendifbuy ordersize Contract At MarketEndifIf d1 And t1 and c122 and c1111 and c1211 THENIF PositionPerf(1) < 0 THENOrderSize = OrderSize*2if ordersize<1 thenordersize=1ENDIFELSIF PositionPerf(1) > 0 THENOrderSize = aif ordersize<1 thenordersize=1ENDIFendifsellshort ordersize Contract At MarketEndifendifIf d2 and t2 thenexitshort at marketendifSet Stop Ploss 50 // from TradeSet Target PProfit 60 // 50 <<<<<<<<<<<<<<02/15/2017 at 10:32 AM #25129
A way to know, within the zero bars, to really know which ones need the tick per tick is optimizing a variable. In the summary list, set how many times you need to tick by tick. Since all the zero bars do not have to be undefined, you may simply touch the take or the stop. In this robot, it would only take 4 ticks per tick
02/15/2017 at 5:28 PM #25161Results attached. It’s good but I don’t think it’s any better than our best ones so far. Draw is 27% and there are too many “dips”. Plus max loss and consecutive losses are not as good. We could use this as a “second stage” system after the lower risk one maybe. What variables have you optimised ?
Also, sorry, I couldn’t quite understand your comment about the zero bars, could you explain a bit further, thanks
02/15/2017 at 6:27 PM #25185The truth that this last year has been very good for this strategy, this week and during the weekend will try to optimize sales operations, but if it is not productive, it is best to limit to buying operations. As far as the ceilings, as I can show you an example
02/15/2017 at 11:24 PM #25231This is an example of zero bar that would not need tick by tick. In the list of backtest would appear like duration or bars, but would not be an indefinite result. Do not touch take and stop within the same bar. When performing the optimization of variables, it appears that this robot, in 4 years and a half, would only need 4 times to tick by tick. Only 4 times in this period, the price touches take and stop in the same bar.
02/15/2017 at 11:47 PM #2523412345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697DEFPARAM CumulateOrders = trueonce ordersize=1// ConditionsMA1 = Average [2]MA2 = Average [13]MA3 = Average [11]MA4 = Average [4]c1 = Ma1>MA2c122 = Ma3>MA4t1 = time >= 090000t2 = time = 180000d1 = dayofweek = 2d2 = dayofweek = 4capital=strategyprofit+3000a=capital/3000if a<1 thena=1endifif a>10 thena=10endif// buyindicator13 = MACD[12,26,9](close)c13 = (indicator13 < 30)indicator11 = ExponentialAverage[20](close)c11 = (close >= indicator11)indicator1 = MACDline[12,26,9](close)indicator2 = ExponentialAverage[12](indicator1)c12 = (indicator1 > indicator2)//sellindicator1111 = ExponentialAverage[20](close)c1111 = (close <= indicator1111)indicator111 = MACDline[12,26,9](close)indicator2111 = ExponentialAverage[9](indicator111)c1211 = (indicator111 < indicator2111)if not onmarket thenIf d1 And t1 and c1 and c11 and c12 and c13 THENIF PositionPerf(1) < 0 THENOrderSize = OrderSize+aif ordersize<1 thenordersize=1ENDIFELSIF PositionPerf(1) > 0 THENOrderSize = aif ordersize<1 thenordersize=1ENDIFendifbuy ordersize Contract At MarketEndifIf d1 And t1 and c122 and c1111 and c1211 THENIF PositionPerf(1) < 0 THENOrderSize = OrderSize+aif ordersize<1 thenordersize=1ENDIFELSIF PositionPerf(1) > 0 THENOrderSize = aif ordersize<1 thenordersize=1ENDIFendifsellshort ordersize Contract At MarketEndifendifIf d2 and t2 thenexitshort at marketendifSet Stop Ploss 50 // from TradeSet Target PProfit 50 // from Trade1 user thanked author for this post.
02/15/2017 at 11:47 PM #2523512345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697DEFPARAM CumulateOrders = trueonce ordersize=1// ConditionsMA1 = Average [2]MA2 = Average [13]MA3 = Average [11]MA4 = Average [4]c1 = Ma1>MA2c122 = Ma3>MA4t1 = time >= 090000t2 = time = 180000d1 = dayofweek = 2d2 = dayofweek = 4capital=strategyprofit+3000a=capital/3000if a<1 thena=1endifif a>10 thena=10endif// buyindicator13 = MACD[12,26,9](close)c13 = (indicator13 < 30)indicator11 = ExponentialAverage[20](close)c11 = (close >= indicator11)indicator1 = MACDline[12,26,9](close)indicator2 = ExponentialAverage[12](indicator1)c12 = (indicator1 > indicator2)//sellindicator1111 = ExponentialAverage[20](close)c1111 = (close <= indicator1111)indicator111 = MACDline[12,26,9](close)indicator2111 = ExponentialAverage[9](indicator111)c1211 = (indicator111 < indicator2111)if not onmarket thenIf d1 And t1 and c1 and c11 and c12 and c13 THENIF PositionPerf(1) < 0 THENOrderSize = OrderSize+1if ordersize<1 thenordersize=1ENDIFELSIF PositionPerf(1) > 0 THENOrderSize = aif ordersize<1 thenordersize=1ENDIFendifbuy ordersize Contract At MarketEndifIf d1 And t1 and c122 and c1111 and c1211 THENIF PositionPerf(1) < 0 THENOrderSize = OrderSize+1if ordersize<1 thenordersize=1ENDIFELSIF PositionPerf(1) > 0 THENOrderSize = aif ordersize<1 thenordersize=1ENDIFendifsellshort ordersize Contract At MarketEndifendifIf d2 and t2 thenexitshort at marketendifSet Stop Ploss 50 // from TradeSet Target PProfit 50 // from Trade02/16/2017 at 9:28 AM #25253MA1 to MA4 moving average periods are over optimized IMO. If you want to filter trend without optimization over the past data, you should try to use adaptive periods moving average, there are plenty of them in the code library. I don’t say it will be better, but you should give it a try! Remember that “the best is the enemy of the good” 🙂
02/16/2017 at 2:42 PM #25291Hi all. Question in relation to this and any other strategy which uses
1DEFPARAM CumulateOrders = trueIs it possible to limit the number of “cycles” orders can be accumulated in a 24hr period? I’m thinking about minimising the risk of allowing orders to continuously accumulate, for example in the instance of a natural disaster or terrorist attack. It would be especially useful on strategies which are left to run overnight.
Can anyone help with the coding?
Thanks
02/16/2017 at 11:31 PM #2535202/17/2017 at 8:42 AM #25356Hi Raul. I already have fuses in my strategies. What I’m interested in is additionally limiting the amount of trades in a day whilst still being able to accumulate orders. For example, if a strategy on average returns 3 trades a day, ideally I would want to limit number of trades in 1 day to let’s say 10 trades. If it was to trade 10 times in a day (or more) it could be due to a macro event or worse and I would want to not trade. If you have wide stops (which occasionally I do) it is possible to accumulate orders without getting stopped out or the fuse(s) being triggered and then potentially getting a big loss at the end of the trading period when all positions are closed.
02/17/2017 at 8:52 AM #25357An alternative could be to have a fuse which works out your loss midway during a trade(s) instead of when the position(s) is closed. It can then stop the strategy if the daily loss is greater than x no matter how many trades are open. Is this possible? I’ve only seen fuses which calculate once a trade is closed.
02/17/2017 at 8:50 PM #25460Results as below (system 7) – I have include the system 3 performance for overall comparison and also adjusted a version of System 3 incorporating your code for the short side (System 3 Long + short). Overall the draw of 7 is acceptable at 15% but the profit curve is not ideal as I think it’s too steep to be realistic. Adding the short code to system 3 produces better long terms results but the draw of 50% is too big.
Looking at the stats, it seems like the short side is not as profitable, maybe it might be worth seeing if different sl/tp levels for shorts produces better results. Also I agree with Nicolas above, we do want to be careful not to overoptimise the variables.
1 user thanked author for this post.
02/17/2017 at 9:57 PM #2546602/18/2017 at 1:13 PM #25492Thank you very much manel. I think the best is still system 3. but I still fear the martingale, although this limited. A serious loss would be great. I have a couple more robots on the dax, taken from this same page that you would like to try 200000 bars. If you took the steps would you do the screenshots? Thank you!
-
AuthorPosts
Find exclusive trading pro-tools on