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

 
Igor Makanu:

i have the same numbering as in MQL5: in MQL5 the indicator buffers and time series are "unfolded" on the contrary, by default the leftmost bar in MT5 is bar 0 and in MT4 the rightmost bar is bar 0 and the indicator buffers have the same numbering

ZS: I dont want to get involved with MT5, MT4 is enough for me to check my ideas, I only look at MT5, and if I write something using MT5 I never show it to anyone)))

I was looking at the macd code for 5 as an example, there SimpleMAOnBuffer was applied without any magic and there is no possibility to run it in reverse.

I tried counting it backwards

   int limit;
   if(prev_calculated==0)
      limit=0;
   else limit=prev_calculated-1;

   for(int i=limit;i<rates_total && !IsStopped();i++)

same thing happens, looks like the problem is in something else.

 
psyman:

Try counting backwards

it's not so easy to reverse.... you need to expand arrays ArraySetAsSeries() - all of them, both buffers and timeseries, which you use

and then you can count from right to left, like in MT4, and all manipulations with comparison and search for highest and lowest values also need to think which way the array is leaning...

I don't like such tasks, I take and write on MT4, on MT5 I'm always double-checking myself ))))

The more that you use the standard library#include <MovingAverages.mqh> - I'm not a helper here, I was interested only in graphics and arrays from the standard library, I didn't look further how everything is arranged there - there is no sense - there are "truckloads" of ready indicators for MT4

 
Igor Makanu:

it's not so easy to count backwards.... You need to expand the arrays by ArraySetAsSeries() - all of them, both buffers and timeseries.

and then you can count from right to left, like in MT4, and all manipulations with comparison and search for highest and lowest values also need to think which way the array is leaning...

I don't like such tasks, I take and write on MT4, on MT5 I'm always double-checking myself ))))

The more so that you use the standard library#include <MovingAverages.mqh> - I'm not an assistant here, I was interested only in graphics and arrays from the standard library, I didn't look further how it was organized - there was no sense - there were "truckloads" of ready indicators for MT4

Now I looked at several indicators from the standard set, for some reason none of them uses ArraySetAsSeries(). The MT4 reference says:

Time series are reverse indexed arrays, i.e. the first element of a time series is on the rightmost position and the last element of the time series is on the leftmost position.https://docs.mql4.com/ru/series/bufferdirection

The same in MT5:

A timeseries differs from a regular array in that the elements of the timeseries are indexed from the end of the array to the beginning (from the most recent data to the oldest data).

https://www.mql5.com/ru/docs/series


The library was used because I don't know any other standard way to calculate average, though if iMAOnArray is removed there should be something in its place.

Доступ к таймсериям и индикаторам - Справочник MQL4
Доступ к таймсериям и индикаторам - Справочник MQL4
  • docs.mql4.com
Функции для работы с таймсериями и индикаторами. Таймсерия отличается от обычного массива тем, что индексация элементов таймсерии производится от конца массива к началу (от самых свежих данных к самым старым). Для копирования значений таймсерий и индикаторов рекомендуется использовать только динамические массивы, так как функции копирования...
 
psyman:

Now I looked at several indicators from the standard set, for some reason ArraySetAsSeries() is not used anywhere. The MT4 reference says:

Time series are reverse indexed arrays, i.e. the first element of a time series is on the rightmost position and the last element of the time series is on the leftmost position.https://docs.mql4.com/ru/series/bufferdirection

The same in MT5:

A timeseries differs from a regular array in that the elements of the timeseries are indexed from the end of the array to the beginning (from the most recent data to the oldest data).

https://www.mql5.com/ru/docs/series


The library was used because I don't know another standard way to calculate the average, although if iMAOnArray was removed, there should be something in its place.

But just check the difference in numeration in MT4 and MT5 - draw a 10 Close from zero bar to 9 bar with indicator buffer and you will see immediately where it is drawn in MT4 and where it is drawn in MT5.

I don't like MT5 - it's faster there or not faster )))), maybe Artem will show up here, he likes to learn MT5, I don't like MT5 - I've never forced myself

 
Igor Makanu:

Ifyou have a different numbering in MT4 and in MT5 - use the indicator buffer to draw 10 Close from zero bar to 9 bar and you will see immediately where in MT4 it is and where in MT5 it is

If you do not have an MT5 indicator but take it tothe MT5 topic, it's faster there...)), maybe Artem will show up here, he likes to teach MT5, I do not like MT5 - I've never tried to force myself to do it.

I do not like MT5 - I do not force myself to do it.

I cannot see the exact place where I can ask a question on MT5.

 
psyman:

Is MT5 help copied from MT4?

Please give me a link, I cannot see where I can ask a question about MT5.

This is not copying, but numbering in MT5 is the same as in normal arrays - the element with the lowest index and the one with a higher index appears later, the leftmost bar in MT5 is 0 and the rightmost bar = rates_total-1 - you can change the numbering withArraySetAsSeries().... Here in general, you can choose one thing to master - either MT4 or MT5 - command syntax is the same, but .... There are a lot of differences between MT4 and MT5

https://www.mql5.com/ru/forum/6343/page1020

Вопросы от начинающих MQL5 MT5 MetaTrader 5
Вопросы от начинающих MQL5 MT5 MetaTrader 5
  • 2019.03.26
  • www.mql5.com
Подскажите пожалуйста, такой показатель тестера в жизни реален? И хороший это или плохой результат за год с депо 3000...
 
Igor Makanu:

The numbering in MT5 is the same as in usual arrays - the element with the lowest index and the one with a higher index appears later, the leftmost bar in MT5 is 0 and the rightmost bar = rates_total-1 - and so for everything, for buffer and timeseries, you can change the numbering withArraySetAsSeries().... Here in general, you can choose one thing to master - either MT4 or MT5 - command syntax is the same, but .... there are a lot of differences between MT4 and MT5

https://www.mql5.com/ru/forum/6343/page1020

Thank you

 
Igor Makanu:

If you have a different numbering in MT4 and in MT5 - use the indicator buffer to draw 10 Close from zero bar to 9 bar and you will see immediately where in MT4 it is and where in MT5 it is

If you do not have an Mt5 properly, it may be faster there. If you do not see him, he may try to learn MT5, I do not like MT5 - I've never tried it before.

I do not like MT5 - I do not force myself to do it. I will show up. Right everything with the seriality. And MovingAverages.mqh works in quaternary style - left to right.

You don't have to do much with the code under discussion - just look where all the arrays are directed and point them in the same direction - like in quadruple. I just don't have the time...

 
psyman:

So MT5 help is copying from MT4?

Please give me a link, I can't see where I can ask a question about MT5.

I have no idea where I can ask my questions about MT5. But with an emphasis on multiplatform.

 
Artyom Trishkin:

Ask here - here we teach the transition to Five, or just answer questions on both platforms. But with an emphasis on multiplatform.

You already asked https://www.mql5.com/ru/forum/160683/page795#comment_11143961

Reason: