Bonjour Nicolas
Voici mon code
Je ne suis pas un spécialiste du codage et il fort possible que tu trouves des anomalies, j’essaie grâce à vos conseils et aux lectures que je fais de progresser mais c’est
pas facile quand on part de zéro.
Bonne journée
Madrosat
// Définition des paramètres du code triangleendpointzonee 30/4es6
DEFPARAM CumulateOrders = False // Cumul des positions désactivé
// Conditions pour ouvrir une position acheteuse
indicator1 = CALL “Moyenne adaptative Kama”[3, 3, 8]
indicator2 = CALL “Moyenne adaptative Kama”[3, 3, 8]
c1 = (indicator1 > indicator2[1])
indicator3 = CALL “Moyenne adaptative Kama”[3, 3, 8]
indicator4 = CALL “Moyenne adaptative Kama”[3, 3, 8]
c2 = (indicator3[1] > indicator4[2])
ignored, ignored, indicator5, ignored, ignored = CALL “Triangleendpoint zonée”[3, 0.5, 0.8, 18](close)
notrading = (dayofweek=5 AND time>=210000) or (dayofweek=1 AND time<030000)
IF NOT notrading and c1 and c2 then
buy 1 shares at (indicator5) limit
ENDIF
// Conditions pour fermer une position acheteuse
ignored, indicator6, ignored, ignored, ignored = CALL “Triangleendpoint zonée”[3, 0.5, 0.8, 18](close)
SELL AT (indicator6) limit
indicator7 = CALL “Moyenne adaptative Kama”[3, 3, 8]
indicator8 = CALL “Moyenne adaptative Kama”[3, 3, 8]
c3 = (indicator7 < indicator8[1])
if longonmarket and c3 then
sell at (indicator7) limit
endif
// Conditions pour ouvrir une position en vente à découvert
indicator9 = CALL “Moyenne adaptative Kama”[3, 3, 8]
indicator10 = CALL “Moyenne adaptative Kama”[3, 3, 8]
c4 = (indicator9 < indicator10[1])
indicator11 = CALL “Moyenne adaptative Kama”[3, 3, 8]
indicator12 = CALL “Moyenne adaptative Kama”[3, 3, 8]
c5 = (indicator11[1] < indicator12[2])
ignored, indicator13, ignored, ignored, ignored = CALL “Triangleendpoint zonée”[3, 0.5, 0.8, 18](close)
notrading = (dayofweek=5 AND time>=210000) or (dayofweek=1 AND time<030000)
IF NOT notrading and c4 and c5 THEN
SELLSHORT 1 shares AT (indicator13) limit
ENDIF
// Conditions pour fermer une position en vente à découvert
ignored, ignored, indicator14, ignored, ignored = CALL “Triangleendpoint zonée”[3, 0.5, 0.8, 18](close)
EXITSHORT AT (indicator14) limit
indicator15 = CALL “Moyenne adaptative Kama”[3, 3, 8]
indicator16 = CALL “Moyenne adaptative Kama”[3, 3, 8]
c6 = (indicator15 > indicator16[1])
if shortonmarket and c6 then
exitshort at indicator15 limit
endif
// Stops et objectifs
SET STOP %LOSS 0.6