Errors, bugs, questions - page 600

 
papaklass:

Urain, sergeev thanks for the answers.

I know about writing indexes to an array, I thought there might be something faster.

This is the first time I've heard about "bubble" sorting. If you can, please give me more details and better with a simple example. I will read your links anyway.

Thanks again for the answers.

http://ru.wikipedia.org/wiki/Сортировка_пузырьком

By the way, by the way, the article implements shaker sorting of indexes (but I call it bubble sorting out of habit).

The shaker one differs from the bubble one in that the bubble one way passes, whereas the shaker one alternates, which speeds up sorting by reducing the passes, as the bubbles not only float but also sink.

Сортировка пузырьком — Википедия
  • ru.wikipedia.org
Сортировка простыми обменами, сортиро́вка пузырько́м (англ.  ) — простой алгоритм сортировки. Для понимания и реализации этот алгоритм — простейший, но эффективен он лишь для небольших массивов. Сложность алгоритма: O(n²). Алгоритм считается учебным и практически не применяется вне учебной литературы, вместо него на практике применяются более...
 

Guess three times which indicator I've come to ask about? The correct answer is iFractals. Unexpected, isn't it?

The help section of Custom Indicators https://www.mql5.com/ru/docs/customind says:"For example, if current rates_total=1000 and prev_calculated=999, then maybe we only need to make calculations for one value of each indicator buffer. "But all this applies to the first - short - form of OnCalculate() function call. If, on the other hand, there are several indicator buffers involved in the calculation, this form will not work.

Let's execute in M1 the code of the iFractals example from the Help, where the second - full - form of OnCalculate() function call is used. But before that, inside this function let's correct

Comment(comm);

to

Print(comm);

in order not to lose sight of any line with output (if left as it is, visually always 1 will be visible, because other values are rare and immediately replaced by 1, so it seems that 1 is always output). After runtime we see that non-unit values occur every minute, i.e. on every new bar, which unequivocally indicates that the indicator is redrawn every minutefully despite the fact that the code useseconomical algorithm. The doubters can add several lines of code, drawing, say, vertical lines on each fractal and then remove them after the first drawing and wait for the full set of the same lines to appear after a minute with a new bar. For some reason it is not about drawing only last fractal or line.

Question to developers: was the indicator written carelessly or there was no aim to render only the last - new - calculated value of the fractal? Or have I cheerfully confused a code block with values_to_copy calculations with economical algorithm that is not there at all? Or in the full form of OnCalculate() function call is it impossible to use analog of const int begin for setting the beginning of meaningful data?

Please note, that no filling of history "holes", loading of bars from the past and other events that zeroize prev_calculated, occurs during the experiment! That is, there is no reason to recalculate the values of the whole indicator.

Of course, I would make something tolerable for myself for this notorious thrifty algorithm, but the official opinion of developers on this matter and corrections if necessary, apparently, are important here.

Документация по MQL5: Пользовательские индикаторы
Документация по MQL5: Пользовательские индикаторы
  • www.mql5.com
Пользовательские индикаторы - Документация по MQL5
 

Convincing request to the developers (by the way, I am not the first to ask for it): please replace the old version of Fractals indicator with the new one. (For reference: in the old version the freshest fractal can appear on the last bar (which may result in its undesirable redrawing), while in the new version the freshest fractal can appear up to three bars before the latest bar). Of course, we can manually draw an old version or a new one to a chart if we want, but when we try to refer to iFractals handle in our code, the old version will still work. How much time was wasted trying to get excited about it and not to smash my face against the table trying to pinpoint this supposed bug...

P.S.: I didn't update the whole thing, only through Live Update. Can it be the reason for it? Any tips? If so, I'll update completely.

 
x100intraday:

Convincing request to the developers (by the way, I am not the first to ask for it): please replace the old version of Fractals indicator with the new one. (For your reference: in the old version the freshest fractal can appear on the last bar (which may result in its undesirable redrawing), while in the new version the freshest fractal can appear up to three bars before the latest bar). Of course, we can manually draw an old version or a new one to a chart if we want, but when we try to refer to iFractals handle in our code, the old version will still work. How much time was wasted trying to get excited about it and not to smash my face against the table trying to pinpoint this supposed bug...

P.S.: I didn't update the whole thing, only through Live Update. Can it be the reason? Any tips? If so, I'll update completely.

What prevents you from using iCustom(...) ?
 
Valmars:
What prevents you from using iCustom(...) ?
Nothing in principle. But the outdated version of the same indicator - is not the case, by definition, the outdated should be removed at distribution level, and this, in my opinion, should be the concern of developers. And if we leave the old stuff, it should not be the default, itshould be the new, more correct. Personally I would hardly call the old version alternative; in fact it is a blatantly incorrect version which can get you into a lot of trouble in the future.
 
x100intraday:

Convincing request to developers (by the way, I'm not the first to ask for it): please replace old version of Fractals indicator with new one. (For reference: in the old version the freshest fractal can appear on the last bar (which may result in its undesirable redrawing), while in the new version the freshest fractal can appear up to three bars before the latest bar).

1. which new version are we talking about?

2. What prevents you from polling 3 bars instead of 2?

 
I have a question: is it possible to obtain indicator data for different currency pairs and not only for the one on which the indicator is installed.
#property copyright "2010, Graff"
#property link      "http://www.mql5.com"
............
hwd_EURUSDf=iMA("EURUSD",0,Fast*k,shift,smootMode,price);
hwd_GBPUSDf=iMA("GBPUSD",0,Fast*k,shift,smootMode,price);
.......
if(CopyBuffer(hwd_EURUSDf,0,i,1,buff)<=0) return(-1);
if(CopyBuffer(hwd_GBPUSDf,0,i,1,bufs)<=0) return(-1);

etc. something is not working. Above is a piece of code from CCFp.mq5, which I installed for self-testing. My own indicator (written on the same principle, i.e. Handles->CopyBuffer)

Doesn't work(Print(buff[i]) shows some shit.

Please: If you have solution, please give me code! MT5 bild 555/.

 
alexx_v:

I just heard the terminal reconnecting with the server after a break, I looked it up and it is, it's glitching again:


alexx_v:

I just heard the terminal reconnecting with the server after a break, I looked it up, and it is, it's glitching again:


Is this picture on MT4 or MT5?
 
sergeev:

1. which new version are we talking about?

2. What prevents you from polling 3 bars instead of 2?

1. There are two seemingly identical Fractals indicators in the standard indicators: in the section with Bill Williams' indicators and in the Custom section. When comparing them, we see that the first one tends to re-draw some of the fresh fractals on the last bar, while the second one does not have such a disadvantage as the fractal is checked during the loop using its own algorithm for i<rates_total-3, i.e. with one bar to spare, while the fractals themselves are algorithmically formed by checking only two adjacent bars and, if needed, they are completely confirmed only when a new, third, bar appears. I know the location of correct fractals: C:\Program Files\MetaTrader 5\MQL5\Indicators\Examples\Fractals.mq5, but iFractals does not know it, butiFractals knows the way to the old version that I can hardly find. Does it take the old code from C:\Program Files\MetaTrader 5\MQL5\Include\Indicators\BillWilliams.mqh?

Doubtful (premature) fractal vs fractal that can only be asserted with a new bar

2. Nothing, this solution is obvious and I'm almost using it already. But here's the thing. If we do not look deep into the project and take into account only fractals, then yes - there is nothing wrong with rewiring; but if we do graphical TA constructions based on jumping fractals and perform auto-trading based on them, then in some cases false operations (too early position opening) occur, because no rewiring of fractals has yet occurred and correction of constructions was not performed, but the market entry signal has already worked. When the fractal re-drawing plus rebuilding of the charting tool occurs, everything will be corrected except for the prematurely opened position. It is not the most pleasant solution to cripple the position by closing, reducing or opening the opposite one - this requires additional filters, checks, which contradict to the doubtful signal and therefore decrease the frequency of deals, as well as adding other complicating ballast to the indicator.

In principle, one can give in to oneself and agree to use the minus-first fractal, not the last one, which is still doubtful and can be redrawn. But to me it is a typical example of a crutch, which sometimes accumulates in one's own code and should not exist, if possible... and I'm not even speaking about the tardiness of obtaining the correct information from the market and making constructions.

 
goblin:
I have a question: is it possible to get indicator data for different currency pairs, not just the one on which the indicator is installed.

etc. Something is not working. Above is a piece of code from CCFp.mq5, which I installed for self-testing. My own indicator (written on the same principle, i.e. Handles->CopyBuffer)

Doesn't work(Print(buff[i]) shows some shit.

Request: If you have solution, please give me code! MT5 bild 555/

Yep, seems to have solved the problem on my own.

Question to admins: I downloaded it from site, in help example I used (xxx=iMA(.....)), but MA is not in indicators, it is in inluded. Is it an intelligence test?

I'm sorry for the time!