Errors, bugs, questions - page 2012

 
A100:

Another bug is that the 32-bit version (mine is the exact one) does not have errors in execution. invalid pointer - only if the class is augmented with a member, for example int i

You must have tested on MT4, but the build is lower there too.

 
Kirill Belousov:

Bug.

The error 4200 is not generated when creating duplicate object on the NOT CURRENT CHART (which does give on the current one - [see "CURRENT CHART" in the log]) ,

as well as found out that finding an object in the RECENT CHART takes up to 500 times longer than finding the current one.

а :) because it turns out I'm not the only one who has this

The object is not created immediately on function call. An asynchronous command is sent to the chart. For our own chart we have an opportunity to perform a preliminary check. For someone else's chart there is no such possibility - or rather, there is, but it is very expensive.

Therefore, the return code "no errors" indicates that this very alien chart has been found and the object creation command has been successfully placed in its queue for execution.

 
fxsaber:

You must have tested it on MT4, but the build is lower there too.

MT5\1653\32\Win10 - my code reaches the line //Result: false

If you also have 32-bit and an invalid pointer - then it is a random error

ServiceDesk writes that: The function f is empty and the call is cut out by the optimizer, as well as the call of the copy operator.

But if

        void f() { Print( __FUNCTION__ ); }

then Result:

2017.09.26 14:03:55.853 Demo (GBPUSD,M15) A::f
2017.09.26 14:03:55.853 Demo (GBPUSD,M15) false
essentially no change

 
A100:

If you also have 32 bit - then some random error at all

No, I was running Win7x64.

ServiceDesk says that: The function f is empty and the call is cut out by the optimizer, just like the copy operator call from step 1.

But if

then nothing changes

I've encountered where SDs respond quickly without checking. And for 90% of applications this is probably correct, as most applications are probably not due to bugs, but due to ignorance. Please take a closer look - it works.

 

A site bug with links.

If a forum post has been moved by a moderator to another thread, then in the profile search "All posts" this post is linked to the old location. Consequently, it cannot be navigated to it.

 
A100:

MT5\1653\32\Win10 - I get to the line //Result: false

If you also have 32-bit and an invalid pointer - then it is a random error.

ServiceDesk writes that: The function f is empty and the call is cut out by the optimizer, as well as the call of the copy operator.

But if

then Result:

2017.09.26 14:03:55.853 Demo (GBPUSD,M15) A::f
2017.09.26 14:03:55.853 Demo (GBPUSD,M15) false
essentially no change

I'll add, the f function does not address object fields, so an object pointer (this) is not needed for the f function.
The optimizer removes unnecessary dereferencing of the handle (remember, in MQL the handle is a pointer) to the object pointer since it (the pointer) is not used inside f

 
Ilyas:

Let me add, function f does not contain addressing to object fields, so it does not need pointer to object (this) for function f.
The optimizer removes unnecessary dereferencing of the handle (recall, in MQL the pointer is a handle) to the object pointer, since it (the pointer) is not used inside f

Clearly, working with f as with static. But how to explain that one runs and the other interrupts?

 
In fact, at least this would be convenient.
input string Value = _MarketWatch; // Выпадающий список (а-ля enum) символов из Обзора рынка

Forum on trading, automated trading systems and testing trading strategies

ENUM Symbol list as an INPUT

Martin Nohejl, 2017.09.26 13:01

Hi, I am going to do the following:

I want to have symbol as an input parameter, so I want an input variable (enum) from which I will choose the right symbol, like this:

I have done this by this code:

enum ENUM_SYMBOL
   { 
    EURUSD=0, 
    GPBUSD=1, 
    USDCHF=2
   };

That works for me perfectly. But I would like to fullfill the enum dynamicaly by the whole list of symbols (SymbolsTotal(0);).

Somehow probably by code:

int a = SymbolsTotal(0);
for(int i=0; i!=a;i++){
....
}
 
fxsaber:

Clearly, working with f as with static. But how do you explain that one gets executed and the other gets interrupted?

Most likely, you start debugging (F5) and A100 compiles (F7) first and then charts.

When compiling for debugging, the optimizer only removes explicitly unused code, all other optimizations are not performed.
 
Ilyas:
Most likely you start debugging (F5) and A100 compiles first (F7) and then throws it on the chart.

When compiling for deb ugging, the optimizer only removes explicitly unused code, all other optimizations are not performed.

I took that feature into account straight away. I have now double-checked myself.

Release-version:

Test (EURUSD,H1)        invalid pointer access in 'Test.mq5' (9,11)