Page 1 sur 1

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

Publié : 21 nov. 2012, 18:52
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);


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

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

Publié : 22 nov. 2012, 18:34
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 |
//+------------------------------------------------------------------+

//----

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

Publié : 15 janv. 2013, 19:52
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.