Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 1164

 
Iosebi Tavadze:
Maybe I'm in the wrong thread. May the gods forgive me. I need to write an indicator, which would give a signal from a combination of four or five indicators installed in the basement. Or a ready-made advisor.Possible advice please!!!!!!!!!!

If you want someone to write it for you, go here.

If you want to do it yourself, tell us what you can't do and post your code.

 
simeon068 :
How can I add an expert advisor to an mql5 folder and for it to show in the advisor section?

In the terminal, in the "File" menu, select "Open data directory" - the explorer will open. In it, go to the MQL5 \ Experts folder - place your adviser in it or in any subfolder. Then in the navigator of the terminal in the menu of the right button select "Update".

 

Can anyone advise!!! what is the warning and how to fix it?

Snapshot3

in this place

// если активны входящие параметры, использующие значение текущей цены по инструменту,
// тогда пытаемся получить текущие значения
   if(hide_PRICE_HIGH>0 || hide_PRICE_LOW>0 || hide_SPREAD>0)
     {
      SymbolInfoTick(name, lastme);
      if(lastme.bid==0)
        {
         Alert("("+name+") Получить значение BID не удалось. Некоторые функции фильтрации могут не работать.");
        }
     }
// Скрыть символы, у которых спред:
   if(hide_SPREAD>0 && lastme.bid>0)
     {
      switch(hide_SPREAD)
        {
         // если текущий спред больше 0.05% от цены - пропускаем символ
         case spread_b05:
            if(((SymbolInfoInteger(name, SYMBOL_SPREAD)*SymbolInfoDouble(name, SYMBOL_POINT))/lastme.bid)*100 > 0.05)
              {
               isskip=true;
              }
            break;
         // если текущий спред больше 0.1% от цены - пропускаем символ
         case spread_b1:
            if(((SymbolInfoInteger(name, SYMBOL_SPREAD)*SymbolInfoDouble(name, SYMBOL_POINT))/lastme.bid)*100 > 0.1)
              {
               isskip=true;
              }
            break;
         // если текущий спред больше 0.15% от цены - пропускаем символ
         case spread_b15:
            if(((SymbolInfoInteger(name, SYMBOL_SPREAD)*SymbolInfoDouble(name, SYMBOL_POINT))/lastme.bid)*100 > 0.15)
              {
               isskip=true;
              }
            break;
         // если текущий спред меньше 0.15% от цены - пропускаем символ
         case spread_l15:
            if(((SymbolInfoInteger(name, SYMBOL_SPREAD)*SymbolInfoDouble(name, SYMBOL_POINT))/lastme.bid)*100 < 0.15)
              {
               isskip=true;
              }
            break;
         // если текущий спред меньше 0.1% от цены - пропускаем символ
         case spread_l1:
            if(((SymbolInfoInteger(name, SYMBOL_SPREAD)*SymbolInfoDouble(name, SYMBOL_POINT))/lastme.bid)*100 < 0.1)
              {
               isskip=true;
              }
            break;
         // если текущий спред != 0.01 - пропускаем символ
         case spread_c1:
            if(SymbolInfoInteger(name, SYMBOL_SPREAD)*SymbolInfoDouble(name, SYMBOL_POINT) > 0.01)
              {
               isskip=true;
              }
            break;
         // если текущий спред > 0.03 - пропускаем символ
         case spread_c3:
            if(SymbolInfoInteger(name, SYMBOL_SPREAD)*SymbolInfoDouble(name, SYMBOL_POINT) > 0.03)
              {
               isskip=true;
              }
            break;
         // если текущий спред > 0.07 - пропускаем символ
         case spread_c7:
            if(SymbolInfoInteger(name, SYMBOL_SPREAD)*SymbolInfoDouble(name, SYMBOL_POINT) > 0.07)
              {
               isskip=true;
              }
            break;
         // если текущий спред > 0.1 - пропускаем символ
         case spread_c10:
            if(SymbolInfoInteger(name, SYMBOL_SPREAD)*SymbolInfoDouble(name, SYMBOL_POINT) > 0.1)
              {
               isskip=true;
              }
            break;
        }
     }
 
Alexsandr San:

Can anyone advise!!! what is the warning and how to fix it?

in this place


I think I fixed it - except I don't know if that's right? Put it out there.

Snapshots corrected

 
Alexsandr San:

Can anyone advise!!! what is the warning and how to fix it?

in this place


You may be using an uninitialised lastme variable. You have it declared without initialization. It's not guaranteed to be filled by SymbolInfoTick()

Declare a variable with initialization right away: MqlTick lastme={0};

 
Artyom Trishkin:

It is possible to use an uninitialised lastme variable. You have it declared without initialization. It's not guaranteed to be filled by SymbolInfoTick().

Declare a variable with initialization right away: MqlTick lastme={0};

Thank you very much! The warning has disappeared. Good health and all the best!!!

--------------------------

I put it back inside - as you have shown.


good utility, i downloaded it from herehttps://www.mql5.com/ru/articles/5614

Files:
finder.mq5  296 kb
finder.mq4  296 kb
 

Can you tell me how to request data from a library?

I'm trying to create an owl with a data entry interface

Looks like this

enter field code

//+------------------------------------------------------------------+
//| Создаёт поле ввода 1                                             |
//+------------------------------------------------------------------+
bool CProgram::CreateSpinEdit1(const int x_gap,const int y_gap,string text)
  {
//--- Сохраним указатель на окно
   m_spin_edit1.WindowPointer(m_window);
//--- Координаты
   int x=m_window.X()+x_gap;
   int y=m_window.Y()+y_gap;
//--- Значение
   double v=(m_spin_edit1.GetValue()==WRONG_VALUE) ? 0 : m_spin_edit1.GetValue();
//--- Установим свойства перед созданием
   m_spin_edit1.XSize(204);
   m_spin_edit1.YSize(24);
   m_spin_edit1.EditXSize(80);
   m_spin_edit1.MaxValue(10000);
   m_spin_edit1.MinValue(0);
   m_spin_edit1.StepValue(10*Point);
   m_spin_edit1.SetDigits(Digits);
   m_spin_edit1.SetValue(v);
   m_spin_edit1.ResetMode(true);
   m_spin_edit1.AreaColor(clrWhite);
//--- Создадим элемент управления
   if(!m_spin_edit1.CreateSpinEdit(m_chart_id,m_subwin,text,x,y))
      return(false);
//--- Добавим объект в общий массив групп объектов
   CWndContainer::AddToElementsArray(0,m_spin_edit1);
   return(true);
  }

How can I query it?

m_spin_edit1.GetValue()
 
MakarFX:

how to request it?

probably like this:

имя_объекта. m_spin_edit1.GetValue()

 
Igor Makanu:

I guess so:

what does object name mean?

I have to.

   double OrderBuy = m_spin_edit1.GetValue();

but in this case the error

'm_spin_edit1' - undeclared identifier TestLibrary.mq4 56 20

 
MakarFX:

what does object name mean?

I doubt I can explain, if that's what you're asking

an object is ... let's say a variable of class type

in your code section is class CProgram

it must be written somewhere in the code

CProgram MyProgram;

and will need to be called

 double OrderBuy = MyProgram.m_spin_edit1.GetValue();
Reason: