Does anybody know what 'pen creation error [87]' means?

 

I just wonder what may be the source of this error.

I am porting indicators with rather simple graphics (mostly editboxes) from MT4 to MT5, and (in addition to the MT5 performance, which is unbelievable slow and blocks the candle chart often) I am getting that error. It appears randomly, but still frequently, so it is very difficult to trace effectively. I guess it appears mostly when moving those graphical objects via MQL commands.


Did anybody encounter this error?

 
Ex Ovo Omnia:

I just wonder what may be the source of this error.

I am porting indicators with rather simple graphics (mostly editboxes) from MT4 to MT5, and (in addition to the MT5 performance, which is unbelievable slow and blocks the candle chart often) I am getting that error. It appears randomly, but still frequently, so it is very difficult to trace effectively. I guess it appears mostly when moving those graphical objects via MQL commands.


Did anybody encounter this error?

Never seen this error message.

Can you provide a test case ?

 
Alain Verleyen:

Never seen this error message.

Can you provide a test case ?

I cannot right now, I have to isolate the part which is responsible first. However I tried if someone else had an idea what went wrong.

 
Ex Ovo Omnia:

I cannot right now, I have to isolate the part which is responsible first. However I tried if someone else had an idea what went wrong.

Which MT5 build are you using ?
 
Alain Verleyen:

Never seen this error message.

Can you provide a test case ?

It appears I had already seen it here : https://www.mql5.com/en/forum/14588

Is your issue with the Strategy Tester ?

Pen Creation Error 87
Pen Creation Error 87
  • 2013.10.15
  • www.mql5.com
Does anybody know what this is? I get it when trying to test an indicator in strategy tester. The indicator draws trend lines on the chart thanks...
 
Alain Verleyen:
Which MT5 build are you using ?

1940 and 1944.

 
Ex Ovo Omnia :

I just wonder what may be the source of this error.

I am porting indicators with rather simple graphics (mostly editboxes) from MT4 to MT5, and (in addition to the MT5 performance, which is unbelievable slow and blocks the candle chart often) I am getting that error. It appears randomly, but still frequently, so it is very difficult to trace effectively. I guess it appears mostly when moving those graphical objects via MQL commands.


Did anybody encounter this error?

Answer from an Metaquotes developer:

Forum on trading, automated trading systems and testing trading strategies

New version of MetaTrader 5 build 1930: Floating graphs and .Net libraries in MQL5

Slava , 2018.11.20 06:58

The author is extremely active draws lines in different colors.

There are a lot of lines, a lot of colors, not enough RAM to create GDI CPen. 32-bit system?


 
Alain Verleyen:

Answer from an Metaquotes developer:


Thank you for the info.

  • In this particular case, I have a group of 17 edit boxes, and 6 rectangles (no other objects or indicators on the chart)
  • The colours use unified style (repeating patterns with the same colours), and actually this indicator panel was the simplest I had.
  • In the task manager the terminal displays using 38MB (of 8GB RAM).
  • I tried the 32-bit system, and the same error.

I do not expect that 23 custom objects might cause a resource problem even if they had combined all colours of a parrot. Moreover, it does not happen always - in the morning it reported no error, while now it keeps displaying them regardless on whether I restart the terminal.

I go on more testing, however I have also other issues, so this one I might investigate later.

 
Are these objects static in size ? 
 
Lorentzos Roussos:
Are these objects static in size ? 

Well, they are constant, if you talk about dimensions. They may move. But the error appears even if they do not move.

 
Try to do Profiling your code.
In MT5, many functions work differently than in MT4. For example, the chart has a queue of calls to graphic objects.
Reason: