salut j ai une erreur de compilaton mercI de faire un geste

Présentation, Développement, Améliorations et Ressources pour les Stratégies de Trading Automatique.

Modérateur : Administrateurs

Message
Auteur
Rmarc972
Membre actif
Messages : 10
Inscription : 03 oct. 2012, 15:38

salut j ai une erreur de compilaton mercI de faire un geste

#1 Message par Rmarc972 »

//+------------------------------------------------------------------+
//| Igateway.mq4 |
//| Copyright © 2011, Nicolas Tuffier |
//| http://www.furyweb.fr/forex/ |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2011, Nicolas Tuffier"
#property link "http://www.furyweb.fr/forex/"

//--- input parameters
extern string tradeComment="Gateway Managed";
extern double lotSize=0.01;
extern int slippage=2;
string clsVar="TrendSignal";
string opnVar="TrendSignal";

//+------------------------------------------------------------------+
//| expert initialization function |
//+------------------------------------------------------------------+
int init() {
//----
opnVar"TrendSignal" StringConcatenate("SignalOpen", Symbol(), Period());
clsVar"TrendSignal" StringConcatenate("SignalClose", Symbol(), Period());
}

//----
return(0);

//+------------------------------------------------------------------+
//| expert start function |
//+------------------------------------------------------------------+
int start() {
//----
int op;
double price;
color col;

if (GlobalVariableCheck(opnVar"TrendSignal")) {
op = GlobalVariableGet(opnVar"TrendSignal");
GlobalVariableDel(opnVar"TrendSignal");
if (op == OP_BUY) {
col = Lime;
price = Ask;
}
if (op == OP_BUY) {
col = Red;
price = Bid;
}
OrderSend(Symbol(), op, lotSize, price, slippage, 0, 0, tradeComment, 0, 0, col);
}

if (GlobalVariableCheck(clsVar"TrendSignal")) {
op = GlobalVariableGet(clsVar"TrendSignal");
GlobalVariableDel(clsVar"TrendSignal");
if (op == OP_BUY) {
col = Lime;
price = Bid;
} else {
col = Red;
price = Ask;
}
int n = OrdersTotal();
for (int i = 0; i < n; i++)
if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES))
if (OrderType() == op && OrderComment() == tradeComment)
OrderClose(OrderTicket(), OrderLots(), price, slippage, col);
}

//----
return(0);
}

//+------------------------------------------------------------------+
//| expert deinitialization function |
//+------------------------------------------------------------------+
int deinit(){
//----
}
//----
return(0);


}
//+------------------------------------------------------------------+

anthony
Membre actif et régulier
Messages : 53
Inscription : 10 août 2012, 23:08

Re: salut j ai une erreur de compilaton mercI de faire un geste

#2 Message par anthony »

Voila le code mais bon sans être méchant soit ça était soit modifier soit ça été codée avec les pied car 20000 faute dans même pas 50 ligne de code O_o , enfin bref je vais pas corriger ton code pour que ton ea marche , j'ai juste corriger les erreur de compilation ;)



//+------------------------------------------------------------------+
//| Igateway.mq4 |
//| Copyright © 2011, Nicolas Tuffier |
//| http://www.furyweb.fr/forex/ |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2011, Nicolas Tuffier"
#property link "http://www.furyweb.fr/forex/"

//--- input parameters
extern string tradeComment="Gateway Managed";
extern double lotSize=0.01;
extern int slippage=2;
string clsVar="TrendSignal";
string opnVar="TrendSignal";

//+------------------------------------------------------------------+
//| expert initialization function |
//+------------------------------------------------------------------+
int init() {
//----
opnVar="TrendSignal"; StringConcatenate("SignalOpen", Symbol(), Period());
clsVar="TrendSignal"; StringConcatenate("SignalClose", Symbol(), Period());
return(0);
}

//----
int deinit(){
return(0);
//----
}

//+------------------------------------------------------------------+
//| expert start function |
//+------------------------------------------------------------------+
int start()
{
//----
int op;
double price;
color col;

if (GlobalVariableCheck(opnVar)) {
op = GlobalVariableGet(opnVar);
GlobalVariableDel(opnVar);
if (op == OP_BUY) {
col = Lime;
price = Ask;
}
if (op == OP_BUY) {
col = Red;
price = Bid;
}
OrderSend(Symbol(), op, lotSize, price, slippage, 0, 0, tradeComment, 0, 0, col);
}

if (GlobalVariableCheck(clsVar)) {
op = GlobalVariableGet(clsVar);
GlobalVariableDel(clsVar);
if (op == OP_BUY) {
col = Lime;
price = Bid;
} else {
col = Red;
price = Ask;
}
int n = OrdersTotal();
for (int i = 0; i < n; i++)
{
if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES))
{
if (OrderType() == op && OrderComment() == tradeComment)
{
OrderClose(OrderTicket(), OrderLots(), price, slippage, col);
}
}

}
}

//----
return(0);
}

//+------------------------------------------------------------------+
//| expert deinitialization function |
//+------------------------------------------------------------------+

//----

furynick
Nouveau
Messages : 1
Inscription : 15 janv. 2013, 19:46

Re: salut j ai une erreur de compilaton mercI de faire un geste

#3 Message par furynick »

Je suis flatté de voir mon nom apparaitre ... mais je l'aurais été encore plus si le code était de moi.

Et dire que c'est codé avec les pieds pour ça, c'est presque un compliment.

Répondre