// Définition des paramètres du code DEFPARAM CumulateOrders = False // Cumul des positions désactivé // Empêche le système de placer de nouveaux ordres sur les jours de la semaine spécifiés daysForbiddenEntry = OpenDayOfWeek = 1 OR OpenDayOfWeek = 6 OR OpenDayOfWeek = 0 // Conditions pour ouvrir une position acheteuse indicator1, ignored = CALL "DR_pente mm vente"[1, 20, 50] c1 = (indicator1 CROSSES OVER 13) IF c1 AND not daysForbiddenEntry THEN BUY 1 SHARES AT MARKET ENDIF // Conditions pour fermer une position acheteuse indicator2, ignored = CALL "DR_pente mm vente"[1, 20, 50] c2 = (indicator2 CROSSES UNDER -4) IF c2 THEN SELL AT MARKET ENDIF // Conditions pour ouvrir une position en vente à découvert indicator3, ignored = CALL "DR_pente mm vente"[1, 20, 50] c3 = (indicator3 CROSSES UNDER -14) IF c3 AND not daysForbiddenEntry THEN SELLSHORT 1 SHARES AT MARKET ENDIF // Conditions pour fermer une position en vente à découvert indicator4, ignored = CALL "DR_pente mm vente"[1, 20, 50] c4 = (indicator4 CROSSES OVER -1) IF c4 THEN EXITSHORT AT MARKET ENDIF // Stops et objectifs SET STOP %LOSS 0.2