I created this trading system following the VTAD-rules as follows:
- Close on Monday at 17.30h (regular trading hours DAX) has to be below its daily 34-SMA
- If so, then buy one contract on Monday at 17.45h
- Exit the position on Wednesday at 09.00h
VTAD (Vereinigung Technischer Analysten Deutschland) works without SL or TP. However I decided against this rule and optimized the code on SL- and TP-variables.
I noticed one problem with this code:
VTAD uses daily candles based on regular trading hours 09.00h – 17.30h. My Broker IG Markets offers 24h-DAX-Trading and daily candles are 24h-candles. When exactly they start a candle and close it I don’t know for sure. But I think it is at midnight (GMT?) when a new candle is opened.
Of course I could have adjusted my trading hours in the options-menu of the ProRealTime-Trading-Software. But this would affect all my existing trading systems!
Best solution would be if PRT’s Timeframe-command would offer an option about when to open and close candles!
Works on 5m-TF too, but you have to optimize PCTgSL (Stopp Loss in %) and PCTtp (Take Profit in %)-Variables!
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
//------------------------------------------------------------------------- // Hauptcode : !PK_TurnarTUE_VTAD_DAX15mV1g //------------------------------------------------------------------------- // ********************************************************************** // * !PK_TurnarTUE_VTAD_DAX15mV1g * // ********************************************************************** // Remember to check your time zone and adjust variables c2 and exit2 respectively! // Time zone for this Trading System is Germany! // ---------------------------------------------------------------------- // TRADING-SYSTEM PARAMETERS // ---------------------------------------------------------------------- DEFPARAM Preloadbars = 200 DEFPARAM CumulateOrders = False Positionsize = 1 // ---------------------------------------------------------------------- // CONDITIONS TO ENTER LONG-POSITION // ---------------------------------------------------------------------- c1 = DayOfWeek=1 // Day of Week = Montag c2 = time=174500 // Buy on Monday at 17.45h Local Time Frankfurt TIMEFRAME(daily) // Switch to daily chart candles c3 = close<average[34](close) // Close on Monday is below 34-Tg-SMA (daily-TF) TIMEFRAME(default) // Switch back to default TF (5m or 15m) IF c1 AND c2 AND c3 THEN BUY Positionsize SHARES AT MARKET ENDIF // ---------------------------------------------------------------------- // CONDITIONS TO EXIT LONG-POSITION // ---------------------------------------------------------------------- exit1 = DayOfWeek = 3 // Exit on Wednesday at 09.00h exit2 = time=090000 If LongOnMarket AND exit1 AND exit2 THEN sell at market ENDIF // --------------------------------------------------------------------- // STOP LOSS AND PROFIT TARGETS // --------------------------------------------------------------------- // VTAG-Strategy works without SL and TP!! // However, I decided against this rule and optimized the trading system on SL and TP PCTgSL = 2.6 set stop %loss PCTgSL PCTtp = 2.3 set target %Profit PCTtp |
Share this
No information on this site is investment advice or a solicitation to buy or sell any financial instrument. Past performance is not indicative of future results. Trading may expose you to risk of loss greater than your deposits and is only suitable for experienced investors who have sufficient financial means to bear such risk.
ProRealTime ITF files and other attachments :PRC is also on YouTube, subscribe to our channel for exclusive content and tutorials
Interesting idea and with a lot of room for improvement…. maybe a trailing stop? Thanks for sharing
Unglaubich das dieser Strategie Gewinne generiert ! Es erschient leider nicht so gleichmaßig wann man es für die letzten 100.000 bars benutzt (Prüfung per 30.09.2019).
I recognized a possible problem with the timeframe / Defparam variables. As far as I know, the timeframe comand uses the 15m candles to create the daily candles. So, in case your broker offers 24/7 DAX trading this would result in a total of two daily candles only once you start the robot. Calculation: Defparam Preloadbars = 200 –> 200 15m candles will be preloaded, there will be 200/24/4 = 2,08 days of daily candles available for all daily candles calculations. Unfortunately the strategy requires the 34d-moving-average as an indicator. As a result of which, the robot will be running for several weeks without being able to check on the 34d-SMA criteria properly. To be safe, I recommend adjusting the Defparam preloadbars variable settings from 200 to 34*24*4 = 3.264 candles (15m-chart) or 34*24*12 = 9.792 (5m-charts), respectively.
I am not absolutely sure about that. Can anybody confirm? Is there a difference among the PRT Versions v10.3 and v11?
Hello Peter, it is long time i have been watching this strategy, very good and interesting ! and i still didn’t understand why it is working in this day….
Was there any recent improvement or variant of the strategy?
I indeed do have different modified strategies in the market. In the past my variants performed even better than the code I shared. But since the robot is not trading that often, I do not see these profits guaranteed. Just play around with different SL/TP algos to find even better solutions in backtesting. Personally I prefer to mix theses strategies, hoping that if one strategy fails any other will still be profitable in some scenarios. One promising approach might be, to analyze the volatility of the recent past when entering into the trade and to optimize on a respective volatility/ATR- dependent SL/TP to squeeze some more bucks out of the strategy. However, it is always challenging to improve an already good strategy without overoptimizing it, getting trapped in curve-fitting measures!