I created this trading system following the VTAD-rules as follows:
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!
//------------------------------------------------------------------------- // 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