Rejoindre la communauté
banner_forum
Devenez membre de la plus grande
communauté francophone sur le Forex
Partagez, échangez et apprenez en gagnant des crédits sur votre compte de trading

Robot de trading

  • Furax

    je confirme Yodda.
  • yodda

    Cb de profit tu as ?
  • Solenn

    Bonjour,

    Merci en tout de nous partager vos évolutions, analyses.

    Cependant, pour plus d'efficacité sur la fermeture des trade, en "manuel", connaissez vous un moyen sous MT4 de pouvoir fermer tout, ou plusieurs trade en cours ?

    Je n'ai pas trouvé, on m'a proposé une solution, celle de créer un template, mais je trouve, compliqué à utiliser, il faut l'appliquer à un graphique et ensuite relancer le robot.

    Merci à vous et bonne journée :)

    Solenn
  • Fabrice

    Merci ,c'est bon ca fonctionne, le petit problème c'est qu'il m a prit les trades a l'envers .Il acheter quand il fallait vendre et vice versa.
    Y a t il une astuce pour le régler ?

    merci
  • PHIL670

    Pareil, par moment il achète en surachat et vent en survente ,malgré la modif inversion Furax.
    A moins que le robot traduit en français refuse l'inversion!

    Donc le fonctionnement du robot allemand serait + subtil qu'annoncé!
    Le robot d'origine ne suivrait donc pas forcément la tendance en cours?
    J'était passé de 3000-3800 à 3500 aujourd'hui
    Remis 1440 comme nombre !
    Mais à chaque redémarrage le robot semble encore ouvrir de nouvelles positions!! donc souvent contre tendance !
  • PHIL670

    bool CommentMode =true

    Furax ,cette ligne je la vois pas dans le robot modifié Draven ,est ce normal?

    Sinon en français c'est quelle ligne?

    Merci
  • A K (invité)

    Le robot earlyTopProrate est un robot commercial.

    La version que vous utilisez est une version de demo qui ne fonctionne pas, il y a de grosses erreurs de logique de programmation qui je pense sont volontaire.

    Replacez deja ces deux lignes de code a la bonne place et ca ira deja beaucoup mieux.

    bool SignalBuy =false;
    bool SignalSell =false;

    Furax vous dira ou les mettre. :)

    Pour ceux qui ont broker a 4 decimales vous pouvez aussi supprimer tout les ( *10 ) dans les lignes de programme.
  • Yorgo94

    Code
    //+------------------------------------------------------------------+ //| earlyTopProrate_V1.mq4 20.08.2010 - 08:54 //|(earlyOpenTrend.my4) //| //| //| dailyOpen = Basiswert, , DailyHigh, -Low = Selektion //+------------------------------------------------------------------+ #property copyright "hansH" #property link "" extern int StartHour = 5; extern int EndHour = 10; extern int ClosingHour = 18; extern int ZD = 0; // ---- double Lots = 0.5; extern int maxPos = 1; int TP1 = 25; int TP2 = 50; int TP3 = 75; int setTP = 35; // TP => OpenPrice int setSL0 = 100; // SL=> +/-50 int setSL1 = 35; // 40 int setSL2 = 60; // 90 int modiSL = 25; // setSL2-35=25 int Ratio1 = 30; // nicht ändern! int Ratio2 = 70; // nicht ändern! int Ratio3 = 100; // nicht ändern! int Phase = 0; int Magic =170810; bool CommentMode = true; bool SignalBuy =false; bool SignalSell =false; // MoneyManagement extern int MMTyp = 0; int FactorMM2 = 3; int RiskMM2 = 50; // ---- double o1, h1, l1; double MAtrend, MAtrend1; double modLots, varLots, opLongLots, opShortLots; string ProfitPoints; int i; //+------------------------------------------------------------------+ int init() { return(0); } //+------------------------------------------------------------------+ int deinit() { return(0); } //+------------------------------------------------------------------+ int start() { modiSL = setSL2-35; // ---- Anzahl offene Positionen/Typ int cnt, cntOpPos, cntOpLong=0, cntOpShort=0; double Prof; for(cnt=0; cnt<OrdersTotal(); cnt++) { OrderSelect(cnt,SELECT_BY_POS); if(OrderType()==OP_BUY && OrderSymbol()==Symbol()) { cntOpLong=cntOpLong+1; cntOpPos=cntOpPos+1; } if(OrderType()==OP_SELL && OrderSymbol()==Symbol()) { cntOpShort=cntOpShort+1; cntOpPos=cntOpPos+1; } } if (cntOpPos<1) { Phase=0; opLongLots=0; opShortLots=0; ProfitPoints=(TP1+", "+TP2+", "+TP3); } // ---- int x1=0; h1 = iHigh(NULL,1440,x1); l1 = iLow(NULL,1440,x1); o1 = iOpen(NULL,1440,x1); if( (h1-o1)>(o1-l1) ) string aktTrend="Up"; else if( (h1-o1)<(o1-l1) ) aktTrend="Down"; else aktTrend="flat"; // ---- if (Bid>o1 && aktTrend=="Up" && cntOpPos<1) SignalBuy=true; // ---- if (Ask<o1 && aktTrend=="Down" && cntOpPos<1) SignalSell=true; //+------------------------------------------------------------------+ //|------------------- Money Management ------------------------------ //+------------------------------------------------------------------+ if (SignalBuy==true || SignalSell==true) { if (MMTyp >3) MMTyp=0; if (MMTyp<=1 && OrdersTotal()<1) Lots=Lots; if (MMTyp==2 && OrdersTotal()<1) Lots=0.1*MathSqrt(AccountBalance()/1000)*FactorMM2; if (MMTyp==3 && OrdersTotal()<1) Lots=AccountEquity()/Close[0]/1000*RiskMM2/100; if(MMTyp>=2) { Lots = modLots(Lots); double minLot = MarketInfo(Symbol(), MODE_MINLOT); double maxLot = MarketInfo(Symbol(), MODE_MAXLOT); if (Lots<minLot)Lots=minLot; if (Lots>maxLot)Lots=maxLot; } } //+------------------------------------------------------------------+ //| OrderSend //+------------------------------------------------------------------+ if(Hour()>=StartHour && Hour()<EndHour) { if (SignalBuy==true && cntOpLong==0 && cntOpPos==0) { OrderSend(Symbol(),OP_BUY,Lots,Ask,0,0,0,"earlyTopProrate",Magic); // ,Blue SignalBuy=false; cntOpPos=1; } // -- if (SignalSell==true && cntOpShort==0 && cntOpPos==0) { OrderSend(Symbol(),OP_SELL,Lots,Bid,0,0,0,"earlyTopProrate",Magic); // ,Red SignalSell=false; } } // if(Hour() // ---- if (CommentMode==true) { Comment ("\n"+ //"Balance: "+DoubleToStr(AccountBalance(),0)+" / Equity: "+DoubleToStr(AccountEquity(),0)+"\n"+ //" dailyOpen, h1, l1"+"\n"+ "MoneyManagement Typ "+MMTyp+"\n"+ "Lots, Phase: "+DoubleToStr(Lots,1)+" ("+Phase+")\n"+ "openLots: "+DoubleToStr(opLongLots,1)+" (L/S) "+DoubleToStr(opShortLots,1)+"\n"+ //"ProfitPoints: "+DoubleToStr(TP1,0)+" / "+DoubleToStr(TP2,0)+" / "+DoubleToStr(TP3,0)+"\n"+ "ProfitPoints: "+ProfitPoints+"\n"+ "ModifyPoints: "+setSL1+", "+setSL2+" / -"+setTP+", -"+setSL0+"\n"+ //"bestSL-Level: "+modiSL+"\n"+ "Trading: "+(StartHour+ZD)+" bis "+(EndHour+ZD)+":00 / cls "+(ClosingHour+ZD)+" Uhr" ); } // if (CommentMode // ------------------------------------------ // ---- Werte offener Positionen / shortEntry double opShortPos=0, opLongPos=0; int shortTP=0,longTP=0; color col1=Gray, col2=Gray, col1a=Gray, col2a=Gray; // -- if(OrdersTotal()!=0) { for(cnt=0; cnt<OrdersTotal(); cnt++) { OrderSelect(cnt,SELECT_BY_POS); if(OrderType()==OP_SELL && OrderSymbol()==Symbol()) { opShortPos=OrderOpenPrice(); shortTP=(opShortPos-Ask)/Point; col1=Red;} if(OrderType()==OP_BUY && OrderSymbol()==Symbol()) { opLongPos=OrderOpenPrice(); longTP= (Bid-opLongPos)/Point; col2=SpringGreen; } } // for(cnt } // if(OrdersTotal // ---- ObjectDelete("longTP"); ObjectDelete("longTP_Label"); ObjectDelete("shortTP"); ObjectDelete("shortTP_Label"); ObjectDelete("opLong"); ObjectDelete("opLong_Label"); ObjectDelete("opShort"); ObjectDelete("opShort_Label"); // -------------------------------------------- // ----------------- Objekte ------------------ // -------------------------------------------- if(opShortPos==0) {shortTP=0; col1=Gray; col1a=Gray;} else col1a=Silver; if(opLongPos==0) {longTP=0; col2=Gray; col2a=Gray;} else col2a=Silver; // ---- if(opShortPos!=0) { ObjectCreate("opShort", OBJ_LABEL, 0, 0, 0); ObjectSetText("opShort",DoubleToStr(opShortPos,Digits-1),9,"Tahoma", col1); ObjectSet("opShort", OBJPROP_CORNER, 0); ObjectSet("opShort", OBJPROP_XDISTANCE, 3); ObjectSet("opShort", OBJPROP_YDISTANCE, 11); ObjectCreate("shortTP", OBJ_LABEL, 0, 0, 0); ObjectSetText("shortTP","("+DoubleToStr(shortTP/10,0)+")",9,"Tahoma", col1a); ObjectSet("shortTP", OBJPROP_CORNER, 0); ObjectSet("shortTP", OBJPROP_XDISTANCE, 44); ObjectSet("shortTP", OBJPROP_YDISTANCE, 11); } if(opLongPos!=0) { ObjectCreate("opLong", OBJ_LABEL, 0, 0, 0); ObjectSetText("opLong",DoubleToStr(opLongPos,Digits-1),9,"Tahoma", col2); ObjectSet("opLong", OBJPROP_CORNER, 0); ObjectSet("opLong", OBJPROP_XDISTANCE, 85); ObjectSet("opLong", OBJPROP_YDISTANCE, 11); ObjectCreate("longTP", OBJ_LABEL, 0, 0, 0); ObjectSetText("longTP","("+DoubleToStr(longTP/10,0)+")",9,"Tahoma", col2a); ObjectSet("longTP", OBJPROP_CORNER, 0); ObjectSet("longTP", OBJPROP_XDISTANCE, 126); ObjectSet("longTP", OBJPROP_YDISTANCE, 11); } //---- //return(0); //} // int start() //+------------------------------------------------------------------+ if (cntOpPos>0) { for (cnt=0;cnt<OrdersTotal();cnt++) { OrderSelect(cnt, SELECT_BY_POS); if (OrderSymbol()==Symbol() && OrderMagicNumber()==Magic) { if (OrderType()==OP_BUY) { opLongLots=OrderLots(); /* //---- SL- u. TP-Modify if (OrderStopLoss()==0) { OrderModify(OrderTicket(),OrderOpenPrice(),OrderOpenPrice()-modiSL*10*Point,OrderTakeProfit(),0); return(0); } */ //---- setTP **** 35 **** / TP auf OrderOpenPrice() setzen if (setTP>0 && Bid-OrderOpenPrice()<=-setTP*10*Point && OrderTakeProfit()==0) { OrderModify(OrderTicket(),OrderOpenPrice(),OrderStopLoss(),OrderOpenPrice(),0); return(0); } //---- setSL0 **** 100 **** / BUY-SL od. TP setzen if (setSL0>0 && Bid-OrderOpenPrice()<=-setSL0*10*Point) { //OrderModify(OrderTicket(),OrderOpenPrice(),OrderOpenPrice()-50*10*Point,OrderTakeProfit(),0); OrderModify(OrderTicket(),OrderOpenPrice(),OrderStopLoss(),OrderOpenPrice()-50*10*Point,0); return(0); } //---- setSL1 / BUY-SL erhöhen auf OrderOpenPrice() if (setSL1>0 && Bid-OrderOpenPrice()>=setSL1*10*Point && OrderStopLoss()<OrderOpenPrice()) { OrderModify(OrderTicket(),OrderOpenPrice(),OrderOpenPrice(),OrderTakeProfit(),0); return(0); } //---- setSL2 / BUY-SL erhöhen auf OrderOpenPrice()+modiSL if (setSL2>0 && Bid-OrderOpenPrice()>=setSL2*10*Point && OrderStopLoss()<OrderOpenPrice()+modiSL*10*Point) { OrderModify(OrderTicket(),OrderOpenPrice(),OrderOpenPrice()+modiSL*10*Point,OrderTakeProfit(),0); return(0); } //---- TP1 if(Bid-OrderOpenPrice()>=TP1*10*Point && Phase==0 && TP1>0) { OrderClose(OrderTicket(),modLots(OrderLots()*Ratio1/100),Bid,0); Phase=1; return(0); } //---- TP2 if(Bid-OrderOpenPrice()>=TP2*10*Point && Phase==1 && TP2>0) { OrderClose(OrderTicket(),modLots(OrderLots()*Ratio2/100),Bid,0); Phase=2; return(0); } //---- TP3 **** 75 **** if(Bid-OrderOpenPrice()>=TP3*10*Point && Phase==2 && TP3>0) { OrderClose(OrderTicket(),modLots(OrderLots()*Ratio3/100),Bid,0); Phase=3; return(0); } } // if (OrderType()==OP_BUY) // ---- if (OrderType()==OP_SELL) { opShortLots=OrderLots(); /* //---- SL- u. TP-Modify if (OrderStopLoss()==0) { OrderModify(OrderTicket(),OrderOpenPrice(),OrderOpenPrice()+modiSL*10*Point,OrderTakeProfit(),0); return(0); } */ //---- setTP **** 35 **** / TP auf OrderOpenPrice() setzen if (setTP>0 && OrderOpenPrice()-Ask<=-setTP*10*Point && OrderTakeProfit()==0) { OrderModify(OrderTicket(),OrderOpenPrice(),OrderStopLoss(),OrderOpenPrice(),0); return(0); } //---- setSL0 **** 100 **** / SELL-SL od. TP setzen if (setSL0>0 && OrderOpenPrice()-Ask<=-setSL0*10*Point) { //OrderModify(OrderTicket(),OrderOpenPrice(),OrderOpenPrice()+50*10*Point,OrderTakeProfit(),0); OrderModify(OrderTicket(),OrderOpenPrice(),OrderStopLoss(),OrderTakeProfit()+50*10*Point,0); return(0); } //---- setSL1 / SELL-SL senken auf OrderOpenPrice() if (setSL1>0 && OrderOpenPrice()-Ask>=setSL1*10*Point && OrderStopLoss()>OrderOpenPrice()) { OrderModify(OrderTicket(),OrderOpenPrice(),OrderOpenPrice(),OrderTakeProfit(),0); return(0); } //---- setSL2 / SELL-SL senken auf OrderOpenPrice()-modiSL if (setSL2>0 && OrderOpenPrice()-Ask>=setSL2*10*Point && OrderStopLoss()>OrderOpenPrice()-modiSL*10*Point) { OrderModify(OrderTicket(),OrderOpenPrice(),OrderOpenPrice()-modiSL*10*Point,OrderTakeProfit(),0); return(0); } //---- TP1 if(OrderOpenPrice()-Ask>=TP1*10*Point && Phase==0 && TP1>0) { OrderClose(OrderTicket(),modLots(OrderLots()*Ratio1/100),Ask,0); Phase=1; return(0); } //---- TP2 if(OrderOpenPrice()-Ask>=TP2*10*Point && Phase==1 && TP2>0) { OrderClose(OrderTicket(),modLots(OrderLots()*Ratio2/100),Ask,0); Phase=2; return(0); } //---- TP3 **** 75 **** if(OrderOpenPrice()-Ask>=TP3*10*Point && Phase==2 && TP3>0) { OrderClose(OrderTicket(),modLots(OrderLots()*Ratio3/100),Ask,0); Phase=3; return(0); } } // if (OrderType()==OP_SELL) // ---- //if(Phase==0) { if (opLongLots==Lots || opShortLots==Lots || (opLongLots==0 && opShortLots==0) ) { Phase=0; ProfitPoints=(TP1+", "+TP2+", "+TP3); } else if((opLongLots >Lots/2 && opShortLots==0) || (opShortLots>Lots/2 && opLongLots ==0)) { Phase=1; ProfitPoints=(TP2+", "+TP3); } else if((opLongLots <Lots/2 && opShortLots==0) || (opShortLots<Lots/2 && opLongLots ==0)) { Phase=2; ProfitPoints=TP3; } else { Phase=3; ProfitPoints="k.A."; } } /* // ---- ProfitPoints=""; if(Phase==0) ProfitPoints=(TP1+", "+TP2+", "+TP3); if(Phase==1) ProfitPoints=(TP2+", "+TP3); if(Phase==2) ProfitPoints=TP3; if(Phase>=3) ProfitPoints="k.A."; */ // ---------------------------------- // --------- DayTradingClose -------- // ---------------------------------- if(ClosingHour!=0) { if (OrderType()==OP_BUY && Hour()>=ClosingHour) OrderClose(OrderTicket(),opLongLots,Bid,0); // nicht: OrderLots() 0.1 if (OrderType()==OP_SELL && Hour()>=ClosingHour) OrderClose(OrderTicket(),opShortLots,Ask,0); // nicht: OrderLots() 0.1 } // if(ClosingHour!=0) // ---- } // if (OrderSymbol() } // for (int cnt } // if (cntOpPos>0) //---- return(0); } // int start() // ----------------------------------- // ---- modLots (MoneyManagement) ---- // ----------------------------------- double modLots(double varLots) { double lotStep = MarketInfo(Symbol(), MODE_LOTSTEP); double tempDouble = varLots + lotStep/2; tempDouble /= lotStep; int tempInt = tempDouble; return (tempInt*lotStep); } // ******************************************************************************
  • Furax

    la version dite 1 ne marche pas, soyons bien tous d'accord...
  • PHIL670

    la version allemande a des erreurs.

    Apparemment il y'a juste 2 lignes bool à modifier
    comme dis juste plus haut !
    En version modifié Furax, je suis à -300$ env avec lots de 0.3
    J'efface mes gains de la semaine donc.
    Je vais retester donc semaine prochaine avec version originale légèrement modifié
  • Furax

    ce serait bien de publier vos résultats de la semaine pour que nous puissions y voir plus clair.
  • PHIL670

    Ok,question bete, comment faire pour obtenir une image de mon compte ?
  • Fabrice

    Bonjour,
    Quand vous êtes sur "historique de compte" en bas de l'écran, faites in clique droit sur la souris.
    Dans la fenêtre "Enregistrer rapport" choisissez la destination de votre fichier et le tour est joué.
    Je suis pas un pro, moi je fais comme ça, si il y a une autre solution je suis preneur.

    Fabrice
  • Malinio67

    Bonsoir,

    Voici mon rapport de la semaine.J'utilise le robot modifié par Draven.Les SL et TP doivent être ajoutés manuellement, est-ce normal?
    Je pense que le robot achète en sur-achat et vend en survente.
    Vous avez une idée?

    Julien
    Malinio67 a joint une image
    G935CA
  • Furax

    @Malino : merci pour ton rapport qui confirme le fait que la version Draven ne marche pas, essaie plutôt la mienne...

    Tout a déjà été expliqué sur ce sujet ici: T/P et S/L non apparents, c'est mieux... etc...

    Le robot de Draven ne marche pas pour les raisons indiquées par Malinio67 et qui ont aussi été expliqué plusieurs fois ici par d'autre intervenants et moi-même. Donc, excusez moi, mais relisez les amis, vos réponses sont là.
  • rourou73

    Salut furax j'ai inséré le code entier fourni par yorgo et au moment d'enregistré la modification il me sort un message d'erreur "acces refusé"
    Comment faire ?
    Merci pour ton aide
  • Malinio67

    La version postée par Yorgo est-elle la bonne?
  • Malinio67

    j'ai aussi remarqué qu'avec le robot modifié par Draven, il ne prend qu'un seul trade par paire...

    Je vais tester la version a Furax cette semaine et voir ce que cela donne.

    Bon trades à toutes et à tous.

    Julien
  • Malinio67

    Une erreur de compilation peut-être?
  • rourou73

    Non c'est réglé c'est juste qu'il fallait ouvrir mt4 en administrateur
    super vista