Errors, bugs, questions - page 2982

 
Ruslan Fakhretdinov:

Hello.

For several years I have been looking at the same picture, I thought I would get used to it, but I won't! This bug is very annoying!

Error in the incorrect display of deal history on the chart, when partially closing a position!

Looks quite illogical, VERY please fix it in the next update!

Thanks in advance!

I also wrote about it once...

 
fxsaber:
Share something interesting at the KB.

Here you go, as promised:https://www.mql5.com/ru/code/33898

Дисплей с оптимизацией для вывода текста в чарт по типу консоли
Дисплей с оптимизацией для вывода текста в чарт по типу консоли
  • www.mql5.com
Данная библиотека позволяет создавать дисплеи для удобного вывода текстовой информации в чарт с наиболее оптимальной скоростью
 

Please explain why the second option is faster than the first?

class A
{
public:  
  virtual int f() const { return(1); } 
};

class B : public A
{
public:
  virtual int f() const { return(2); } 
};

template <typename T>
int g( T Ptr )
{
  int Res = 0;
  
  for (int i = 0; i < 1 e6; i++)
    Res += Ptr.f();
    
  return(Res);
}

#include <fxsaber\Benchmark\Benchmark.mqh> // https://www.mql5.com/ru/code/31279

void OnStart()
{  
  A* Ptr = new B;
  
  _B(g(Ptr), 1);     // 3600 mcs.
  _B(g((B*)Ptr), 1); // 2440 mcs.  
  
  delete Ptr;
}
 
lack of virtuality? given that the function is completely empty, the difference is minimal and cannot be critical.
 
s4sha45:

Hello all! Just started to learn how to write a simple trading robot from the examples of YouTube videos. I want to write a script to open the first buy order, and it must open if I have no other open orders, the script wrote this, but the order does not open, please advise what is the error!


***

1. You have to paste the code correctly (use button Code)

2. For newbies there are special topics (for old terminal -Questions from Beginners MQL4 MT4 MetaTrader 4 and for MQL5 -Questions from Beginners MQL5 MT5 MetaTrader 5)

Вопросы от начинающих MQL4 MT4 MetaTrader 4
Вопросы от начинающих MQL4 MT4 MetaTrader 4
  • 2016.11.08
  • www.mql5.com
Если у Вас вопросы по MQL4, MT4, MetaTrader 4, пожалуйста пишите в этой теме. Особенно когда вопросы касаются торговых функций...
 
Andrei Trukhanovich:
no virtuality? given that the function is completely empty, the difference is minimal and cannot be critical.

I would like to find out what additional calculations are made when virtualisation takes place?

 
fxsaber:

I want to understand what additional calculations are done when virtuality is used?

The second one has no descendants.

In the second case there are no descendants, so most likely the compiler has removed the virtual and it turns out to be just a function.

 
fxsaber:

I want to understand what additional calculations are done with virtuality?

The second variant was completely optimized as a call of a usual function, including distribution of constants.

No conclusions can be drawn from this example due to extreme simplicity and complete degeneracy of the code.

 

1. Can you tell me, what is the maximumStringLen length of the characters? In MetaQuotes in MT5 I found a maximum 9 characters long symbol:Coffee_Z0. But trading on it is disabled. Hence, the second question follows.

2. Where can I test on a demo account for the MT5 using the stringLen!= 6 symbols? Although I suspect that such symbols are practically irrelevant.

 
x572intraday:

1. Can you tell me, what is the maximumStringLen length of the characters? In MetaQuotes in MT5 I found a maximum 9 characters long symbol:Coffee_Z0. But trading on it is disabled. Hence, the second question follows.

2. Where can I test on a demo account for the MT5 using the stringLen!= 6 symbols? Although I suspect that such symbols are practically irrelevant.

SBRF-3.21 or even GOLD-12.21 are relevant.

Reason: