Comment coder ? - page 154

 

Kikousi,

Vous pouvez tester par vous-même les meilleures coordonnées. FerruFX et CJA ont utilisé les meilleures solutions pour avoir des positions de coin par défaut avec des entrées utilisateur pour le placement des objets. Vous pouvez également consulter OBJPROP_CORNER.

De plus, essayez de ne pas poster la même demande que vous avez faite. Les utilisateurs voient votre message, et si quelqu'un peut vous aider, il le fera.

Merci pour votre aide.

Edit : En utilisant la propriété coin 0 est en haut à gauche, 1 est en haut à droite, 2 en bas à gauche, 3 en bas à droite. C'est le compte 0.

 

Aide pour le débogage de mon EA

Bonjour, désolé si ce n'est pas le bon forum pour poster et merci de corriger si c'est le cas.

J'ai programmé mon propre EA et j'ai quelques problèmes avec le remplissage des ordres et les ordres stop loss. Quelqu'un pourrait-il m'aider ? Je peux partager l'EA.

Merci

 

codobro,

Je vous remercie beaucoup pour votre aimable réponse.

Je ne posterai plus la même question à partir de maintenant.

J'apprécie votre suggestion.

Dans ce contexte, je comprends que la position supérieure gauche est (0,0), alors quelle est l'indication de la position inférieure droite à ce moment-là ?

Par exemple, puis-je utiliser (250,350) pour l'indication inférieure droite lorsque la position supérieure gauche est (0,0) ?

Je vous remercie d'avance pour votre compréhension de ce qui précède.

 

Le graphique de l'indicateur n'affiche pas toutes les données

Bonjour

Je suis assez bon en programmation C, mais je commence avec MQL4.

Je viens de créer mon premier indicateur et il affiche un tableau partiellement dans la fenêtre séparée.

Par partiellement, je veux dire que si vous faites défiler vers la gauche, rien n'est affiché pour certaines périodes, et si je fais défiler vers la gauche, les données sont affichées pour certaines périodes et ainsi de suite.

Si vous faites défiler vers la droite, les mêmes périodes ne s'affichent pas.

Sinon, je ne vois pas de modèle.

De même, si je passe de 1 min, où je vois des données, à 5 min, par exemple, rien n'est affiché du tout.

Pourquoi toutes les données ne sont-elles pas affichées ? Qu'est-ce que je pourrais avoir manqué ?

 

Bon EA - BESOIN D'AIDE

Hai,

Est-ce que quelqu'un dans ce grand forum, pourrait modifier cet EA sans aucun stop loss.

Merci

//---- paramètres d'entrée ---------------------------------------------+

extern int INCREMENT=35 ;

extern double LOTS=0.1 ;

extern int LEVELS=3 ;

extern double MAX_LOTS=99 ;

extern int MAGIC=1803 ;

extern bool CONTINUE=true ;

extern bool MONEY_MANAGEMENT=false ;

extern int RISK_RATIO=2 ;

//+------------------------------------------------------------------+

bool UseProfitTarget=false ;

bool UsePartialProfitTarget=false ;

int Target_Increment = 50 ;

int First_Target = 20 ;

bool UseEntryTime=false ;

int EntryTime=0 ;

//+------------------------------------------------------------------+

bool Enter=true ;

int nextTP ;

int init()

{

//+------------------------------------------------------------------+

nextTP = First_Target ;

//+------------------------------------------------------------------+

return(0) ;

}

//+------------------------------------------------------------------+

//| fonction de désinitialisation experte |

//+------------------------------------------------------------------+

int deinit()

{

return(0) ;

}

//+------------------------------------------------------------------+

//| fonction de démarrage de l'expert |

//+------------------------------------------------------------------+

int start()

{

int ticket, cpt, profit, total=0, BuyGoalProfit, SellGoalProfit, PipsLot ;

double ProfitTarget=INCREMENT*2, BuyGoal=0, SellGoal=0, spread=(Ask-Bid)/Point, InitialPrice=0 ;

//----

if(INCREMENT<MarketInfo(Symbol(),MODE_STOPLEVEL)+spread) INCREMENT=1+MarketInfo(Symbol(),MODE_STOPLEVEL)+spread ;

if(MONEY_MANAGEMENT) LOTS=NormalizeDouble(AccountBalance()*AccountLeverage()/1000000*RISK_RATIO,0)*MarketInfo(Symbol(),MODE_MINLOT) ;

if(LOTS<MarketInfo(Symbol(),MODE_MINLOT))

{

Comment("Pas assez de marge libre pour commencer") ;

return(0) ;

}

for(cpt=1;cpt<LEVELS;cpt++) PipsLot+=cpt*INCREMENT ;

for(cpt=0;cpt<OrdersTotal();cpt++)

{

OrderSelect(cpt,SELECT_BY_POS,MODE_TRADES) ;

if(OrderMagicNumber()==MAGIC && OrderSymbol()==Symbol())

{

total++ ;

if(!InitialPrice) InitialPrice=StrToDouble(OrderComment()) ;

if(UsePartialProfitTarget && UseProfitTarget && OrderType()<2)

{

double val=getPipValue(OrderOpenPrice(),OrderType()) ;

takeProfit(val,OrderTicket()) ;

}

}

}

if(total<1 && Enter && (!UseEntryTime || (UseEntryTime && Hour()==EntryTime)))

{

if(AccountFreeMargin()<(100*LOTS))

{

Print("Pas assez de marge libre pour commencer") ;

return(0) ;

}

// - Vérification de l'ouverture - Début du cycle

Prix initial=Demande ;

SellGoal=InitialPrice-(LEVELS+1)*INCREMENT*Point ;

BuyGoal=InitialPrice+(LEVELS+1)*INCREMENT*Point ;

for(cpt=1;cpt<=LEVELS;cpt++)

{

OrderSend(Symbol(),OP_BUYSTOP,LOTS,InitialPrice+cpt*INCREMENT*Point,2,SellGoal,BuyGoal,DoubleToStr(InitialPrice,MarketInfo(Symbol(),MODE_DIGITS)),MAGIC,0) ;

OrderSend(Symbol(),OP_SELLSTOP,LOTS,InitialPrice-cpt*INCREMENT*Point,2,BuyGoal+spread*Point,SellGoal+spread*Point,DoubleToStr(InitialPrice,MarketInfo(Symbol(),MODE_DIGITS)),MAGIC,0) ;

}

} // La configuration initiale est terminée - tous les canaux sont configurés.

else // Nous avons des ordres ouverts

{

BuyGoal=InitialPrice+INCREMENT*(LEVELS+1)*Point ;

SellGoal=InitialPrice-INCREMENT*(LEVELS+1)*Point ;

total=OrdersHistoryTotal() ;

for(cpt=0;cpt<total;cpt++)

{

OrderSelect(cpt,SELECT_BY_POS,MODE_HISTORY) ;

if(OrderSymbol()==Symbol() && OrderMagicNumber()==MAGIC && StrToDouble(OrderComment())==InitialPrice){EndSession();return(0);}

}

if(UseProfitTarget && CheckProfits(LOTS,OP_SELL,true,InitialPrice)>ProfitTarget) {EndSession();return(0);}

BuyGoalProfit=CheckProfits(LOTS,OP_BUY,false,InitialPrice) ;

SellGoalProfit=CheckProfits(LOTS,OP_SELL,false,InitialPrice) ;

if(BuyGoalProfit<ProfitTarget)

// - Incriminations Lots Buy

{

for(cpt=LEVELS;cpt>=1 && BuyGoalProfit<ProfitTarget;cpt--)

{

if(Ask<=(InitialPrice+(cpt*INCREMENT-MarketInfo(Symbol(),MODE_STOPLEVEL))*Point)))

{

ticket=OrderSend(Symbol(),OP_BUYSTOP,cpt*LOTS,InitialPrice+cpt*INCREMENT*Point,2,SellGoal,BuyGoal,DoubleToStr(InitialPrice,MarketInfo(Symbol(),MODE_DIGITS)),MAGIC,0) ;

}

if(ticket>0) BuyGoalProfit+=LOTS*(BuyGoal-InitialPrice-cpt*INCREMENT*Point)/Point ;

}

}

if(SellGoalProfit<ProfitTarget)

// - Incrémenter la vente de lots

{

for(cpt=LEVELS;cpt>=1 && SellGoalProfit<ProfitTarget;cpt--)

{

if(Bid>=(InitialPrice-(cpt*INCREMENT-MarketInfo(Symbol(),MODE_STOPLEVEL))*Point)))

{

ticket=OrderSend(Symbol(),OP_SELLSTOP,cpt*LOTS,InitialPrice-cpt*INCREMENT*Point,2,BuyGoal+spread*Point,SellGoal+spread*Point,DoubleToStr(InitialPrice,MarketInfo(Symbol(),MODE_DIGITS)),MAGIC,0) ;

}

if(ticket>0) SellGoalProfit+=LOTS*(InitialPrice-cpt*INCREMENT*Point-SellGoal-spread*Point)/Point ;

}

}

}

//+------------------------------------------------------------------+

Comment("mGRID EXPERT ADVISOR ver 2.0\n",

"FX Acc Server :",AccountServer(),"\n",

"Date : ",Month(),"-",Day(),"-",Year()," Server Time : ",Hour()," :",Minute()," :",Seconds(),"\n",

"Taille minimale du lot : ",MarketInfo(Symbol(),MODE_MINLOT),"\n",

"Solde du compte : $",AccountBalance(),"\n",

"Symbole : ", Symbol(),"\n",

"Prix : ",NormalizeDouble(Bid,4),"\n",

"Pip Spread : ",MarketInfo("EURUSD",MODE_SPREAD),"\n",

"Incrément=" + INCREMENT,"\n",

"Lots : ",LOTS,"\n",

"Niveaux : " + NIVEAUX,"\n") ;

return(0) ;

}

//+------------------------------------------------------------------+

int CheckProfits(double LOTS, int Goal, bool Current, double InitialPrice)

{

int profit=0, cpt ;

if(Current)//renvoie le bénéfice actuel

{

for(cpt=0;cpt<OrdersTotal();cpt++)

{

OrderSelect(cpt, SELECT_BY_POS, MODE_TRADES) ;

if(OrderSymbol()==Symbol() && StrToDouble(OrderComment())==InitialPrice)

{

if(OrderType()==OP_BUY) profit+=(Bid-OrderOpenPrice())/Point*OrderLots()/LOTS ;

if(OrderType()==OP_SELL) profit+=(OrderOpenPrice()-Ask)/Point*OrderLots()/LOTS ;

}

}

return(profit) ;

}

sinon

{

if(Goal==OP_BUY)

{

for(cpt=0;cpt<OrdersTotal();cpt++)

{

OrderSelect(cpt, SELECT_BY_POS, MODE_TRADES) ;

if(OrderSymbol()==Symbol() && StrToDouble(OrderComment())==InitialPrice)

{

if(OrderType()==OP_BUY) profit+=(OrderTakeProfit()-OrderOpenPrice())/Point*OrderLots()/LOTS ;

if(OrderType()==OP_SELL) profit-=(OrderStopLoss()-OrderOpenPrice())/Point*OrderLots()/LOTS ;

si(OrderType()==OP_BUYSTOP) profit+=(OrderTakeProfit()-OrderOpenPrice())/Point*OrderLots()/LOTS ;

}

}

return(profit) ;

}

sinon

{

for(cpt=0;cpt<OrdersTotal();cpt++)

{

OrderSelect(cpt, SELECT_BY_POS, MODE_TRADES) ;

if(OrderSymbol()==Symbol() && StrToDouble(OrderComment())==InitialPrice)

{

if(OrderType()==OP_BUY) profit-=(OrderOpenPrice()-OrderStopLoss())/Point*OrderLots()/LOTS ;

if(OrderType()==OP_SELL) profit+=(OrderOpenPrice()-OrderTakeProfit())/Point*OrderLots()/LOTS ;

si(OrderType()==OP_SELLSTOP) profit+=(OrderOpenPrice()-OrderTakeProfit())/Point*OrderLots()/LOTS ;

}

}

return(profit) ;

}

}

}

bool EndSession()

{

int cpt, total=OrdersTotal() ;

for(cpt=0;cpt<total;cpt++)

{

Sleep(3000) ;

OrderSelect(cpt,SELECT_BY_POS,MODE_TRADES) ;

if(OrderSymbol()==Symbol() && OrderType()>1) OrderDelete(OrderTicket()) ;

sinon si(OrderSymbol()==Symbol() && OrderType()==OP_BUY) OrderClose(OrderTicket(),OrderLots(),Bid,3) ;

else if(OrderSymbol()==Symbol() && OrderType()==OP_SELL) OrderClose(OrderTicket(),OrderLots(),Ask,3) ;

}

if(!CONTINUE) Enter=false ;

retour(true) ;

}

double getPipValue(double ord,int dir)

{

double val ;

RefreshRates() ;

if(dir == 1) val=(NormalizeDouble(ord,Digits) - NormalizeDouble(Ask,Digits)) ;

sinon val=(NormalizeDouble(Bid,Digits) - NormalizeDouble(ord,Digits)) ;

val = val/Point ;

return(val) ;

}

//========== FONCTION takeProfit

void takeProfit(int current_pips, int ticket)

{

if(OrderSelect(ticket, SELECT_BY_TICKET))

{

if(current_pips >= nextTP && current_pips < (nextTP + Target_Increment))

{

si(OrderType()==1)

{

if(OrderClose(ticket, MAX_LOTS, Ask, 3))

nextTP+=Target_Increment ;

sinon

Print("Erreur lors de la fermeture de l'ordre : ",GetLastError()) ;

}

else

{

if(OrderClose(ticket, MAX_LOTS, Bid, 3))

nextTP+=Target_Increment ;

sinon

Print("Erreur lors de la fermeture de l'ordre : ",GetLastError()) ;

}

}

}

}

 
hkstar98:
Hai,

Y a-t-il quelqu'un dans ce grand forum, qui pourrait modifier cet EA sans aucun stop loss.

Merci

//---- paramètres d'entrée ---------------------------------------------+

extern int INCREMENT=35 ;

extern double LOTS=0.1 ;

extern int LEVELS=3 ;

extern double MAX_LOTS=99 ;

extern int MAGIC=1803 ;

extern bool CONTINUE=true ;

extern bool MONEY_MANAGEMENT=false ;

extern int RISK_RATIO=2 ;

//+------------------------------------------------------------------+

bool UseProfitTarget=false ;

bool UsePartialProfitTarget=false ;

int Target_Increment = 50 ;

int First_Target = 20 ;

bool UseEntryTime=false ;

int EntryTime=0 ;

//+------------------------------------------------------------------+

bool Enter=true ;

int nextTP ;

int init()

{

//+------------------------------------------------------------------+

nextTP = First_Target ;

//+------------------------------------------------------------------+

return(0) ;

}

//+------------------------------------------------------------------+

//| fonction de désinitialisation experte |

//+------------------------------------------------------------------+

int deinit()

{

return(0) ;

}

//+------------------------------------------------------------------+

//| fonction de démarrage de l'expert |

//+------------------------------------------------------------------+

int start()

{

int ticket, cpt, profit, total=0, BuyGoalProfit, SellGoalProfit, PipsLot ;

double ProfitTarget=INCREMENT*2, BuyGoal=0, SellGoal=0, spread=(Ask-Bid)/Point, InitialPrice=0 ;

//----

if(INCREMENT<MarketInfo(Symbol(),MODE_STOPLEVEL)+spread) INCREMENT=1+MarketInfo(Symbol(),MODE_STOPLEVEL)+spread ;

if(MONEY_MANAGEMENT) LOTS=NormalizeDouble(AccountBalance()*AccountLeverage()/1000000*RISK_RATIO,0)*MarketInfo(Symbol(),MODE_MINLOT) ;

if(LOTS<MarketInfo(Symbol(),MODE_MINLOT))

{

Comment("Pas assez de marge libre pour commencer") ;

return(0) ;

}

for(cpt=1;cpt<LEVELS;cpt++) PipsLot+=cpt*INCREMENT ;

for(cpt=0;cpt<OrdersTotal();cpt++)

{

OrderSelect(cpt,SELECT_BY_POS,MODE_TRADES) ;

if(OrderMagicNumber()==MAGIC && OrderSymbol()==Symbol())

{

total++ ;

if(!InitialPrice) InitialPrice=StrToDouble(OrderComment()) ;

if(UsePartialProfitTarget && UseProfitTarget && OrderType()<2)

{

double val=getPipValue(OrderOpenPrice(),OrderType()) ;

takeProfit(val,OrderTicket()) ;

}

}

}

if(total<1 && Enter && (!UseEntryTime || (UseEntryTime && Hour()==EntryTime)))

{

if(AccountFreeMargin()<(100*LOTS))

{

Print("Pas assez de marge libre pour commencer") ;

return(0) ;

}

// - Vérification de l'ouverture - Début du cycle

Prix initial=Demande ;

SellGoal=InitialPrice-(LEVELS+1)*INCREMENT*Point ;

BuyGoal=InitialPrice+(LEVELS+1)*INCREMENT*Point ;

for(cpt=1;cpt<=LEVELS;cpt++)

{

OrderSend(Symbol(),OP_BUYSTOP,LOTS,InitialPrice+cpt*INCREMENT*Point,2,SellGoal,BuyGoal,DoubleToStr(InitialPrice,MarketInfo(Symbol(),MODE_DIGITS)),MAGIC,0) ;

OrderSend(Symbol(),OP_SELLSTOP,LOTS,InitialPrice-cpt*INCREMENT*Point,2,BuyGoal+spread*Point,SellGoal+spread*Point,DoubleToStr(InitialPrice,MarketInfo(Symbol(),MODE_DIGITS)),MAGIC,0) ;

}

} // La configuration initiale est terminée - tous les canaux sont configurés.

else // Nous avons des ordres ouverts

{

BuyGoal=InitialPrice+INCREMENT*(LEVELS+1)*Point ;

SellGoal=InitialPrice-INCREMENT*(LEVELS+1)*Point ;

total=OrdersHistoryTotal() ;

for(cpt=0;cpt<total;cpt++)

{

OrderSelect(cpt,SELECT_BY_POS,MODE_HISTORY) ;

if(OrderSymbol()==Symbol() && OrderMagicNumber()==MAGIC && StrToDouble(OrderComment())==InitialPrice){EndSession();return(0);}

}

if(UseProfitTarget && CheckProfits(LOTS,OP_SELL,true,InitialPrice)>ProfitTarget) {EndSession();return(0);}

BuyGoalProfit=CheckProfits(LOTS,OP_BUY,false,InitialPrice) ;

SellGoalProfit=CheckProfits(LOTS,OP_SELL,false,InitialPrice) ;

if(BuyGoalProfit<ProfitTarget)

// - Incriminations Lots Buy

{

for(cpt=LEVELS;cpt>=1 && BuyGoalProfit<ProfitTarget;cpt--)

{

if(Ask<=(InitialPrice+(cpt*INCREMENT-MarketInfo(Symbol(),MODE_STOPLEVEL))*Point)))

{

ticket=OrderSend(Symbol(),OP_BUYSTOP,cpt*LOTS,InitialPrice+cpt*INCREMENT*Point,2,SellGoal,BuyGoal,DoubleToStr(InitialPrice,MarketInfo(Symbol(),MODE_DIGITS)),MAGIC,0) ;

}

if(ticket>0) BuyGoalProfit+=LOTS*(BuyGoal-InitialPrice-cpt*INCREMENT*Point)/Point ;

}

}

if(SellGoalProfit<ProfitTarget)

// - Incrémenter la vente de lots

{

for(cpt=LEVELS;cpt>=1 && SellGoalProfit<ProfitTarget;cpt--)

{

if(Bid>=(InitialPrice-(cpt*INCREMENT-MarketInfo(Symbol(),MODE_STOPLEVEL))*Point)))

{

ticket=OrderSend(Symbol(),OP_SELLSTOP,cpt*LOTS,InitialPrice-cpt*INCREMENT*Point,2,BuyGoal+spread*Point,SellGoal+spread*Point,DoubleToStr(InitialPrice,MarketInfo(Symbol(),MODE_DIGITS)),MAGIC,0) ;

}

if(ticket>0) SellGoalProfit+=LOTS*(InitialPrice-cpt*INCREMENT*Point-SellGoal-spread*Point)/Point ;

}

}

}

//+------------------------------------------------------------------+

Comment("mGRID EXPERT ADVISOR ver 2.0\n",

"FX Acc Server :",AccountServer(),"\n",

"Date : ",Month(),"-",Day(),"-",Year()," Server Time : ",Hour()," :",Minute()," :",Seconds(),"\n",

"Taille minimale du lot : ",MarketInfo(Symbol(),MODE_MINLOT),"\n",

"Solde du compte : $",AccountBalance(),"\n",

"Symbole : ", Symbol(),"\n",

"Prix : ",NormalizeDouble(Bid,4),"\n",

"Pip Spread : ",MarketInfo("EURUSD",MODE_SPREAD),"\n",

"Incrément=" + INCREMENT,"\n",

"Lots : ",LOTS,"\n",

"Niveaux : " + NIVEAUX,"\n") ;

return(0) ;

}

//+------------------------------------------------------------------+

int CheckProfits(double LOTS, int Goal, bool Current, double InitialPrice)

{

int profit=0, cpt ;

if(Current)//renvoie le bénéfice actuel

{

for(cpt=0;cpt<OrdersTotal();cpt++)

{

OrderSelect(cpt, SELECT_BY_POS, MODE_TRADES) ;

if(OrderSymbol()==Symbol() && StrToDouble(OrderComment())==InitialPrice)

{

if(OrderType()==OP_BUY) profit+=(Bid-OrderOpenPrice())/Point*OrderLots()/LOTS ;

if(OrderType()==OP_SELL) profit+=(OrderOpenPrice()-Ask)/Point*OrderLots()/LOTS ;

}

}

return(profit) ;

}

sinon

{

if(Goal==OP_BUY)

{

for(cpt=0;cpt<OrdersTotal();cpt++)

{

OrderSelect(cpt, SELECT_BY_POS, MODE_TRADES) ;

if(OrderSymbol()==Symbol() && StrToDouble(OrderComment())==InitialPrice)

{

if(OrderType()==OP_BUY) profit+=(OrderTakeProfit()-OrderOpenPrice())/Point*OrderLots()/LOTS ;

if(OrderType()==OP_SELL) profit-=(OrderStopLoss()-OrderOpenPrice())/Point*OrderLots()/LOTS ;

si(OrderType()==OP_BUYSTOP) profit+=(OrderTakeProfit()-OrderOpenPrice())/Point*OrderLots()/LOTS ;

}

}

return(profit) ;

}

sinon

{

for(cpt=0;cpt<OrdersTotal();cpt++)

{

OrderSelect(cpt, SELECT_BY_POS, MODE_TRADES) ;

if(OrderSymbol()==Symbol() && StrToDouble(OrderComment())==InitialPrice)

{

if(OrderType()==OP_BUY) profit-=(OrderOpenPrice()-OrderStopLoss())/Point*OrderLots()/LOTS ;

if(OrderType()==OP_SELL) profit+=(OrderOpenPrice()-OrderTakeProfit())/Point*OrderLots()/LOTS ;

si(OrderType()==OP_SELLSTOP) profit+=(OrderOpenPrice()-OrderTakeProfit())/Point*OrderLots()/LOTS ;

}

}

return(profit) ;

}

}

}

bool EndSession()

{

int cpt, total=OrdersTotal() ;

for(cpt=0;cpt<total;cpt++)

{

Sleep(3000) ;

OrderSelect(cpt,SELECT_BY_POS,MODE_TRADES) ;

if(OrderSymbol()==Symbol() && OrderType()>1) OrderDelete(OrderTicket()) ;

sinon si(OrderSymbol()==Symbol() && OrderType()==OP_BUY) OrderClose(OrderTicket(),OrderLots(),Bid,3) ;

else if(OrderSymbol()==Symbol() && OrderType()==OP_SELL) OrderClose(OrderTicket(),OrderLots(),Ask,3) ;

}

if(!CONTINUE) Enter=false ;

retour(true) ;

}

double getPipValue(double ord,int dir)

{

double val ;

RefreshRates() ;

if(dir == 1) val=(NormalizeDouble(ord,Digits) - NormalizeDouble(Ask,Digits)) ;

sinon val=(NormalizeDouble(Bid,Digits) - NormalizeDouble(ord,Digits)) ;

val = val/Point ;

return(val) ;

}

//========== FONCTION takeProfit

void takeProfit(int current_pips, int ticket)

{

if(OrderSelect(ticket, SELECT_BY_TICKET))

{

if(current_pips >= nextTP && current_pips < (nextTP + Target_Increment))

{

si(OrderType()==1)

{

if(OrderClose(ticket, MAX_LOTS, Ask, 3))

nextTP+=Target_Increment ;

sinon

Print("Erreur lors de la fermeture de l'ordre : ",GetLastError()) ;

}

else

{

if(OrderClose(ticket, MAX_LOTS, Bid, 3))

nextTP+=Target_Increment ;

sinon

Print("Erreur lors de la fermeture de l'ordre : ",GetLastError()) ;

}

}

}

}

Bonjour

voilà

Dossiers :
new.mq4  8 kb
 

codersguru:
jdun,

Le code du SL & TP est déjà écrit dans cet EA :

Regardez ces lignes :

if (Symbol()=="GBPUSD") {

PipsForEntry= 13;

TrailingStop = 40;

TakeProfit = 45;

InitialStopLoss=33;

} else if (Symbol()=="EURUSD") {

PipsForEntry= 13;

TrailingStop = 30;

TakeProfit = 45;

InitialStopLoss=23;

} else if (Symbol()=="USDCHF") {

PipsForEntry= 13;

TrailingStop = 30;

TakeProfit = 45;

InitialStopLoss=15;

} else {

PipsForEntry= 13;

TrailingStop = 30;

TakeProfit = 45;

InitialStopLoss=30;

} [/PHP]

If you want to make SL & TP external variables which you can set, you have to comment the above lines of code and uncomment these lines:

[PHP]/*

extern int PipsForEntry= 5;

extern double TrailingStop = 40;

extern double TakeProfit = 120;

extern double InitialStopLoss=50;

*/
 

Nombre maximum de transactions par signal

Quelqu'un sait-il ce que je dois utiliser pour limiter le nombre de transactions par signal (je voudrais une transaction par signal, mais j'en obtiens huit et la dernière est toujours perdante) ?

 

Aide

Hai,

Il y a toujours un stop loss

pghiaci:
Salut, voilà
 

EA avec plusieurs temps PERSONNALISÉS ?

Je me rends compte qu'un EA peut être créé avec plusieurs cadres temporels, MAIS peut-on en écrire un avec des temps personnalisés ? J'ai un EA avec MTF mais j'ai besoin de temps personnalisés et non de temps par défaut, donc ils ne s'alignent pas si souvent.

Salutations

Raison: