salut j ai une erreur de compilaton mercI de faire un geste
Publié : 21 nov. 2012, 18:52
//+------------------------------------------------------------------+
//| 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);
}
//+------------------------------------------------------------------+
//| 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);
}
//+------------------------------------------------------------------+