Errors, bugs, questions - page 1723

 

How to copy (keeping relative paths) all project files into a separate folder.

For example, I want to share a code. It pulls a dozen or so mqh files from different places.

Now I have to search for these files manually, often you can't find all of them or take something unnecessary. How to automate this process to be able to share sources?

 

How do I delete a project with all its files?

I downloaded a project with a dozen files from the kodobase terminal, but how do I delete it?

 

Compilation error

class A {};
template<typename T> //---------------------------------------------------//(1)
T *f( T* t ) { return t; }              //      A *f(       A* )          //(2)
                                        //const A *f( const A* )          //(3)
template<typename T> //---------------------------------------------------//(4)
 T *f( T* t, const T* ) { return t; }    //      A *f(       A*, const A* )//(5)
void OnStart()
{
    const A *a;
    const A *a1 = f( a );    // ошибка не обоснована: T -> const A, и в отсутствии (6) применимо (3)
          A *a2 = f( a );    //ошибка    обоснована, но по другой причине: A* = const A*
                  f( a, a ); //ошибка    обоснована, но по другой причине: T -> A, и отсутствует f(const A*,const A*)
}

(*) In general, in pattern (1) both A->(2) and const A->(3) can be substituted for T. Unlike e.g. template (4), where only A->(5) can be substituted for T.

Now only the A->(2) substitution works, so for full use we have to make two templates instead of one:

template<typename T> //---------------------------------------------------//(1)
      T *f(       T* t ) { return t; }
template<typename T> //---------------------------------------------------//(6)
const T *f( const T* t ) { return t; }

Note: Explicit definition (6) has higher priority than the general case (*)

Total: In the absence of pattern (6), pattern (1) with signature (3) was expected to apply

 
A100:
I'm really asking you to post something on the kodobase! For educational purposes.
 
1) Does the MT5 update the open positions and trading history after an OrderSend call occur with some delay? If yes, what is the recommended timeout for waiting?

2) Same question for MT4, for comparison.
 

RickD:
1) Обновление открытых позиций и торговой истории в MT5 после вызова OrderSend происходит с некоторой задержкой? Если да, какой рекомендуется timeout для ожидания?

MT5-OrderSend is NOT fully synchronised - there is no synchronisation with the trading environment. This means that the history readings do not correspond to the real situation.

No timeout is out of the question. There is no reliable solution to the problem, because you have to deal with synchronization issues at the terminal level, not at the server level.

In fact, MT5 users are facing what MT4 bridge developers are facing.

If an OrderSend is sent, you have to REMEMBER (this is where the potential vulnerability is) that it is done. Then ignore the current history (trading environment) until the corresponding message comes in OnTrade. Once it arrives, REMEMBER to FORGET.

When there is no REMEMBER, you can trust the history as in MT4.

2) Same question for MT4, for comparison.
MT4-OrderSend is FULLY synchronized.
 

Версия и битность терминала

Version: 5.00, build 1445 (07.10.2016), 32 bit.

Problem description

The indicator fails to copy the data of the standard indicators (built-in MT5) from another timeframe (different from the current timeframe of the chart where the indicator is installed). At the same time the "handle" of the standard indicator can be obtained, but the CopyBuffer() function always returns -1. In the visualization mode of the tester the problem does not occur, but in the terminal on the chart (to which the indicator is attached) the problem is always present.

Sequence of Actions

described above.

Result obtained

Described above.

Expected result

Correct copying of the data of standard (and preferably custom) indicators from other timeframes into the indicator.

Additional information

In earlier "builds" this problem did not occur.

Has anyone encountered such a problem? Is it a "bug" of the terminal or mine?

 

fxsaber:

...If an OrderSend is sent, you have to REMEMBER (this is where the potential vulnerability lies) that it is done. Next, disregard the current history (trading environment) until the appropriate OnTrade message arrives. As soon as it arrives, the REQUIRED should be FORBIDDEN...

Either my memory is leaky, or the documentation in the OnTrade part has been updated:

...If the OrderSend() function call is successful and returns true, this means that the trading server has queued the order to be executed and assigned a ticket number to it. As soon as the server processes this order, the Trade event will be generated. And if the user remembers the ticket value, he/she can find out what exactly happened to the order using this ticket when processing OnTrade() event...

In other words, triggering OnTrade at the i-th step is a guarantee that the order is accepted on the server.

 
Dennis Kirichenko:

Either my memory is fuzzy or the OnTrade part of the documentation has been updated:

In other words, triggering OnTrade at step i is a guarantee that the order is accepted on the server.

Remembering the ticket (not the fact that it will be returned by OrderSend) or the very fact that OrderSend with true-return was made is REAL.
 
fxsaber:
Remembering the ticket (not the fact that it will be returned by OrderSend) or the fact that OrderSend with true-return was made is MUST.

Everything is fine there, order placement should be controlled through OnTradeTransaction, by the way, if you connect to the exchange directly through Plaza2, the situation is the same - you need to control the arrival of messages about order placement. In MT4, this function is synchronous, but the same option is available in MT5, only in this case, the logic will stop until the function receives no response.

If you need, then I can send you the control class, though it is written for market placing, but soon I will finalize it for limiters.