Bonjour,
Je sollicite votre aide pour un bug que je n’arrive pas résoudre.
J’ai pris un code/stratégie sur le site, je n’ai conservé que le code de la fractale william et j’ai modifié tout le reste pour coller à ma stratégie.
J’ai un excellent résultat de gain/ratio sur 9ans (88% de trades gagnants et ratio 3.90% sachant que je compte pyramider par la suite quand le bug sera réparé). Mais à 4 reprises (voir les carrés oranges) les trades ne se cloturent pas, certains durent des mois, aucune condition de sortie cloture le trade durant ces 4 périodes alors que tout fonctionne le reste du temps. J’ai testé des conditions basiques pour voir si les trades se cloturaient mais rien y fait, j’ai même changer de devises et c’est idem.
Je m’arrache les cheveux depuis hier … sans succès ….
J’ai insérer la photo, vous verrez les 4 triangles oranges….
Merci beaucoup pour votre aide 🙂
Voici le code
//EURUSD(-) - IG MARKET
// TIME FRAME 1H
// PROBACKTEST TICK by TICK - 200.000 bars
// SPREAD 0.6 PIP
// ALE
DEFPARAM CumulateOrders = false
///BILL WILLIAM FRACTAL INDICATOR
//CP=PERIOD
CP=100
if close[cp] >= highest[2*cp+1](close) then
LH = 1
else
LH=0
endif
if close[cp] <= lowest[2*cp+1](close) then
LL= -1
else
LL=0
endif
if LH=1 then
HIL = close[cp]
endif
if LL = -1 then
LOL=close[cp]
endif
/// 2h
timeframe(2h)
EMA20 = ExponentialAverage[5](close) // 20
EMA50= ExponentialAverage[10](close) //50
hausse2h = EMA20 > EMA50
baisse2h = close < EMA20
// prix au dessu trend
indicator1 = SuperTrend[3,10]
HAUSSEtrend = (close >= indicator1)
BAISSEtrend = (close < indicator1)
timeframe(default)
//LONG and SHORT CONDITIONS
Positionsize=1
if (time >=90000 and time < 230000) then
C1 = (close CROSSES OVER HIL)
D1 = (close CROSSES UNDER LOL)
IF c1 and hausse2h and HAUSSEtrend and not shortonmarket THEN
BUY positionsize CONTRACT AT MARKET
ENDIF
IF D1 and baisse2h and BAISSEtrend and not longonmarket THEN
SELLSHORT positionsize CONTRACT AT MARKET
ENDIF
ENDIF
////////////////////////////////////
////////// CONDITISTOP SORTIE
indicatorBB = SuperTrend[3,10]
closeSTOPDUshort = close CROSSES OVER indicatorBB
closeSTOPDUbuy= close <= indicatorBB
// SORTIE
if longonmarket and closeSTOPDUbuy then
SELL AT MARKET
endif
if shortonmarket AND closeSTOPDUshort then
SELL AT MARKET
endif
// Take profit : TP= 15 to 80
set target pprofit 20// ORIGINE 30
//sET STOP pLOSS 65
Sophie
Les questions sur le trading automatique doivent être postés dans le forum ProOrder. Merci de penser à un titre moins générique que “Besoin d’aide sur un bug” la prochaine fois, sinon on va avoir des dizaines de sujets avec ce même type de titres et ça ne sera d’aucune utilité pour les prochains visiteurs pour souhaiterai retrouver des réponses à leurs questions 😉
Je vais tester le problème de mon côté pour vérifier. EURUSD et timeframe H1 c’est bien ça ?
Désolée Nicolas.
Oui c’est bien en 1h + conditions 2h
Merci 🙂
Les ordres SHORT ne sont jamais fermés hormis en takeprofit, car tu as utilisé SELL au lieu de EXITSHORT à la ligne 76.
Oh super Nicolas, tu es trop fort. En une minute tu règles une prise de tête de plus de 24H,
Les résultats sont fabuleux, je vais continuer sur ma lancée…
Un grand merci pour ton professionnalisme et ta réactivité 🙂
Très belle journée 🙂
Oups, autre petite question, pour la ligne 76 ok
mais pour la ligne des achats, c’est ausi EXITSHORT?
merci 🙂
// SORTIE
if longonmarket and closeSTOPDUbuy then
SELL AT MARKET
endif
bonjour,
avec quelque réglage et surtout le stop par rapport au TP voir 1 pour 1 ou plus
//EURUSD(-) - IG MARKET
// TIME FRAME 1H
// PROBACKTEST TICK by TICK - 200.000 bars
// SPREAD 0.6 PIP
// ALE
DEFPARAM CumulateOrders = false
///BILL WILLIAM FRACTAL INDICATOR
//CP=PERIOD
CP=100
if close[cp] >= highest[2*cp+1](close) then
LH = 1
else
LH=0
endif
if close[cp] <= lowest[2*cp+1](close) then
LL= -1
else
LL=0
endif
if LH=1 then
HIL = close[cp]
endif
if LL = -1 then
LOL=close[cp]
endif
/// 2h
timeframe(2h)
EMA20 = Average[5](close) // 20
EMA50= Average[10](close) //50
hausse2h = EMA20 > EMA50
baisse2h = close < EMA20
// prix au dessu trend
indicator1 = SuperTrend[3,10]
HAUSSEtrend = (close >= indicator1)
BAISSEtrend = (close < indicator1)
timeframe(default)
//LONG and SHORT CONDITIONS
Positionsize=1
if (time >=80000 and time < 230000) then
C1 = (close CROSSES OVER HIL)
D1 = (close CROSSES UNDER LOL)
IF open<close and c1 and hausse2h and HAUSSEtrend and not shortonmarket THEN
BUY positionsize CONTRACT AT MARKET
ENDIF
IF D1 and baisse2h and BAISSEtrend and not longonmarket THEN
SELLSHORT positionsize CONTRACT AT MARKET
ENDIF
ENDIF
////////////////////////////////////
////////// CONDITISTOP SORTIE
indicatorBB = SuperTrend[3,10]
closeSTOPDUshort = close CROSSES OVER indicatorBB
closeSTOPDUbuy= close <= indicatorBB
// SORTIE
if longonmarket and closeSTOPDUbuy then
SELL AT MARKET
endif
if shortonmarket AND closeSTOPDUshort then
exitshort AT MARKET
endif
// Take profit : TP= 15 to 80
set target pprofit 70// ORIGINE 30
sET STOP pLOSS 40
J’ai un stop suiveur mais je j’ai enlevé pas mal de code pour simplifier.
je suis encore sur des reglages mais c’est entre 5 et 13.
les resultats sont tres bons mais en 2018 ce n’est pas le cas, donc j’etudie tous les trades perdants de 2018 pour identifier le probleme.
je viens de prendre connaissance de la photo « code sophie » les resultats ne sont pas bons, je suis à plus de 80% de trades gagnants et le ratio à plus de 2.
quand je l’aurai terminé je mettrai l’intégralité du code pour les interessés.
Merci sophia pour ces retours, j’apprécie.