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

MODULO VERSION .1....GAIN EN FONCTION DE LA MISE DE DÉPART

  • lefeuvr3

    MODULO VERSION 1
    EURUSD 1 minute sur un an


    250 MISE DE DEPART 24 TRADES 2203 AU BOUT D’UN AN COEFF MULTIPLICATEUR 8.8
    500 MISE DE DEPART 15 TRADES 1220 AU BOUT D’UN AN COEFF MULTIPLICATEUR 2.44
    750 MISE DE DEPART 18 TRADES 1703 AU BOUT D’UN AN COEFF MULTIPLICATEUR 2.27
    1000 MISE DE DEPART 22 TRADES 2187 AU BOUT D’UN AN COEFF MULTIPLICATEUR 2.18
    1250 MISE DE DEPART 28 TRADES 3169 AU BOUT D’UN AN COEFF MULTIPLICATEUR 2.27
    1500 MISE DE DEPART 26 TRADES 2916 AU BOUT D’UN AN COEFF MULTIPLICATEUR 1.94
    1750 MISE DE DEPART 60 TRADES 7091 AU BOUT D’UN AN COEFF MULTIPLICATEUR 4.05
    2000 MISE DE DEPART 78 TRADES 9300 AU BOUT D’UN AN COEFF MULTIPLICATEUR 4.65

    Code
    //+------------------------------------------------------------------+ //| MODULO VERSION 1.mq4 | //| QPG | //| https://www.mql5.com | //+------------------------------------------------------------------+ #property copyright "QPG" #property link "https://www.mql5.com" #property version "1.00" //+------------------------------------------------------------------+ //| MODULO LOTS AUTOAJUSTES version 1 | //+------------------------------------------------------------------+ //+------------------------------------------------------------------+ //| PARAMETRES EURUSD 1 MN LONG ET SHORT | //+------------------------------------------------------------------+ int MagicNumber=20180810; //magic double LotSize; //lotsize extern string mm="Maximum Drawdown "; extern double LotFactor = 100; //lotsize factor double pips = 0.00001; //leave as default for 5 digit brokers int stopOK = 0; // ne pas modifier int sendOK = 0; // ne pas modifier int long_court=1; // 0 = Long & 1 = Court extern int gain=390; // no comment ;) int hour=23; input int ecart=34;// Ecart : 150, 1000, ou 1500 selon les paires int c=0; //+------------------------------------------------------------------+ //| expert initialization function | //+------------------------------------------------------------------+ int init() { return(0); } //+------------------------------------------------------------------+ //| expert deinitialization function | //+------------------------------------------------------------------+ int deinit() { return(0); } //+------------------------------------------------------------------+ //| expert start function | //+------------------------------------------------------------------+ int start() { double MyPoint=Point; if(Digits==3 || Digits==5) MyPoint=Point*10; if(IsNewCandle()) { Lot_Volume(); //calc lotsize return(0); } //MODIF*********** if (!IsTradeContextBusy() && IsTradeAllowed()) if(c==0){if(OrderSend(Symbol(), OP_BUY, 0.01, Ask, 0, 0, 0, "Ordre 2 !"))c=1;} //MODIF*********** Comment(AccountEquity() - AccountBalance()); int type = OrderType(); int type2 = OrderType(); if (Hour()==1 && Minute()==1 && Seconds()==1 && sendOK==0) { sendOK=1;stopOK=0; //+------------------------------------------------------------------+ if(long_court==1) if (!IsTradeContextBusy() && IsTradeAllowed()) { int ticket= OrderSend(Symbol(), OP_SELLSTOP, LotSize, Bid-ecart*pips, 0, 0, 0, "Ordre 2 !"); // if(ticket<0) { Print("OrderSend failed with error #",GetLastError()); } else Print("OrderSend placed successfully"); } //+------------------------------------------------------------------+ if(long_court==0) if (!IsTradeContextBusy() && IsTradeAllowed()) { int ticket1= OrderSend(Symbol(), OP_BUYSTOP, LotSize, Ask+ecart*pips, 0, 0, 0, "Ordre 2 !"); if(ticket1<0) { Print("OrderSend failed with error #",GetLastError()); } else Print("OrderSend placed successfully"); } //+------------------------------------------------------------------+ } if (Hour()>=hour && stopOK==0) { stopOK=1;sendOK=0; int u = OrdersTotal() - 1; while (u >= 0) { if(OrderSelect(u, SELECT_BY_POS)) if (type == OP_SELLSTOP || type == OP_BUYSTOP) { bool modif3= OrderDelete(OrderTicket()); } u -= 1; } } if (AccountEquity()>= AccountBalance()+ gain) { int w = OrdersTotal() - 1; while (w >= 0) { if(OrderSelect(w, SELECT_BY_POS)) { bool modif1= OrderClose(OrderTicket(), OrderLots(), MarketInfo(OrderSymbol(), MODE_BID),2); bool modif2= OrderClose(OrderTicket(), OrderLots(), MarketInfo(OrderSymbol(), MODE_ASK),2); } w -= 1; } //MODIF*********** if (!IsTradeContextBusy() && IsTradeAllowed()) int ticket2=OrderSend(Symbol(), OP_BUY, 0.01, Ask, 0, 0, 0, "Ordre 2 !"); // //--- place market order to buy 1 lot if(ticket<0) { Print("OrderSend failed with error #",GetLastError()); } else Print("OrderSend placed successfully"); //MODIF*********** } return(0); } //+------------------------------------------------------------------+ //insuring its a new candle function //+------------------------------------------------------------------+ bool IsNewCandle() { static int BarsOnChart=0; if (Bars == BarsOnChart) return (false); BarsOnChart = Bars; return(true); } //+------------------------------------------------------------------+ //Calculates Lot Size based on balance and factor //+------------------------------------------------------------------+ double Lot_Volume() { LotSize=AccountBalance() * 0.01 /LotFactor ; return(LotSize); } //+------------------------------------------------------------------+
    lefeuvr3 a joint une image
    0-11486