How do I make the output on a chart in monospaced font? - page 4

 
Alexey Volchanskiy:

These measurements are nothing. We should make separate cycles of several tens of thousands of passes for Comment and Canvas separately, then we can judge something. And the text to be printed should change, for example, let the counter value be printed.

Could you re-do it this way?

Repeated output is correct, Comment kills speed in mt5. I checked it a long time ago and excluded its displaying during testing.

I did not checkCHART_COMMENT, just remembered about it, will have time - check the speed

//+------------------------------------------------------------------+ 
//| Функция получает текст комментария в левом верхнем углу графика. | 
//+------------------------------------------------------------------+ 
bool ChartCommentGet(string &result,const long chart_ID=0) 
  { 
//--- сбросим значение ошибки 
   ResetLastError(); 
//--- получим значение свойства 
   if(!ChartGetString(chart_ID,CHART_COMMENT,result)) 
     { 
      //--- выведем сообщение об ошибке в журнал "Эксперты" 
      Print(__FUNCTION__+", Error Code = ",GetLastError()); 
      return(false); 
     } 
//--- успешное выполнение 
   return(true); 
  } 
//+------------------------------------------------------------------+ 
//| Функция устанавливает текст комментария в левом верхнем углу     | 
//| графика.                                                         | 
//+------------------------------------------------------------------+ 
bool ChartCommentSet(const string str,const long chart_ID=0) 
  { 
//--- сбросим значение ошибки 
   ResetLastError(); 
//--- установим значение свойства 
   if(!ChartSetString(chart_ID,CHART_COMMENT,str)) 
     { 
      //--- выведем сообщение об ошибке в журнал "Эксперты" 
      Print(__FUNCTION__+", Error Code = ",GetLastError()); 
      return(false); 
     } 
//--- успешное выполнение 
   return(true); 
  }
 
Nikolai Semko:

Tried it on MT4. The code works on it too.
It turned out that Comment is 5 times faster on MT4 than its graphical analogue. And it turns out that Comment() works 5-6 times slower on MT5 than on MT4. Now this is an unpleasant and strange surprise. So my question is to the developers. How come? It's clearly a bug for 5!!!


Thanks for the info, very sad for MT5 and even sadder that it's so different in MT4 and MT5, compatibility turns out to be poor in a multi-platform EA.

 
Yury Kirillov:

Thanks for the info, very sad for MT5 and even sadder that it's so different in MT4 and MT5, compatibility turns out to be poor in a multi-platform EA.

There is some. I have completely eliminated the output of objects and information on the chart in mt5, lost not much at all, at the expense of a good tester report.

 
Yury Kirillov:

Thanks for the info, very sad for MT5 and even sadder that it's so different in MT4 and MT5, compatibility turns out to be poor in a multi-platform EA.


I think the best option would still be to switch to kanvas. The compatibility of MT4 and MT5 is perfect there. And Comment is interesting only for quick running checks in draft code, but not in the final one. Everyone underestimates the speed capabilities of Kanvas for some reason.

 
Nikolai Semko:

I think the best option would still be to switch to Canvas. MT4 and MT5 are fully compatible there. And Comment is interesting only for quick current checks in draft code, but not in final code. Everyone underestimates the speed capabilities of Canvas for some reason.


Clearly, that's what we'll have to do...

 
Nikolai Semko:

Did the cycles separately too, thought the results were a bit odd, same thing. Same results. There's no difference whether it's a general cycle or individually. In my sample the text changes each time, I wonder why it hasn't been noticed. I know about compiler's optimization too. ))


And may I post the code with separate loops?

 
Vitaly Muzichenko:

The repeated conclusion is correct, Comment kills the speed in mt5 badly. I checked this a long time ago, and excluded its display during testing.

I didn't checkCHART_COMMENT, just remembered about it, will have time to check speed

From the SD.

Someone can set up the exchange of string information between EA and indicator via chart comment field.

We have decided that for the sake of a small number of such potential users we should not slow down the optimization.

In the next builds, the Comment function will only work in single testing. During optimization - it will not

 
fxsaber:

From the SR.

exchange of string information between EA and indicator via chart comment field.

People are good at sexual perversions

And in general, of course, there is no method of exchange like memory mapping, but inside a sandbox and without calling dll

 
Alexey Volchanskiy:

Actually, what's missing is a memory mapping type exchange method, but inside a sandbox and without calling the dll

Plenty of options.

 

They are all surrogates. And each one requires serialization/deserialization. For example, in WCF I can send an instance of any complex class with data fields over the web using any available protocol and I don't need to think how to pack/unpack it, all is done by API. All I need is to know such a class at the receiving end.