Need a restart function of my EA

MQL4 Asesores Expertos C++

Trabajo finalizado

Plazo de ejecución 55 minutos
Comentario del Cliente
Exellent work and great programmer thank you again
Comentario del Ejecutor
Good Customer Thanks

Tarea técnica

Hello,
I would need my EA to start from the beginning (as if I dragged the EA on the chart)
when I close the order from the terminal by clicking on the cross

Exemple 

I drag my EA on the chart, it opens at a price for example 1.35240 and afterwards it is doing very good work.
But when I close the order from the terminal the EA immediately opens an order and that's a problem for me.
what I would like is that when I close the order from the terminal is that my order opens only to the given value 1.35240.

Complete Code


//+------------------------------------------------------------------+
//|                                                       test35.mq4 |
//|                                                              xxx |
//|                                              http://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "xxx"
#property link      "http://www.mql5.com"
#property version   "1.00"
#property strict
extern double lots=0.50;
extern int TakeProfit=12;
extern int StopLoss=5;
extern int magic=165276;
extern double Level = 1.34400;


bool RunOnce=false;
//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
  {
   RunOnce=false;
   MathSrand(GetTickCount());
   if(Digits==5 || Digits==3)
     {
      TakeProfit  *=10;
      StopLoss    *=10;
     }
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
//---
  }
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
{
   int ticet;
   int t=MathRand();
  
   if(CountVsego()==0)
        {
      if(t>16384)
        {
         if(RunOnce || (Ask ==Level && Level !=0))
         {
            ticet=OrderSend(Symbol(),OP_BUY,lots,Ask,3,Bid-StopLoss*Point,Ask+TakeProfit*Point,"a",magic,0,clrGreen);
            if(ticet>0)
            {
               RunOnce=true;
            }
         }
        } 
     else if(t<16384)
        {
         if(RunOnce || (Bid ==Level && Level !=0))
         {
            ticet=OrderSend(Symbol(),OP_SELL,lots,Bid,3,Ask+StopLoss*Point,Bid-TakeProfit*Point,"a",magic,0,clrRed);
            if(ticet>0)
            {
               RunOnce=true;
            }
         }
        }
     }
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
int CountSELL()
  {
   int count=0;
   int i;
   for(i=OrdersTotal()-1;i>=0;i--)
     {
      if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES))
        {
         if(OrderSymbol()==Symbol() && OrderMagicNumber()==magic && OrderType()==OP_SELL)
            count++;
        }
     }
   return(count);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
int CountBUY()
  {
   int count=0;
   int i;
   for(i=OrdersTotal()-1;i>=0;i--)
     {
      if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES))
        {
         if(OrderSymbol()==Symbol() && OrderMagicNumber()==magic && OrderType()==OP_BUY)
            count++;
        }
     }
   return(count);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
int CountVsego()
  {
   int Vsego;
   Vsego=CountBUY()+CountSELL();

   return(Vsego);
  }
//+------------------------------------------------------------------+

Han respondido

1
Desarrollador 1
Evaluación
(620)
Proyectos
680
57%
Arbitraje
25
16% / 60%
Caducado
228
34%
Libre
2
Desarrollador 2
Evaluación
(48)
Proyectos
73
37%
Arbitraje
22
9% / 41%
Caducado
14
19%
Trabaja
3
Desarrollador 3
Evaluación
(31)
Proyectos
42
26%
Arbitraje
10
20% / 50%
Caducado
8
19%
Libre
Solicitudes similares
Hi, I want to make an automated system to take my place in making trading positions and closing it. But I want to ask , can you program it to draw a trend line in a specific chart and several moving averages should be in specific order, and when the price is near the trend line by few pips, we shift to 15 minutes chart and noticing a resistance or support action , then we take the trade ? can we do that
Hello, I‘m interested in an indicator to predict the next candles probability (bullish or bearish). But honestly I have no idea how to do this. Would be interested in your opinion how we can create such an indicator. Please let me know if you‘ve done similar work
Hello The EA will work on particular zone choose by the user and can mark it on any TF and with some rules can open trades and mange the trade by some unique rules. the EA need to check the difference by RSI as well and with some extra rules . developer should have good attitude and good communication (englsih) with high performence and knowledge with coding EA. # MANUAL ZONE MARKING # THREE TYPES OF ENTRIES (
There are six conditions in total . source code from an existing expert will be provided to aid the completion of this job . - Install the following by the Panel (copy paste form my existing Expert ) 1. Pips Lost : number of pips lost ( monthly reset ) 2. Pips Gained : number of pips gained ( monthly reset ) 3. Have a black background to avoid the
Hey greetings. Am in need of a developer that has already made profitable MT4 or MT5 EA that I can buy with the backtesting and proven result. How is the draw down ? What is the winning rate ? Kindly reply and let proceed
I need a TradingView script (not mine) converted to an Mt5 EA. There is some specifications for the robots on when to be able to take a trade. Attached bellow is the file of the script I want translated and converted to MT5 then EA
GOODAY TO YOU I AM NEED OF A FAST, TALENTED AND HIGH QUALITY CODER TO THIS JOB FOR ME. THE EA TRADE MANAGER WILL HAVE THE FOLLOWING: STOPLOSS & TAKEPROFIT IN PIPS LOT SIZE IN PIPS NUMBER OF TRADES (1-30 TRADES MAXIMUM) PLEASE LOOK AT THE PICTURE ABOVE FOR A GUIDE
evalq({ #نوع دالة التنشيط. الحقيقة <- c( "sig" , #: sigmoid "sin" , #: sine "radbas" , #: radial basis "hardlim" , #: hard-limit "hardlims" , #: symmetric hard-limit "satlins" , #: satlins "tansig" , #: tan -sigmoid "tribas" , #: triangular basis "poslin" , #: positive linear "purelin" ) #: linear السندات
Hello, I want to create an EA with the belowspecification. EA will check conditions based on following input parameters: ● High Price ● Low Price ● Move Value (in Price) ● Gap (in price) After start, EA will mark High and Low prices based on input parameters. EA will start trading when the current price will hit any of the price POSITION at High , Low, Control Buy or Control Sell . EA will open
Necesito una placa EA que me permita ejecutar órdenes buy limit sell limit buy stop sell stop pero estas órdenes su tp su stop loss si triling stopp su punto de equilibrio debe ser virtual y algunas especificaciones mas solo aplican si tienes experiencia adjunta un ejemplo quiero algo como esto pero mas simple https://www.mql5.com/es/market/product/73489?source=Site +Market+MT5+Search+Rating006%3aEasyGRID+MT5

Información sobre el proyecto

Presupuesto
30+ USD
IVA (20%): 6 USD
Total: 36 USD
Para el ejecutor
27 USD
Plazo límite de ejecución
a 10 día(s)