Errors, bugs, questions - page 1421

 

A100:

class A { public:
template<typename T>
        A( T ) { Print( typename( T )); }
};
class B { public:
template<typename T>
        void f( T t ) { A a( t ); } //вызываем A::A(...)
};
void OnStart()
{
        B b;
        int i = 0;
        b.f( i ); } 
Result: int

Ha. And here's a slightly tweaked source code:

class A { public:
template<typename T>
        A( T ) { Print( typename( T )); }
};
class B { public:
template<typename T>
        void f( T t )
        {
          delete new A( t ); // должны получить новый класс A<string>, а используется A<int>
        }
};
void OnStart()
{
        B b;
        int i = 0;
        A *a = new A(1); // здесь хотим тип int
        b.f( "" ); // а тут передаем строку
        delete a;
}

outputs int twice instead of int and string.

The first (in order of algorithm execution) output of constructor type affects the second created instance of templated class.

The service desk is silent at the moment (ticket number#1336035).

 
Ilya Malev:
Are MT5 functions supposed to work in MT4?
Service Desk suggested discussing the topic on the forum. Here is the link if you are interested: https://www.mql5.com/ru/forum/66180
Сервисдеск. Жалобы, предложения.
Сервисдеск. Жалобы, предложения.
  • www.mql5.com
Поэтому уменьшайте количество баров на графике до необходимого предела. - - Категория: общее обсуждение
 
Stanislav Korotky:

Ha. And here's a slightly tweaked source code:

outputs int instead of int and string twice.

I get int and string (MT5\1204\32). Try again - sometimes if appended to the graphic immediately after editing and compiling it can execute the previous version (before editing).

 

Good evening, friends!
Can you tell me why the stop loss is not always set, sometimes it is not.

 
Сергей Верещак:

Good evening, friends!
Can you tell me why the stop loss is not always set, sometimes it is not.

Stop Loss and Take Profit can be set no closer than a certain interval (different for each instrument) from the current price.
 
A100:

I get int and string (MT5\1204\32). Try again - sometimes if you attach to a graphic immediately after editing and compiling it can execute the previous version (before editing).

This is MT4. I have been trying it for the last few days. Build 902/32.
 
   ENUM_TIMEFRAMES tf=NULL;
   if(tf==NULL)   tf=Period();

Code generation error

Build 1200/64

 

Hello! I can't subscribe to the signal. What could be the reason and is there any way to solve it? the logbook says -

2015.11.01 08:31:01.786 '1448638': Signal - error purchasing product [136853] - attempt to subscribe to foreign signal, broker enabled only own signals


 

Carried over:

Forum on trading, automated trading systems and testing trading strategies

Discussion on article "How to publish your product in the Marketplace service"

Mihail Matkovskij, 2015.11.01 12:55

Can't update terminal to 902 build, it used to update everything, but now I can't do it for 3 days. Version: 4; build: 890; bit rate: 32. What may be the reason?

 

Memory leakage

class A {};
void OnStart()
{
        for ( A a; false; );
}
Reason: