You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Conducted a small stress test. I switched off the Internet, launched the indicator with the panel on the chart. I have already provided the parameters above. Then I switched on the Internet and got the following result:
The indicator crashed.
I also noticed something strange. M15 chart on USDCHF.
If we look at the USDCHF chart, or rather at the red curve of the MA(USDCHF, H1) indicator, then for the last 7 hours the transition to the next value occurred at 00 minutes 5 times. I have highlighted it with red verticals. And only for the last 2 hours everything is normal. Blue verticals. Imho, a clear error with buffer filling....
Conducted a small stress test. I switched off the Internet, launched the indicator with the panel on the chart. I have already provided the parameters above. Then I switched on the Internet and got the following result:
The indicator crashed.
I also noticed some strange things. M15 chart on USDCHF.
If we look at the USDCHF chart, or rather at the red curve of the MA(USDCHF, H1) indicator, then for the last 7 hours the transition to the next value occurred at 00 minutes 5 times. I have highlighted it with red verticals. And only for the last 2 hours everything is normal. Blue verticals. Imho, a clear error with buffer filling....
Conducted a small stress test. I switched off the Internet, launched the indicator with the panel on the chart. I have already provided the parameters above. Then I switched on the Internet and got the following result:
The indicator crashed.
In line 211 at cursor position 34, the predefined array time[] is accessed:
DrawData(mouse_bar_index,time[mouse_bar_index]);It turns out that the index passed to the array is incorrect.
It can hardly be more than rates_total-1, most likely it is equal to -1, because it receives its values in the OnChartEvent handler by the iBarShift() function, which can return -1:
In DrawData(), an invalid index value is handled by calling CopyRates(), which will not get any data if the index is negative, and will then exit DrawData():
So - before accessing the time[] array, you need to check the bar index passed to the array (in line 211):
In general - theory. I haven't tested it, as I am busy developing the continuation of the theme (coloured buffers of multi-indicators and so on). After the next article on this topic is published, I will check and test it (if you don't test it before me with changes in p.211).
In line 211, the predefined array time[] is accessed at cursor position 34:
It appears that the index to the array is passed incorrectly.
It can hardly be greater than rates_total-1, most likely it is equal to -1, because it receives its values in the OnChartEvent handler by the iBarShift() function, which can return -1:
In DrawData(), an invalid index value is handled by calling CopyRates(), which will not get any data if the index is negative, and will then exit DrawData():
So - before accessing the time[] array, you need to check the bar index passed to the array (in line 211):
In general - theory. I have not tested it, as I am busy developing the continuation of the topic (coloured buffers of multi-indicators and so on). After the next article on this topic is published, I will check and test it (if you don't test it before me with changes in p.211).
Artem, the bar index can be current, iBarShift() returns 0. But you can't put less than 1 into CopyRates(). That's why we should probably write iBarShift()+1 in any variant, since the bar number and the number of bars are not equal.
Artem, the bar index can be current, iBarShift() returns 0. But you cannot put less than 1 into CopyRates(). Therefore, we should probably write iBarShift()+1 in any variant, since the bar number and the number of bars are not equal.
In this context: the index is the bar number
In this context: the index is the bar number
Artem, index - yes, it can be zero. But the number of copied elements
cannot be equal to zero.
Just like the number of items and the index in the list of items...
Artem, the index - yes, it can be zero. But the number of copied elements
cannot be equal to zero.
Just like the number of items and the index in the list of items...
Right here:
where does index point ?
It's right here:
where does index point ?
That's it, I'll shut up. I didn't look at the code of the DrawData(mouse_bar_index,time) function; that's why I was mistaken...
Forum on trading, automated trading systems and testing trading strategies
Discussion of the article "Preparing multisymbol multi-period indicators"
Artyom Trishkin, 2023.11.01 04:46 AM
...After publication of the next article on this topic, I will check and test (if you do not test me before with changes in p.211).
To test something, you have to be in the paradigm of what's going on ))
I realised that it's easier for me to sketch my own version, as I'm not close to the current approach. In particular, it seems to me that the CIndMSTF class is some kind of super class. Then a bunch of indicator classes are created on its basis. Creepy - the IndMSTF.mqh file is 4 thousand lines of code )) I went the way of using an instance of CIndicators class as an indicator collection. It is very convenient. You don't need to invent a bicycle.
Then why should the CIndMSTF class store data on buffers (SBuffer m_buffers[])? We calculated them once in OnCalculate() and that's enough. I.e. we took it as a parameter by reference, calculated it and gave it back...
I'll write more later about what I disagree with once I finish my version....
Yes, I like that there is this mechanism:
...При работе с данными не текущего графика для исключения "освобождения" таймсерии, необходимо не реже. чем раз в две минуты обращаться к этой таймсерии. В этом случае будет происходить "удержание" таймсерии, что ускорит к ней обращение (не нужно будет каждый раз дожидаться синхронизации данных)...
Artem, one more thing. If articles are written as a manual, which there is a desire to study, then, imho, there are not enough schemes of relationships of those classes, which the developer creates....
Then, why put the code of all indicators in the article material? I mean this section - " Acomplete list of all inheritor classes of the base class of the multisymbol multiperiod indicator". Ilooked at how many lines of code there are .
Here is the beginning:
And here's the end:
Almost 2 thousand. Wow!