Any questions from a PROFI to a SUPER PROFI - 1. - page 38

 

It's all bad. Even with versions. Except with scripts.

Here's an example. It's possible to define and retrieve name to version there, but it's a bit tricky.


 
Thank you.
 
TheXpert:

Unless the scripts.

came up with a half-finished method.

Create a new configuration for the compiler. like "Release Main", in which I write the name of the required file.

It's not very automated, but it saves me from a duplicate output file name.

 

Does MQL4 have functions for working with crosshair?

I need to assign the value of price difference in pips to a variable.

 
Syzal:

Does MQL4 have functions for working with crosshair?

I need to assign the value of price difference in pips to a variable.

So assign it, but what is the crosshair for? The scripts do not aim with the cursor ;)
 
Syzal:

Does MQL4 have functions for working with crosshair?

I need to assign a value of price difference in pips to a variable.

Not with crosshair. But there is
CHARTEVENT_MOUSE_MOVE

и

CHARTEVENT_CLICK
 

Gentlemen programmers. I have a question. I am testing one EA on aforex.ru demo account. I sometimes get an error when I open order 138 "New prices". I have not understood why. I open orders through the function below. I have to find the reason of error during the opening. What are your thoughts?

void open_positions(int signal,double lot,double price,double tp,double lev) 
  {
//signal=0 -> сигнал на открытие покупки
//signal=1 -> сигнал на открытие продажи
   int    i=0; //переменная для счётчика цикла
   string symb=Symbol(),com;
   com=DoubleToStr(lev,Digits);
   color col;
   double stop,take;
   int    count=Count_Of_Trade_Try; //количество попыток открытия ордера в случае, если его не удаётся совершить сразу
   int err=0;
   if(signal==OP_BUYLIMIT || signal==OP_BUYSTOP || signal==OP_BUY)
     {
      RefreshRates();
      price=NormalizeDouble(Ask,Digits); //цена открытия для покупок
      col=Green;
     }
   if(signal==OP_SELLLIMIT || signal==OP_SELLSTOP || signal==OP_SELL)
     {
      RefreshRates();
      price=NormalizeDouble(Bid,Digits); //цена открытия для продаж 
      col=Red;
     }
//stop=NormalizeDouble(sl(SL,signal),Digits);

   take=NormalizeDouble(tp,Digits);

   while(i<=count) 
     {
      //сама функия открытия ордера (встроенная). Для удобства восприятия параметры разнесены на разные строки:
      int ticket=OrderSend(symb,//символ
                           signal,        //тип ордера
                           lot,           //объем
                           price,         //цена открытия
                           Slipage,       //уровень допустимого реквота
                           0, //величина Stop Loss
                           0, //величина Take Profit
                           com,//комментарий ордера
                           magic_number,//магическое число
                           0,//срок истечения (используется при отложенных ордерах)
                           CLR_NONE);    //цвет отображаемой стрелки на графике (CLR_NONE - стрелка не рисуется)

      if(ticket!=-1) //если открытие произошло успешно, наносим графический объект и выходим из цикла
        {
         OrderModify(ticket,price,stop,take,0,col);
         break;
        }

      err=GetLastError();
      if(err!=0) Print("Ошибка открытия ("+symb+", "+signal+", "+price+", "+0+", "+take+"): "+Market_Err_To_Str(err));
      i++;
      Sleep(Pause_Of_Trade_Try*100); //в случае ошибки делаем паузу перед новой попыткой
     } //end while(i<=count)
  } //end void open_positions(int signal, double lot, int magic, double price=0.0, string symb="NONE") 
 
Rammik:

Gentlemen programmers. I have a question. I am testing one EA on aforex.ru demo account. I sometimes get an error when I open order 138 "New prices". I have not understood why. I open orders through the function below. I have to find the reason of error during the opening. What are your thoughts?


Somebody who is a professional does not ask such questions. You must be in the wrong branch.
 
Vinin:
Professionals don't ask such questions. You must be in the wrong branch.
Well, if you're such a superprofessional, why don't you tell me what's wrong?!
 
Rammik:
Well, if you're such a superprofessional, maybe you can tell me what's wrong!
I'm not a superprofessional, but I would first ask myself what equals tp