Experts: Raymond Cloudy Day For EA - page 2

 
Utilisez lebouton CODE (Alt-S) lorsque vous insérez du code.

Un modérateur a corrigé le formatage cette fois-ci. À l'avenir, veuillez formater le code correctement ; les messages contenant un code mal formaté peuvent être supprimés.

Je pense que quelque chose ne va pas dans les conditions d'achat / vente ( par exemple pourquoi utiliser TPS1 mais pas TPB1 ) ( cause opération de copier/coller lors de la création du code ).

    //-- ACHETER
       if(Lowx1<TPS1 && Closex1>TPS1){  // ? ??
           double tp=500*_Point+Closex1;
           double sl=Closex1-500*_Point;
           trade.Buy(lots,_Symbol,0,sl,tp, Comment);
           lastOrderTime = TimeTradeServer();
       }
    //-- VENDRE
       if(Lowx1>TPS1 && Closex1<TPS1){ // ? ??
           double tp=Closex1-500*_Point;
           double sl=Closex1+500*_Point;
           trade.Sell(lots,_Symbol,0,sl,tp, Comment);
           lastOrderTime = TimeTradeServer();
       }
 
La compilation donne 3 erreurs, voici donc les corrections,

Remplacer cette ligne (cause l'erreur idenfitier 'Comment' déjà utilisé)

input string Commentaire = "Commentaire" ; // Commentaire

Avec ce nouveau : (correct)

input string TradeComment = "Raymond Cloudy Day EA";

Et modifiez ces 2 lignes (elles provoquent une erreur : parenthèse ouverte attendue)

trade.Buy(lots,_Symbol,0,sl,tp, Comment) ;

trade.Sell(lots,_Symbol,0,sl,tp, Comment) ;

Avec ces nouvelles (correctes)

trade.Buy(lots, _Symbol, 0, sl, tp, TradeComment);
trade.Sell(lots, _Symbol, 0, sl, tp, TradeComment);