//+------------------------------------------------------------------+ //| DIC_EA.mq4 | //| Copyright 2020, DIC Consulting Sarl. | //| https://www.mql5.com | //+------------------------------------------------------------------+ #property copyright "Copyright 2020, DIC Consulting Sarl." #property link "https://www.mql5.com" #property version "1.00" #property strict #include extern int nt = 5 ; // Number of trade //+------------------------------------------------------------------+ //| Expert initialization function | //+------------------------------------------------------------------+ int OnInit() { //--- //--- Comment("Trade initialise to :" + nt); Sleep(3000); return(INIT_SUCCEEDED); } //+------------------------------------------------------------------+ //| Expert deinitialization function | //+------------------------------------------------------------------+ void OnDeinit(const int reason) { //--- } //+------------------------------------------------------------------+ //| Expert tick function | //+------------------------------------------------------------------+ int start() { //--- // Comment("OnTick"); // total = OrdersTotal() Comment("Order total " + OrdersTotal()); // Comment("Total trade: " + nt); // Comment( "Balance: " + AccountBalance()); GesPos(); return(0); } //+------------------------------------------------------------------+ void GesPos() { int cpt = 0; if( OrdersTotal() > 0) { // /*for( int j = 0 ; j < nt ; j++) {*/ for(int i = 0; i