Errors, bugs, questions - page 973

 
voix_kas:

...

What can I say? One Bitmap works (!) an order of magnitude slower than 26 regular labels. I've tried to exclude from OnTick() operation of pattern copying into working canvas (array uint 250*410), i.e. operation on one canvas. The gain is felt only in real time. In the tester it's the same, with absolute productivity degradation.COLOR_FORMAT_ARGB_NORMALIZE mode was used, as the others give a less aesthetic look. Getting ahead of myself, I should say that working on one canvas is difficult because you have to track overlapping of previous overlays (clear areas).

...

Do you have objects like OBJ_BITMAP_LABEL displayed in visualization mode in the tester?
Документация по MQL5: Стандартные константы, перечисления и структуры / Константы объектов / Типы объектов
Документация по MQL5: Стандартные константы, перечисления и структуры / Константы объектов / Типы объектов
  • www.mql5.com
Стандартные константы, перечисления и структуры / Константы объектов / Типы объектов - Документация по MQL5
 
tol64:

Thank you, I know that. vdv2001 has some kind of problem with it:

//---

Wanted to see how he does it to find he has a bug.


Then another quote from the help

CHART_MOUSE_SCROLL

Scroll the chart with the left mouse button horizontally. Vertical scrolling is also available if any of the three properties is set to true: CHART_SCALEFIX, CHART_SCALEFIX_11 or CHART_SCALE_PT_PER_BAR

bool

 
Ah, I see what it is. ))
vdv2001:

Yes, the object is selected, but it cannot be moved with the mouse (like in terminal 4).

Or now moving all objects created by Expert Advisor must be handled by events.

In MT5, I have to precisely place the mouse cursor on the anchor point of a selected object. In MT4 it is done automatically. I personally prefer to move objects without selection through events. Above Rosh showed the property to enable/disable chart scrolling, so it won't interfere with moving objects.
Документация по MQL5: Стандартные константы, перечисления и структуры / Константы объектов / Свойства объектов
Документация по MQL5: Стандартные константы, перечисления и структуры / Константы объектов / Свойства объектов
  • www.mql5.com
Стандартные константы, перечисления и структуры / Константы объектов / Свойства объектов - Документация по MQL5
 
tol64:
Ah, I see what it is. )) In MT5, I have to precisely place my mouse cursor on an anchor point, when an object is selected. In MT4 it is automatic. I personally prefer to move objects without selection through events. Above Rosh showed the property to enable/disable chart scrolling, so it won't interfere with moving objects.

Increased the graph to maximum, set the mouse on the anchor point of the selected object "pressed" the left mouse button to the floor, applied maximum effort and ...

The object stayed in place.

To repeat this process is not difficult, create an object CChartObjectTrend, set its properties and try to move it. I have not succeeded.

CHART_MOUSE_SCROLL I tried it and the chart stops moving, but the object hasn't moved.

P.S.

Although, if handling the movement of an object through events, it is correct (I know the old coordinate) . I will do through events. Thank you, the question closed.

 
vdv2001:

Increased the graph to maximum, set the mouse on the anchor point of the selected object "pressed" the left mouse button to the floor, applied maximum effort and ...

The object stayed in place.

It's not hard to repeat this process, create a CChartObjectTrend object, set its properties and try to move it. It didn't work for me.

...

That's how it works, if anything:

void OnStart()
  {
   double low[];
   datetime time[];
   string name_object="Trend_Test";
//---
   ArraySetAsSeries(low,true);
   ArraySetAsSeries(time,true);
//---
   CopyLow(_Symbol,_Period,0,50,low);
   CopyTime(_Symbol,_Period,0,50,time);
//---
   if(ObjectCreate(0,name_object,OBJ_TREND,0,time[0],low[0],time[49],low[49]))
      ObjectSetInteger(0,name_object,OBJPROP_SELECTABLE,true);
  }
 

Has anyone managed to repeat the feat ofvoix_kas?

voix_kas:
...
Что могу сказать? Один Bitmap работает (!)на порядок медленнее, чем 26 обычных меток. Пробывал исключить из OnTick() операцию копирования шаблона в рабочую канву (массив uint 250*410), т.е. работа на одной канве. Выигрыш чувствуется только в реал-тайме. В тестере всё также - абсолютная просадка по производительности. Использовался режим COLOR_FORMAT_ARGB_NORMALIZE, т.к. остальные дают менее эстетический вид. Забегая вперед, надо сказать, что работать на одной канве сложно, так как придётся отслеживать наложение предыдущих надписей (очищать области).

...


Do you have OBJ_BITMAP_LABEL type objects displayed in visualization mode in your tester !??

//---

Or is that a typo? )))

 
For the bitmap performance calculation, it is advisable to look at the code. Maybe there are extra redrawing operations.
 
tol64:

That's how it works, if anything:

Right, I figured out why I wasn't moving, I set the object propertyOBJPROP_TIMEFRAMES after which the object stops moving.

I.e. for the minute chart I set the property

obj.Timeframes(OBJ_PERIOD_M1);

and the object stops moving, it seems to be a glitch.

Everything starts working normally after switching the chart period like switching to M2 and then M1 and everything is ok.

 

voix_kas:

What can I say? One Bitmap works (!) an order of magnitude slower than 26 regular labels. I've tried to exclude from OnTick() operation of pattern copying into working canvas (array uint 250*410), i.e. operation on one canvas. The gain is felt only in real time. In the tester it's the same, with absolute productivity degradation.COLOR_FORMAT_ARGB_NORMALIZE mode was used, as the others give a less aesthetic look. Looking ahead, I should say that working on one canvas is difficult because you have to track the overlay of previous inscriptions (clean areas).


1. How do you measure speed?

2. Can you attach the source (in a private message or in a CD)?

 
alexvd:


1. How do you measure the speed?

2. Can you attach the source code (in a private message or in a CD)?

Unfortunately, I didn't save the code due to lack of interest. Ingeneral terms:

OnInit():

1. Creates a Bitmap on the chart.

2. Two canvases are created(uint 250*410): a template and a working one. On the template 13 labels with the name of statistical parameters are applied (TextOut).

OnTick():

1. The template is copied to the working canvas.

2. The 13 labels with the corresponding values of the statistical parameters are applied (TextOut) to the working canvas.

3. Creates a resource.

4. the working canvas is updated.

I didn't take any particular timekeeping, because it's obvious that the speed has decreased by an order of magnitude. What in the tester, as well as in real-time (when scrolling graph is quite obvious freezes / jerks).

I tried to remove point 1. from OnTick(). In real-time, it becomes tolerable, but tester barely crawls. Again, this cannot be done in real time, as no cleaning has been done at the locations of the previous marks on the working canvas.

Again, I usedCOLOR_FORMAT_ARGB_NORMALIZE mode, because labels(TextOut) look unaestheticwithout alpha channel.

Reason: