[WARNING CLOSED!] Any newbie question, so as not to clutter up the forum. Professionals, don't go by. Can't go anywhere without you. - page 145

 
xmurik писал(а) >>
Where is error ?

Apparently too close to the current price. You should check MarketInfo(Symbol(),MODE_STOPLEVEL);

 
Vinin писал(а) >>

Apparently too close to the current price. We should check for MarketInfo(Symbol(),MODE_STOPLEVEL);

It is 210 points to the price. And tester gives error 3.

 
xmurik писал(а) >>

Up to a price of 210 points. And the tester gives error 3.

I think it's set incorrectly, somewhere in the past.

 
xmurik писал(а) >>

Up to a price of 210 points. And the tester gives error 3.

I had this error recently. Somehow I got over it.

 
Please help me find the error. I can't... I don't even know where to look for it. Error like: '\end_of_program' - unbalanced left parenthesis
Files:
 
Alex5757000 писал(а) >>
Please help to find error. I can't find it anymore. I don't even know where to look for it. Error like: '\end_of_program' - unbalanced left parenthesis

if(NormalizeDouble(MathAbs(OrderOpenPrice()-Win_Price),Digits) < NormalizeDouble(Dist,Digits)) // missing closing bracket

 
Vinin >> :

if(NormalizeDouble(MathAbs(OrderOpenPrice()-Win_Price),Digits) < NormalizeDouble(Dist,Digits)) // missing closing bracket

Vinin , thank you very much :-). Sorry for such a ridiculous mistake, I am just beginning to program, I am gaining experience...

 
Roger писал(а) >>

I think it's misdirected, somewhere in the past.

Exactly. That was the problem.

 

I'm back to you for help... I think I finished the EA, .... But I can't seem to close an order according to some specific conditions. I keep getting an error when searching for a ticket or an order number, or else I get an invalid value in my codes when trying to determine which order to close. I do not have a fun- bility of orders, but it seems possible to manage without it, perhaps there is a wrong installation of consecutive operations in the code, but it seems right. Help who can, look at the code, advise what needs to be added to close the order by a condition, make comments on the implementation of the code in terms of correctness of the sequence of processing in the fun-i start, and the feeling that I'm like a loop and in some moments when the condition is not opened order (skipped to the next case) ....... ! !!! ..))) Here is the code!

//+-----------------Включаемые дериктивы-----------------------------+
#include <Param.mqh>          //фун-я параметры 
//#include <Message_Print.mqh>          //фун-я коммент
#include <isTradeTimeString_m.mqh> //фун-я торгов по времени
#include <TrailingStop.mqh>          //фун-я трайлинг 
#include <isNewBar.mqh>       //фун-я проверки нового бара
#include <TotalOrders.mqh>    //фун-я проверки кол-ва открытых сделок
#include <Crit_Flat.mqh>      //фун-я проверки флэт
#include <Crit_Sell.mqh>      //фун-я проверки сигнала  продажи
#include <Crit_Buy.mqh>       //фун-я проверки сигнала  покупки
#include <TakeProfitLastClosePos.mqh>      //фун-я определения профита послед закрыт поз
#include <GetTypeLastClosePos2.mqh>         //функция определения типа закрытой поз
//+-----------------Переменные---------------------------------------+
int               ExpertOrdersTotal;   //общее колличество открытых позиций
int tiket = 0;
int mn = 0;                                //магик


//+------------------------------------------------------------------+
//| expert initialization function                                   |
//+------------------------------------------------------------------+
int init()
  {
//----
   MinStop=MarketInfo(Symbol(),MODE_STOPLEVEL); //минимальное разрешимое отклонение стоп лосс от рыночной цены
//----
   return(0);
  }

int start()
  {

//Print("Проверка открытых ордеров 1");
//---------------------Проверка по времени------------1---------
  if ( tim==true)
   {
   isTradeTimeString(); //торговля по времени
   if ( isTradeTimeString( TimeBegin, TimeEnd))
     {
//---------------------Проверка трейлинга------------2---------
   TrailingStop();


//---------------------Проверка открытых ордеров------------3---------
   ExpertOrdersTotal = TotalBuy()+ TotalSell(); // СКОЛЬКО ВСЕГО ОРДЕРОВ ОТКРЫТО  
   if ( ExpertOrdersTotal>= Sdelki)         // если кол-во открытых сделок меньше максимального
     {                                   // кол-ва сделок, проверяем возможность открытия сделки
      //Print("превышено кол-во сделок,выход"); 
      return(0);
     }   
   else
     {

          Print("проверка появления нового бара ");

//--------------------проверка появления нового бара--------4---------
        Fun_New_Bar();                               // Обращение к функции и передача ей управления
        if ( New_Bar==false)                          // Если бар не новый..
         {
          //Print("Нового бара пока нет,выход");   
          return;                                      // ..то уходим   
         }
        //Print("проверка сигнала ");
//--------------------проверка сигнала----------------------5---------
        Crit_Flat();
      
        Crit_Sell();
        Crit_Buy();
//        Print("коэф-нт покупки ",ves_buy);
//        Print("коэф-нт продажи ",ves_sell);
        
        if ( Flat == true)  //проверка наличия флэта
          {
            return(0);
          }
        if ( Trend==true)  //сделки по тренду
          {
              
              if ( ves_buy < ves_sell) 
                {
                 tiket = OrderSend(Symbol(),OP_SELL, Lot,Bid,3,Bid+ SL*Point,Ask- TP*Point,"My order #", mn,0,Green);
                 Print ("Ордер открыт по тренду"); 
                } 
              if ( ves_buy > ves_sell)
                {
                 tiket = OrderSend(Symbol(),OP_BUY, Lot,Ask,3,Bid- SL*Point,Ask+ TP*Point,"My order #", mn,0,Red);
                 Print ("Ордер открыт по тренду"); 
                } 
          }
        else
          {       
        if ( ves_buy > ves_sell && ves_buy >= param)
           {
             tiket = OrderSend(Symbol(),OP_BUY, Lot,Ask,3,Bid- SL*Point,Ask+ TP*Point,"My order #", mn,0,Red);
             Print ("Ордер открыт по коэфициенту"); 
        //--------------------------------------------------
        //          доработать фун-ю открытия ордера
        //--------------------------------------------------
           }
           
        if ( ves_buy < ves_sell && ves_sell >= param)
           {
            tiket = OrderSend(Symbol(),OP_SELL, Lot,Bid,3,Bid+ SL*Point,Ask- TP*Point,"My order #", mn,0,Green);
            Print ("Ордер открыт по коэфициенту");
        //--------------------------------------------------
        //          доработать фун-ю открытия ордера
        //--------------------------------------------------
           }
          }  
    
//+------------------------------------------------------------------------   
            
       
     }        //скобка проверки колва сделок
  Print("есть сделки, выход");

  }//скобка проверки времени   
 Print ("время не подошло");  
  }//проверка флага торговли по времени 
   return(0);                                  //ретурн основного старта
  }

Here is the code. As I am here, I have one more question ... are there any restrictions on the EA implementation, in terms of multiple recalculation or parameter request from a brokerage company?

i'm waiting for some help and a bit of criticism )

 
Alex5757000 >> :
Please help me to find the error. I can't... I don't even know where to look for it. Error like: '\end_of_program' - unbalanced left parenthesis

Semyon Semyonych...

Learn to write a construction like this:

if(){}

and then start filling it in, then you'll almost never get confused.

Error like: '\end_of_program' - unbalanced left parenthesis is very unpleasant because the compiler can not pinpoint the location of the error, so it is better not to do, but avoid it by the method described above, you can somewhere make a template and paste in the right places.

The next "You can't tuck a cassock into your jeans"

if();{} - это не верная конструкция

>> take it away, your code with the corrections is in the attached file.

Reason: