Errors, bugs, questions - page 1667

 
I found an old phone number in my profile which is long gone, I wanted to change it, but it needs a confirmation by sms to the old number, what should I do?
 
BlackTomcat:
Of course, I don't understand a lot, but I think, for some reason, that the indicator copies created by different "masters", even with the same parameters and applied to one and the same chart, will have different handles. In principle, they don't know about the already existing copy of the indicator, and they should not. When drawing, they will simply overlap each other.
I may be wrong. But logic suggests that it must be so, as written in the previous paragraph.

I'm certainly not an MQ developer, but as far as this process has been explained to me, Five has done an effective caching of indices, so there will always be only one "same" indent, and several "masters" will get a link to it. Maybe the handles will be different - I haven't checked - but inside it will be the same entity. Nobody said anything about "they should know about the copy that already exists" - please don't speculate. Absolutely, no one but the "host" knows their indicators, and for an indicator a reference count is maintained for it from different "hosts", but it doesn't know the hosts.

As practice shows, logic varies from person to person. For example, very often my logic does not coincide with that of MQ, but here I am just telling what I have heard from them.

 
Stanislav Korotky:

I'm certainly not an MQ developer, but as far as this process has been explained to me, Five has done an effective caching of indices, so there will always be only one "same" indent, and several "hosts" will get a link to it. Maybe the handles will be different - I haven't checked - but inside it will be the same entity. Nobody said anything about "they should know about the copy that already exists" - please don't speculate. Absolutely, no one but the "host" knows their indicators, and for an indicator a reference count is maintained for it from different "hosts", but it doesn't know the hosts.

As practice shows, logic varies from person to person. For example, very often my logic does not coincide with that of MQ, but here I am just telling what I have heard from them.

Indeed, what you have written about is written directly in the Documentation:

All functions like iMA, iAC, iMACD, iIchimoku, etc., create a copy of the appropriate technical indicator in the global cache of the client terminal. If a copy of the indicator with these parameters already exists, a new copy is not created, but the counter of references to this copy is increased.
Only I wonder if the "global client terminal cache" includes e.g. the Tester? Because I can run one and the same Expert Advisor with the same indicators in the terminal (on the account) and in the Strategy Tester (on the history) at the same time, and I am not sure that their calculation buffers will be identical. Although, if you calculate the depth of history stored in the client terminal, they can.
 
A100:

I managed to make a test script close to the source program with an error during execution

Result: invalid function pointer call in 'Script2.mq5'.

build 1405. The error itself remains - moved to another part of the program - I'll deal with it later

But new ones have appeared that were not there before

typedef int (*fn)();
class A {
public:
        A() { a = &this; ::ArrayResize( f, 1 ); f[ 0 ] = f0; }
        virtual int g0() { return 0; }
        static  int f0() { return a.g0(); }
        static A* a;
        fn f[];
};
A* A::a;
void OnStart() { A b; }
Result: invalid EX5 file (8)
 
How do I make Shift+F9 array elements visible in debugging?
 
fxsaber:
How can I make Shift+F9 array elements visible in debugging?
Showing array elements is not supported yet
 
Renat Fatkhullin:

In fact, 99% of the time calling IndicatorRelease is a logical programmer error.

Indicator creation is one of the most expensive operations that start very deep mechanisms of their calculation. Attempting to close an indicator handle is also a very expensive operation, if you think about the real underlying processes of its implementation. The frequent creation and closing of indicators shows that the developer does not understand the essence of operations at all.

It is very easy to understand.

Do I understand correctly that when using iCustom instead of IndicatorCreate, the user shifts the responsibility for IndicatorRelease to the universal (therefore, not optimal) developers' solution?

In which the created indicators are stored for some time, while they are called with a certain frequency. If they are not called for some time, then there is a forced IndicatorRelease. Right?

I.e., iCustom should be used optimally, taking into account the golden mean between the complexity of implementation and performance. But if you want the maximum speed, you better try to do everything through IndicatorCreate, creating your own faster (not universal) algorithm of indicators, knowing the peculiarities of their use.

Have I got it right?

 
fxsaber:

Do I understand correctly, that when using iCustom instead of IndicatorCreate, the user shifts the responsibility for IndicatorRelease to the universal (therefore, not optimal) solution of developers?

In which the created indicators are stored for some time, while they are called with a certain frequency. If they are not called for some time, then there is a forced IndicatorRelease. Right?

I.e., iCustom should be used optimally, taking into account the golden mean between the complexity of implementation and performance. But if you want the maximum speed, you had better try to do everything through IndicatorCreate, creating your own faster (not universal) algorithm of indicators, knowing the specifics of your own use of indicators.

Have I got it right?

No, you are not.

The two functions are absolutely equal. Both functions return the indicator handle

 
Slawa:

No, wrong.

Both functions are absolutely equal. Both functions return the indicator handle

IndicatorRelease should be done after iCustom?

Basically it turns out that it is quite possible to run MT4 EAs in MT5. For those who do not use other indicators internally - very easy. Those who use them - create an analogue of the MT4-iCustom storage. The question of data unpreparedness is also quite possible.

Write such an adapter and any MT4-indicator will successfully run in MT5. But in this case Nikolay Kositsyn will lose his job... no, better not.

 
fxsaber:

IndicatorRelease should be done after iCustom?

Basically it turns out that it is quite possible to run MT4 EAs in MT5. For those who do not use other indicators internally - very easy. Those who use them - create an analogue of the MT4-iCustom storage. The question of data unpreparedness is also quite possible.

Write such an adapter and any MT4-indicator will successfully run in MT5. But in this case Nikolay Kositsyn will lose his job. No, I'd rather not.

I remember, the documentation says that the most correct way to initialize (create) indicators handles in the function OnInit, and perform IndicatorRelease in the function OnDeinit. This means that all the time while the Expert Advisor is running, the indicators handles remain relevant.
Reason: