THREE LINE BREAK STRATEGY
Forums › ProRealTime forum Français › Support ProOrder › THREE LINE BREAK STRATEGY
- This topic has 3 replies, 2 voices, and was last updated 1 year ago by Roland57800.
-
-
08/30/2023 at 10:53 AM #220053
Bonjour Nicolas,
J’ai repris le code concernant le THREE LINE BREAK pour essayer de le mettre en stratégie
ci-joint le code et plus l’explication de mon souci.
three line break123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137DEFPARAM CUMULATEORDERS = false // pas de cumul de positionsDEFPARAM Preloadbars = 10000DEFPARAM FLATBEFORE = 070000DEFPARAM FLATAFTER = 220000// ACTIVATION OU NON DES LONGS / SHORTS// 0 = désactiver / 1 = activerLongsOK = 1ShortsOK = 1// TAILLE DES POSITIONSREINV = 1LEVIER = 1 // Levier d'origine 5n = levier// STOPSSL = 45 // POSSIBILITE DE MONTER A 50 POINTS// CALCUL DES CONDITIONS POUR TROUVER LE SIGNAL D'ACHAT OU DE VENTEif barindex = 1 then //barindexif (close >= open) thenxtrend = 1trend = xtrendxu = closexu1 = openxu2 = openxu3 = openCL = xuOP = xu1LL = OPHH = CLELSExtrend = -1trend = xtrendxu = closexu1 = openxu2 = openxu3 = openCL = xuOP = xu1LL = CLHH = OPENDIFELSE //barindex continueif (xtrend = 1) thenif (close > xu) thentrend = xtrendxu3 = xu2xu2 = xu1xu1 = xuxu = closeCL = xuOP = xu1LL = OPHH = CLELSIF (close < xu3) thenxtrend = -1trend = xtrendxu = closexu2 = xu1xu3 = xu1CL = xuOP = xu1LL = CLHH = OPELSEtrend = xtrendCL = CL[1]OP = OP[1]LL = LL[1]HH = HH[1]ENDIFELSE //xtrend <>1if (close > xu3) thenxtrend = 1trend = xtrendxu = closexu2 = xu1xu3 = xu1CL = xuOP = xu1LL = OPHH = CLELSIF (close < xu) thentrend = xtrendxu3 = xu2xu2 = xu1xu1 = xuxu = closeCL = xuOP = xu1LL = CLHH = OPELSEtrend = xtrendCL = CL[1]OP = OP[1]LL = LL[1]HH = HH[1]ENDIFENDIFENDIF// LONGSIF TREND >0 THENIF LongsOK = 1 THENIF not longonmarket THENBuy n shares at marketSET STOP pLOSS SL// SHORTSIF trend <0 thenIF ShortsOK = 1 THENIF not shortonmarket THENSellshort n shares at marketSET STOP pLOSS SLENDIFENDIFENDIFENDIFENDIFENDIFje joins le screen avec le souci.
à 9h03 on ouvre LONG et je ne comprend pas pourquoi avec le chandelier de 10h06 la stratégie n’est pas arrêté
Merci pour ta réponse Nicolas
Cordialement
08/30/2023 at 2:06 PM #220061Non testé, mais pour moi tu t’es emmêlé dans tes ENDIF, tu as placé la partie short dans la partie long. Ci-dessous le code corrigé à tester:
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134DEFPARAM CUMULATEORDERS = false // pas de cumul de positionsDEFPARAM Preloadbars = 10000DEFPARAM FLATBEFORE = 070000DEFPARAM FLATAFTER = 220000// ACTIVATION OU NON DES LONGS / SHORTS// 0 = désactiver / 1 = activerLongsOK = 1ShortsOK = 1// TAILLE DES POSITIONSREINV = 1LEVIER = 1 // Levier d'origine 5n = levier// STOPSSL = 45 // POSSIBILITE DE MONTER A 50 POINTS// CALCUL DES CONDITIONS POUR TROUVER LE SIGNAL D'ACHAT OU DE VENTEif barindex = 1 then //barindexif (close >= open) thenxtrend = 1trend = xtrendxu = closexu1 = openxu2 = openxu3 = openCL = xuOP = xu1LL = OPHH = CLELSExtrend = -1trend = xtrendxu = closexu1 = openxu2 = openxu3 = openCL = xuOP = xu1LL = CLHH = OPENDIFELSE //barindex continueif (xtrend = 1) thenif (close > xu) thentrend = xtrendxu3 = xu2xu2 = xu1xu1 = xuxu = closeCL = xuOP = xu1LL = OPHH = CLELSIF (close < xu3) thenxtrend = -1trend = xtrendxu = closexu2 = xu1xu3 = xu1CL = xuOP = xu1LL = CLHH = OPELSEtrend = xtrendCL = CL[1]OP = OP[1]LL = LL[1]HH = HH[1]ENDIFELSE //xtrend <>1if (close > xu3) thenxtrend = 1trend = xtrendxu = closexu2 = xu1xu3 = xu1CL = xuOP = xu1LL = OPHH = CLELSIF (close < xu) thentrend = xtrendxu3 = xu2xu2 = xu1xu1 = xuxu = closeCL = xuOP = xu1LL = CLHH = OPELSEtrend = xtrendCL = CL[1]OP = OP[1]LL = LL[1]HH = HH[1]ENDIFENDIFENDIF// LONGSIF TREND >0 THENIF LongsOK = 1 THENIF not longonmarket THENBuy n shares at marketSET STOP pLOSS SLendifendifendif// SHORTSIF trend <0 thenIF ShortsOK = 1 THENIF not shortonmarket THENSellshort n shares at marketSET STOP pLOSS SLENDIFENDIFENDIF08/30/2023 at 2:42 PM #220064Merci Nicolas
faut que je me réveille depuis ce matin c’est dur
je regarde ça et tiens au courant
Cordialement
08/31/2023 at 8:53 AM #220106Bonjour Nicolas,
testé ça marche. les résultats sont moyens suivant les unités de temps.
du travail pour améliorer
Bonne journée, Cordialement
-
AuthorPosts
Find exclusive trading pro-tools on