I am looking for a function for my EA

 
I am looking for a way to activate my EA at a given price.
Example when GBPUSD hits 1.35480 my order opens.

here is the code without the function I'm looking for


Thank you very much to the one who can help me

//+------------------------------------------------------------------+
//|                                                      test35.mq4 |
//|                       Copyright 2014, MetaQuotes Software Corp. |
//|                                              http://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2014, MetaQuotes Software Corp."
#property link      "http://www.mql5.com"
#property version   "1.00"
#property strict
extern double lots=0.50;
extern int TakeProfit=10;
extern int StopLoss=3000;
extern int magic=123456;


//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
  {

   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)
        {
         ticet=OrderSend(Symbol(),OP_BUY,lots,Ask,3,Bid-StopLoss*Point,Ask+TakeProfit*Point,"a",magic,0,clrGreen);
        }
      if(t<16384)
        {
         ticet=OrderSend(Symbol(),OP_SELL,lots,Bid,3,Ask+StopLoss*Point,Bid-TakeProfit*Point,"a",magic,0,clrRed);
        }
     }
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
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);
  }
//+------------------------------------------------------------------+
Automated Trading and Strategy Testing
Automated Trading and Strategy Testing
  • www.mql5.com
Choose a suitable trading strategy and subscribe to it with a few clicks. All Signals are provided with detailed statistics and informative charts. Become a trading signal provider and sell subscriptions to thousands of traders around the world. With the Signals service, your successful strategy can generate income with a small start-up budget...
 
347703: I am looking for a way to activate my EA at a given price
  1. Don't double post!
              General rules and best pratices of the Forum. - General - MQL5 programming forum

  2. When you post code please use the SRC button! Please edit your post.
              General rules and best pratices of the Forum. - General - MQL5 programming forum

  3. Why did you post your MT4 question in the Root / MT5 EA section instead of the MQL4 section, (bottom of the Root page?)
              General rules and best pratices of the Forum. - General - MQL5 programming forum
    Next time post in the correct place. The moderators will likely move this thread there soon.

  4. You don't activate an EA, you put it on the chart and it is active. If you want your active EA to open at a given price you must code it to do so. Show us your attempt and state the nature of your problem.
              No free help
              urgent help.
 
whroeder1:
  1. Don't double post!
              General rules and best pratices of the Forum. - General - MQL5 programming forum

  2. When you post code please use the SRC button! Please edit your post.
              General rules and best pratices of the Forum. - General - MQL5 programming forum

  3. Why did you post your MT4 question in the Root / MT5 EA section instead of the MQL4 section, (bottom of the Root page?)
              General rules and best pratices of the Forum. - General - MQL5 programming forum
    Next time post in the correct place. The moderators will likely move this thread there soon.

  4. You don't activate an EA, you put it on the chart and it is active. If you want your active EA to open at a given price you must code it to do so. Show us your attempt and state the nature of your problem.
              No free help
              urgent help.
sorry for my mistakes I would be more careful next time.
cordialment
Reason: