Salut tt le monde, je suis nouveau en programmation MQL4,
je voulais créer un EA qui ouvre une position d'achat avec un take profit et stop loss mais l'expert advisor ne marche pas je sais pas ou est l'erreur (surtt que je suis encore novice!!!!) aidez-moi SVP
voici le code que j'ai créer:
extern double lots = 3;
extern int stoploss = 0;
extern int takeprofit = 0;
extern int magic1 = 33554;
extern int magic2 = 33559;
extern int slippage = 5;
je voulais créer un EA qui ouvre une position d'achat avec un take profit et stop loss mais l'expert advisor ne marche pas je sais pas ou est l'erreur (surtt que je suis encore novice!!!!) aidez-moi SVP
voici le code que j'ai créer:
extern double lots = 3;
extern int stoploss = 0;
extern int takeprofit = 0;
extern int magic1 = 33554;
extern int magic2 = 33559;
extern int slippage = 5;
Code
//+------------------------------------------------------------------+
//| Expert initialization function |
//+------------------------------------------------------------------+
int OnInit()
{
//---
openbuy();
//---
return(INIT_SUCCEEDED);
}
//+------------------------------------------------------------------+
//| Expert deinitialization function |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
{
//---
}
//+------------------------------------------------------------------+
//| Expert tick function |
//+------------------------------------------------------------------+
void OnTick()
{
//---
}
//+------------------------------------------------------------------+
void openbuy()
{
OrderSend (Symbol(), OP_BUY, lots, Ask, slippage, Ask+takeprofit*Point, NULL, "Buy Trade", magic2, 0, clrAqua);
}
Modifié le 2015-09-28 17:03:27 par
AliX