Errors, bugs, questions - page 1203

 

On real exchange servers, of course, volumes are separate for selling and buying.

On test exchange (not to be confused with forex) servers, quotes are often from a completely different test simulation system and exchange "demo servers" should never be used for analysis.

 

Error during execution: incorrect casting of pointers (build 977, but it happened from time to time before)

//AAA15.mq5
#define  PF              Print( __FUNCTION__ );
#define  PFI( i )        Print( __FUNCTION__, " ", i );
class A { public:
};
class R { public:
        void y( A* a )          { PF  ((B *)a).g( 1 ); }
};
class L : public R { public:
        void y( A* a )          { PF  ((B *)a).g( 2 ); }
};
class B : public A { public:
        virtual void g( R* r )  { PF  r.y( GetPointer( this ) ); delete( r ); }
        virtual void g( int i ) { PFI( i ) }
};
class C : public B { public:
        virtual void g( int i ) { PFI( i ) }
};
#import "AAA17.ex5"
        C *f();
#import "AAA16.ex5"
        void h();
        R *w();
#import
#ifndef  HEADER
void OnStart()
{
        f().g( w() );
        h();
}
#endif
//AAA16.mq5
#property library
#define  HEADER
#include "AAA15.mq5"
void h() export { PF  f().g( w()); }
R *w()   export { PF  return new L(); }
//AAA17.mq5
#property library
#define  HEADER
#include "AAA15.mq5"
class X { public:
        X()           { PF  c = new C(); }
        virtual ~X()  { PF  delete( c ); }
        C *c;
};
static X x;
C *f() export { PF  return ( x.c ); }

If you move something (for instance, swap declarations #import) or make 2 files instead of 3 or remove h() call - then instead of the specified errors other errors occur

If you recompose the code above, it will end up calling R::y instead of L::y

In a more complex version, some common functions from modules are called before (!) static constructors themselves (as if in the above example f() is called before X::X, which in turn is correctly called before OnStart). I will try to cite an example, but there are huge files. But sometimes it works correctly, so the error is not with me because the order of object creation is defined by the compiler itself and I cannot change it

 

I also noticed that if the main module (OnStart) is changed insignificantly (some variable or Print is added), it often fails to start until all used ex5 modules are recompiled. At that, message in Experts informs that there is no function, which is known to be there, in one of ex5 non-core modules (which is proved to be operable after recompiling all modules).

And experimentally it was found that functions which are called before (!) static constructors are called exactly from this function (which MT cannot find periodically)

 
Dear programmers, who could advise me on how to prepare an EA for the Market? You can write to me in person and/or here.
 
yosuf:
Dear programmers, who could advise me on how to prepare an EA for the Market? I can do it in person and/or here.
You can open a separate topic and then discuss the question in it.
 
Today there was a strange glitch with MT4: the demo account on the MetaQuotes-Demo server in the "Navigator" in the terminal was suddenly moved to another broker's list. I had to delete this stray account from the terminal and then re-enter it.
 
Renat:

On real exchange servers, of course, volumes are separate for selling and buying.

On test exchange servers (not to be confused with forex) the quotes are often from a completely different test simulation system and the exchange "demo servers" should by no means be used for analysis.

Renat,

thank you!

 
Renat:
А время было торговым? Лучше всего обратиться в службу поддержки брокера.
Время торговое, тики тикают. К брокеру обратился. Они ответили, что российские CFD - индикативы. Почему они отображаются в терминале черным, они не знают.
In general, the continuation of the research yielded the following results. When putting the mouse cursor over tickers in the market overview a tooltip appears where for grey symbols it is written Trade: No. But for Russian CFD, which are displayed in black, Trade: Close is displayed (once again it should be noted that time is trading and ticks on the symbol come at this moment). From which I conclude that the broker has several levels of trade barring, of which only some (or even only one) are marked in gray, and all the rest are piled in a common pile with active symbols, as they are displayed in black.
 
marketeer:
Anyway, further research yielded these results. When putting the mouse cursor over the tickers in the market overview a tooltip appears, in which for the grey symbols it is written Trade: No. But for the Russian CFD, which are displayed in black, Trade: Close is displayed (once again it should be noted that time is trading and ticks on the symbol come at this moment). From which I conclude that the broker has several levels of trade barring, of which only some (or even only one) are marked in gray, and all the rest are piled in a common pile with active symbols, as they are displayed in black.

A question was raised about the colouring of the characters.

Here is the answer specifically on the coloring on the MQ^ demo server

Forum on trading, automated trading systems and strategy testing

Coloring in Market Watch

barabashkakvn, 2014.05.12 18:55

Here's the response from Service Desk: "On our server, the background colour of the symbol means essentially nothing.

If we are talking specifically about the font colour in the symbol name: grey means that trading on the symbol is disabled, plain black means that trading is allowed.

I.e. for deciphering the background colour of the symbol you need to contact your broker and there is no unified standard on colouring.

But here is a promise to fix it:

Forum on trading, automated trading systems and testing trading strategies

Colours in the Market Watch

Renat, 2014.05.13 12:37

The colour madness should have been addressed a long time ago.

We will add a colour reset command and new commands for grouping and sorting instruments in the window.

There is a radical upgrade of commands systems, menus and interfaces in MT4/MT5 and there will be a beta before iFX EXPO on May 25th. In general, the new builds will give amazing opportunities to traders.


 
barabashkakvn:

A question has been raised about character colouring.

Here's the answer specifically on the coloring on the MQ^ demo server

And here's a promise to fix it:


Maybe. Only in actuality, it's not very convenient yet, as the UI is misleading. Waiting for improvements.