Errors, bugs, questions - page 460

 
voix_kas:

The EA requires access to an indicator. You can get it in at least three ways: IndicatorCreate(...) or iCustome(...) or, if it is a standard indicator, for example, iMA(...).

As I understand, when using any variant, you must explicitly release the resulting handle (IndicatorRelease).

The question is about choosing the way of calling the indicator. What are the pros and cons of each method? Priority interest in speed of processing.

IndicatorCreate - for the standard indicators, so that in the case of the wrist they are the analogues of the iMA call. iCustom - for "custom" custom indicators. I.e. essentially different things.

The call speed of iMA and IndicatorCreate(IND_MA) should be comparable, but I have not checked it.

As for IndicatorRelease - it makes sense to call it, if you won't need to return to this indicator after the calculation. I don't have such situations - if some indicator is needed (with a given set of parameters), then it will be needed for additional calculation/recalculation, and if input parameters of the script change, then everything will be reinitialized and new handles will be created.

 

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

The creation of an indicator is one of the most expensive operations, which triggers very deep mechanisms of their calculation. Trying to close an indicator handle is also a very expensive operation, if you think about the real 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.

Документация по MQL5: Доступ к таймсериям и индикаторам / IndicatorRelease
Документация по MQL5: Доступ к таймсериям и индикаторам / IndicatorRelease
  • www.mql5.com
Доступ к таймсериям и индикаторам / IndicatorRelease - Документация по MQL5
 
Renat:

In fact, in 99% of cases, calling IndicatorRelease is a logical error on the part of the programmer.

Creating an indicator is one of the most expensive operations that triggers very deep mechanisms to calculate them. Trying 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.

Let me intervene in the conversation and say: the mechanisms of m-program, terminal, forex (in fact, why are we gathered here)

The reason why we are here is simple truths, so what prevents us from understanding them and mowing the rubles - or the software we are going to sell,

And if there is no possibility to do so we have to keep silent until a "miracle" happens !

 
Im_hungry:

Let me intervene in the conversation and say: the mechanisms of the program, the terminal, forex (basically what we are here for)

We have to understand them and use rubles - or software that we will sell,

We should keep silent until a "miracle" happens!

A beautiful example of incomprehensible stream of thought. I envy such abilities.
 
Renat:
A beautiful example of incomprehensible thought flow. It's enviable to be able to do so.

Surely a level 80 Jedi, Master Yoda is quietly meditating on the sidelines :)

And there's no question about it, they "helped homeless children in case of trouble" (from 12 Chairs).

 

Not so long ago, my working code stopped compiling.

It's blaming the code in the standard library:

'GetLastError' - ambiguous call to overloaded function with the same parameters SymbolInfo.mqh  718     10
'GetLastError' - ambiguous call to overloaded function with the same parameters	SymbolInfo.mqh	725	57
Apparently because of what's in my code:
#import "kernel32.dll"
uint GetLastError();
#import
.....
kernel32::GetLastError() 
.... 

How do I "digest" this to make my program work again? I'm not sure what has changed in the new build of MQL.

Are imported functions not allowed to have the same name as the built-in ones? How to go on with the life?

 
7134956:

How do I "digest" this so that my program works again? I don't quite understand what has changed in the new build of MQL.

just add a parameter inside

#import "Kernel32.dll"
uint GetLastError(int);
#import
 
sergeev:

add a simple parameter inside

Thank you! Seems to have helped. But it's kind of a crutch to pass a parameter that's redundant.
 
Let's think of it as a feature or an autobug.
 
sergeev:
Let's think of it as a feature or autobug.

You could take it out and wrap it in a separate library, renaming it.

You could also try asking for named spaces, but it's probably useless.