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

 
Егор Андреев:

Hello, how long will MT4 be around for? a year or two?

Sorry for the question, it's a bit off-topic (but very important to me).

mt5 has been around for 10 years (as far as i remember)
mt4 is about 15 years old.

i.e., in fact, we can already ask - "how long will mt5 last?
we can already do mt6 )

 
Taras Slobodyanik:

mt5 has been around for 10 years (as far as i remember)
mt4 is about 15 years old.

i.e., in fact, we can already ask - "how long will MT5 survive?
we can already do mt6 )

Thank you, I didn't expect such an answer)... But still, any chance of a year or two for MT4?

 
Егор Андреев:

Thank you, I didn't expect such an answer)... But still, any chance of a year or two for MT4?

I think the developers would rather decide to make MT6 with MT4 and MT5 support than kill MT4)
(this is my personal opinion-desire)

 
Hi all) Does anyone have an Exposure indicator for calculating but profit and sell profit. i need the mq4 format. i can't find it)
 

Rewriting code from mt4 to mt5.

The break operator is a bit confusing.

MT4

for(int i=0; i<OrdersTotal(); i++)
              {
               if(!OrderSelect(i,SELECT_BY_POS)) break;
               дальнейший код

MT5

for(int i=PositionsTotal()-1;i>=0;i--)

               if(m_position.SelectByIndex(i))
                 {
                  дальнейший код

Is it correct?

 

What does an error mean:

conversion is not accessible because of inheritance access      


p.s. why does this site almost always fail to search?

 
leonerd:

What the error means:

public forgotten

 

Help me solve this question! Here is a piece of code of the indicator, if you run it on TF less than M5 this error always appears on a new bar! Is it supposed to be like this or something is wrong?

ResetLastError();   
   datetime Arr[];
   if(CopyTime(NULL,PERIOD_M5,10,1,Arr)<=0) 
   {
      int error=GetLastError();
      Print("Ошибка 4401 возникает на новом баре раб.ТФ, который должен быть ниже М5 в данном случае ",error);
      Print("Почему запрошенная история не найдена ведь я обращаюсь всего лишь к 10-му бару старшего ТФ М5");
      return(0);
      }
 
Taras Slobodyanik:

I think the developers would rather make MT6 with MT4 and MT5 support than kill MT4)
(this is my personal opinion-desire)

Possibly, but it takes time to decide and do it... Is it, for example, a year or two for MT4?

 
Егор Андреев:

Possibly, but it takes time to decide and do it... Does MT4 have, for example, a year or two?

no one knows, the developers of MT4 once again said they would not make updates, in my memory, it has happened 5 times

if you are writing for MT4 Expert Advisors, then in MQL5 you will be able to transfer the code, literally - in 2 clicks, you will be able to use the code usinghttps://www.mql5.com/ru/code/16006.

If you are an expert, you need to rewrite it manually. The logic of writing indicators for MT5 is a little different - this is what keeps me from switching to MT5.


Tango_X:

Please help me to solve the problem! If I try to use it on TF less than M5, there is always this error on a new bar! Is it supposed to be like this or something is wrong?

the code is correct, add the output when everything works correctly in - CopyTime(), it may happen that on the tick that opens a new bar history is not available, so you need to repeat the operation on the next tick

SZZ: there is function iTime() - perhaps it works better

MT4Orders
MT4Orders
  • www.mql5.com
Данная библиотека позволяет работать с ордерами в MQL5 (MT5-hedge) точно так же, как в MQL4. Т.е. ордерная языковая система (ОЯС) становится идентичной MQL4. При этом сохраняется возможность параллельно использовать MQL5-ордерную систему. В частности, стандартная MQL5-библиотека будет продолжать полноценно работать. Выбор между ордерными...