Rejoindre la communauté
banner_forum
Devenez membre de la plus grande
communauté francophone sur le Forex
Partagez, échangez et apprenez en gagnant des crédits sur votre compte de trading

MULTISTAR GG V2

  • lefeuvr3

    Eurusd 1 minute sur ... 1 mois.

    Mis en Réel ,il peine à démarrer ?

    Code
    //+------------------------------------------------------------------+ //| MULTISTAR GG V2.mq4 | //| Copyright 2019, MetaQuotes Software Corp. | //| https://www.mql5.com | //+------------------------------------------------------------------+ #property copyright "Copyright 2019, MetaQuotes Software Corp." #property link "https://www.mql5.com" #property version "1.00" //#property strict //+------------------------------------------------------------------+ extern double LotFactor =40; //lotsize factor double lot; extern int MagicNumber=10519; extern string mn="MULTISTAR GG V2"; extern double StopLoss=0; extern double TakeProfit=24; extern int TrailingStop=9; extern int Slippage=3; extern int A1=5; extern int A2=5; extern int A3=11; extern int A4=7; extern int ecartask=14; extern int ecartbid=0; int ras; double TP=0,SL=0,TR; extern int Start_Time = 0; // Time to allow trading to start ( hours of 24 hr clock ) 0 for both disables extern int Finish_Time = 0; // Time to stop trading ( hours of 24 hr clock ) 0 for both disables //+------------------------------------------------------------------+ //| Hidden StopLoss Calculations | //+------------------------------------------------------------------+ void StpLoss() { double MyPoint=Point; if(Digits==3 || Digits==5) MyPoint=Point*10; new_del () ; TP=TakeProfit*MyPoint; SL=StopLoss*MyPoint; double OrdP=0,OrdTP=0,OrdSL=0; for(int i=0; i<OrdersTotal(); i++) { if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES)) if(OrderMagicNumber()==MagicNumber && Symbol()==OrderSymbol()) { OrdP=OrderProfit()-MathAbs(OrderSwap())-MathAbs(OrderCommission()); OrdSL=(-1)*SL*OrderLots()*MarketInfo(OrderSymbol(),MODE_TICKVALUE)/Point; OrdTP=TP*OrderLots()*MarketInfo(OrderSymbol(),MODE_TICKVALUE)/Point; if(OrdP>OrdTP || OrdP<OrdSL) { if(OrderType()==OP_BUYSTOP) bool OrdClP=OrderClose(OrderTicket(),OrderLots(),Bid,Slippage,clrGreen); if(OrderType()==OP_SELLSTOP) bool OrdClL=OrderClose(OrderTicket(),OrderLots(),Ask,Slippage,clrYellow); } } } } //+------------------------------------------------------------------+ //| Trailing Stop | //+------------------------------------------------------------------+ void trail() { for(int i=0; i<OrdersTotal(); i++) { if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES)) if(OrderSymbol()==Symbol()) { if(OrderType()==OP_BUYSTOP) { if(Bid - OrderOpenPrice() > TrailingStop * MarketInfo(OrderSymbol(),MODE_POINT)) { if(OrderStopLoss() < Bid - TrailingStop * MarketInfo(OrderSymbol(), MODE_POINT)) { bool modify1=OrderModify(OrderTicket(),OrderOpenPrice(),Bid-TrailingStop*MarketInfo(OrderSymbol(),MODE_POINT),OrderTakeProfit(),Red); } } } else if(OrderType()==OP_SELLSTOP) { if(OrderOpenPrice()-Ask>TrailingStop*MarketInfo(OrderSymbol(),MODE_POINT)) { if((OrderStopLoss()>Ask+TrailingStop*MarketInfo(OrderSymbol(),MODE_POINT)) || (OrderStopLoss()==0)) { bool modify2=OrderModify(OrderTicket(),OrderOpenPrice(), Ask+TrailingStop*MarketInfo(OrderSymbol(),MODE_POINT),OrderTakeProfit(),Red); } } } } } } //+------------------------------------------------------------------+ //+------------------------------------------------------------------+ // expert start function //+------------------------------------------------------------------+ int start() { if(TimeHour(TimeCurrent())>=Start_Time && TimeHour(TimeCurrent())<=Finish_Time )return(0); double MyPoint=Point; if(Digits==3 || Digits==5) MyPoint=Point*10; new_del () ; double TheStopLoss=0; double TheTakeProfit=0; if( TotalOrdersCount()==0 ) { int result=0; if (Close[A1]>Close[A2]) // Here is your open Buy rule { //if (!IsTradeContextBusy() && IsTradeAllowed()) result= OrderSend(Symbol(),OP_BUYSTOP, (AccountEquity() * 0.01 /LotFactor),Ask+ecartask*Point,5,(Ask+ecartask*Point)-StopLoss*Point,(Ask+ecartask*Point)+TakeProfit*Point,"MULTISTAR GG V2",MagicNumber,0,clrBlue); if(result>0) { TheStopLoss=0; TheTakeProfit=0; if(TakeProfit>0) TheTakeProfit=Ask+TakeProfit*MyPoint; if(StopLoss>0) TheStopLoss=Ask-StopLoss*MyPoint; if(OrderSelect(result,SELECT_BY_TICKET)) bool modif1=OrderModify(OrderTicket(),OrderOpenPrice(),NormalizeDouble(TheStopLoss,Digits),NormalizeDouble(TheTakeProfit,Digits),0,Green); } return(0); } if (Close[A3]<Close[A4]) // Here is your open Sell rule { //if (!IsTradeContextBusy() && IsTradeAllowed()) result= OrderSend(Symbol(),OP_SELLSTOP, (AccountEquity() * 0.01 /LotFactor),Bid-ecartbid*Point,5,(Bid-ecartbid*Point)+StopLoss*Point,(Bid-ecartbid*Point)-TakeProfit*Point,"MULTISTAR GG V2",MagicNumber,0,clrBlue); if(result>0) { TheStopLoss=0; TheTakeProfit=0; if(TakeProfit>0) TheTakeProfit=Bid-TakeProfit*MyPoint; if(StopLoss>0) TheStopLoss=Bid+StopLoss*MyPoint; if(OrderSelect(result,SELECT_BY_TICKET)) bool modif2=OrderModify(OrderTicket(),OrderOpenPrice(),NormalizeDouble(TheStopLoss,Digits),NormalizeDouble(TheTakeProfit,Digits),0,Green); } return(0); } } for(int cnt=0;cnt<OrdersTotal();cnt++) { if(OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES)) if(OrderType()<=OP_SELLSTOP && OrderSymbol()==Symbol() && OrderMagicNumber()==MagicNumber ) { if(OrderType()==OP_BUYSTOP) { if(TrailingStop>0) { if(Bid-OrderOpenPrice()>MyPoint*TrailingStop) { if(OrderStopLoss()<Bid-MyPoint*TrailingStop) { bool modif3= OrderModify(OrderTicket(),OrderOpenPrice(),Bid-TrailingStop*MyPoint,OrderTakeProfit(),0,Green); return(0); } } } } else { if(TrailingStop>0) { if((OrderOpenPrice()-Ask)>(MyPoint*TrailingStop)) { if((OrderStopLoss()>(Ask+MyPoint*TrailingStop)) || (OrderStopLoss()==0)) { bool modif4=OrderModify(OrderTicket(),OrderOpenPrice(),Ask+MyPoint*TrailingStop,OrderTakeProfit(),0,Red); return(0); } } } } } } return(0); } int TotalOrdersCount() { int result=0; for(int i=0;i<OrdersTotal();i++) { if(OrderSelect(i,SELECT_BY_POS ,MODE_TRADES)) if (OrderMagicNumber()==MagicNumber) result++; } return (result); } //+------------------------------------------------------------------+ //insuring its a new candle function //+------------------------------------------------------------------+ bool IsNewCandle() { static int BarsOnChart=0; if (Bars == BarsOnChart) return (false); BarsOnChart = Bars; return(true); } //+------------------------------------------------------------------+ //| Expert tick function | //+------------------------------------------------------------------+ void OnTick() { int total=OrdersTotal(); int i; double OpenLongOrders=0,OpenShortOrders=0,PendLongs=0,PendShorts=0; if(total==0 && OpenLongOrders==0 && OpenShortOrders==0 && PendLongs==0 && PendShorts==0) { sellstop(); buystop(); } for(i=0;i<total;i++) { if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES)) if(OrderSymbol()==Symbol() && OrderMagicNumber()==MagicNumber) { int type=OrderType(); if(type == OP_BUYSTOP ) {PendLongs=PendLongs+1;} if(type == OP_SELLSTOP ) {PendShorts=PendShorts+1;} if(total==1 && OpenLongOrders==0 && OpenShortOrders==0 && (PendLongs==1 || PendShorts==1)) { deleteallpendingorders(); } } } } //+------------------------------------------------------------------+ //| sellstop | //+------------------------------------------------------------------+ void sellstop() { int ticket =OrderSend(Symbol(),OP_SELLSTOP, (AccountEquity() * 0.01 /LotFactor),Bid-ecartbid*Point,5,(Bid-ecartbid*Point)+StopLoss*Point,(Bid-ecartbid*Point)-TakeProfit*Point,"MULTISTAR GG V2",MagicNumber,0,clrBlue); if (GetLastError()!=0) Print(" SELL Order Error "+(string)ticket); } //+------------------------------------------------------------------+ //| buystop | //+------------------------------------------------------------------+ void buystop() { int ticket= OrderSend(Symbol(),OP_BUYSTOP, (AccountEquity() * 0.01 /LotFactor),Ask+ecartask*Point,5,(Ask+ecartask*Point)-StopLoss*Point,(Ask+ecartask*Point)+TakeProfit*Point,"MULTISTAR GG V2",MagicNumber,0,clrBlue); if (GetLastError()!=0) Print(" BUY Order Error "+(string)ticket); } //+------------------------------------------------------------------+ //| deleteallpendingorders | //+------------------------------------------------------------------+ void deleteallpendingorders() { for(int i=0;i<OrdersTotal();i++) { if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES)) if(OrderSymbol()==Symbol() && OrderMagicNumber()==MagicNumber && ((OrderType()==OP_BUYSTOP) || (OrderType()==OP_SELLSTOP) )) { bool modify= OrderDelete(OrderTicket()); } } } //+------------------------------------------------------------------+ //-------------------- ( to close pending order) --------------- int new_del() { int i,a; int total = OrdersTotal(); string comentario,par; for (i=total-1; i >=0; i--) { if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES)) if (OrderType()==OP_BUYSTOP || OrderType()==OP_SELLSTOP) { for (a=total-1; a >=0; a--) { if(OrderSelect(a,SELECT_BY_POS,MODE_TRADES)) if(OrderType()==OP_SELLSTOP) { bool modify1= OrderDelete(OrderTicket()); Print("Deleting SELL_STOP"," Ordertype:",OrderType()); return(1); } if(OrderType()==OP_BUYSTOP) { bool modify2= OrderDelete(OrderTicket()); Print("Deleting BUY_STOP"," Ordertype:",OrderType()); return(1); } } } } return ( 0 ); }

    Code
    Barres en test…..33277 Ticks modelés …..869057 Qualité du modelage….. 25.00% Erreurs des graphiques désaccordés….. 0 Dépot initial…..2000.00 Ecart Actuel….. (5) Profit total net …..704.27 Profit brut…..714.47 Perte brute…..-10.20 Facteur de profit…..70.05 Rémunération espérée…..0.01 Chute absolue…..2.50 Chute maximale…..17.42 (0.64%) Enfoncement relatif…..0.70% (15.40) Total des Trades…..100086 Positions SHORT (vente) gagnées %…..94582 (100.00%) Positions LONG (achat) gagnées %….. 5504 (99.98%) Profits des Trades (% du total) …..100085 (100.00%) Pertes des Trades (% du total) ….. 1 (0.00%) Le plus large gains par trade…..16.08 pertes par trade…..-10.20 Moyenne gains par trade…..0.01 pertes par trade….. -10.20 Maximum gains consécutifs (profit en $)…..66265 (437.86) pertes consécutives (perte en $)…..1 (-10.20) Maximum Gains consécutifs (coups gagnants) …..437.86 (66265) Pertes consécutives (coups perdants)…..-10.20 (1) Moyenne gains consécutifs…..50043 Pertes consécutives…..1
    lefeuvr3 a joint une image
    multistar-gg-v2-12003