Questions from Beginners MQL5 MT5 MetaTrader 5 - page 842

 

Question on graphical objects in MT5.


I can't place Label on top of BMP object.


I draw BMP, then draw Label. Label appears below

How can I manage the position of objects on a chart? Can I place some higher, some lower?

 
Sergey Likho:

Question on graphical objects in MT5.


I can't place Label on top of BMP object.


I draw BMP, then draw Label. Label appears below

How can I manage the position of objects on a chart? Some of them go up, some of them go down?

The last one is on top. I checked it manually, that's how it is. Are you sure that in your code you are NOT re-creating BMP?

 
Vladimir Karputov:

Whoever is last is on top. Checked it manually - it is. Are you sure you are NOT re-creating the BMP in your code?

Whoever put on the dressing gown first is the doctor. -:)))))

 
Sergey Likho:

Question on graphical objects in MT5.

I can't place Label on top of BMP object.

I draw BMP, then draw Label. Label appears below

How can I manage the position of objects on a chart? Can I put some higher, some lower?

Do you use it from the example in the Label documentation or it concerns only BMP? How does it work in relation to other formats? What is the visibility mode of the BMP itself?

//--- display on the front (false) or back (true)
ObjectSetInteger(chart_ID,name,OBJPROP_BACK,back);

 
Vladimir M.:
Do you use it from the example in the Label documentation? Or it concerns only BMP? How does it work in relation to other formats? What is the visibility mode of BMP itself?

//--- display on front (false) or back (true)
ObjectSetInteger(chart_ID,name,OBJPROP_BACK,back);

Yes, thank you.

I actually have a rather cumbersome EA with a lot of panels. And it's hard to figure out exactly what's causing it.

In fact, I'm almost stumped. Right now the Labl's are in the object list. (They have font, colour, text...) But they are not on the chart. How this can be, I don't understand.

---

Most likely, in about 3 hours, I'll find a line like - DeleteAllLabels, by removing which everything will be as it should be.

 

Sergey Likho:

Move the coordinates, maybe the text has left the field or "hidden" behind another object.

 
Sergey Likho:

Yes, thank you.

I actually have a rather cumbersome EA with a lot of panels. And it's hard to figure out exactly what's causing it.

In fact, I'm almost stumped. Right now the Labl's are in the object list. (They have font, colour, text...) But they are not on the chart. How this can be, I don't understand.

---

Most likely, in about 3 hours, I'll find a line like - DeleteAllLabels, by removing which everything will be as it should be.

Look in the object's properties - on which charts they're supposed to show up

Maybe they are not visible on the period where you are looking for them

Or maybe they are shown somewhere far in the past or outside the screen

...In any case, start with the object properties

 

Input field OBJ_EDIT

1. Mid-alignment in the tester does not work. Is this supposed to work? (try the code below running in the tester)


2. On the real chart In the list of objects, but not on the chart.

It needs to change one property in the MT4 settings. The object appears.

Maybe, I messed up something in the Expert Advisor's code.

void OnTick()
  {
//---
   Input("Name","text here",100,100,300,20,clrBlue,10,false,clrRed);
   ChartRedraw();
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
void Input(string name,string text,int x,int y,int sizex,int sizey,color clr=clrGreen,int tsize=10,bool readOnly=false,color txtcolor=clrRed,int align=ALIGN_CENTER)
  {
   if(!ObjectCreate(0,name,OBJ_EDIT,0,1,1)){printf(GetLastError());}
   ObjectSetInteger(0,name,OBJPROP_XDISTANCE,x);
   ObjectSetInteger(0,name,OBJPROP_YDISTANCE,y);
   ObjectSetInteger(0,name,OBJPROP_XSIZE,sizex);
   ObjectSetInteger(0,name,OBJPROP_YSIZE,sizey);
   ObjectSetInteger(0,name,OBJPROP_FONTSIZE,tsize);
   ObjectSetInteger(0,name,OBJPROP_COLOR,txtcolor);
   ObjectSetInteger(0,name,OBJPROP_BORDER_COLOR,clr);
   ObjectSetString(0,name,OBJPROP_TEXT,text);
   ObjectSetInteger(0,name,OBJPROP_ALIGN,ALIGN_CENTER);
  }

By the way, almost the same code works as needed in MT4.


3. I also decided to finally switch to MT5. I still cannot handle these orders and positions. (Is there any material on this subject?) Please advise, how can I read positions similar to MT4? I need to find a deal on a ticket. Also, I do not understand how to read SL and TP in the history?

 
Sergey Likho:

Input field OBJ_EDIT

1. Mid-alignment in the tester does not work. Is this supposed to work? (try the code below running in the tester)


2. On the real chart In the list of objects, but not on the chart.

It needs to change one property in the MT4 settings. The object appears.

Maybe, I messed up something in the Expert Advisor's code.

By the way, almost the same code works as needed in MT4.


3. I also decided to finally switch to MT5. I still cannot handle these orders and positions. (Is there any material on this subject?) Please advise, how can I read positions similar to MT4? I need to find a deal on a ticket. Also, I don't understand how to read SL and TP in history yet?

The mt5 tester does not work with the chart, you can only press buttons, and that's it.

What is a position and order is a well-known fact: Order is an order (read the meaning of the word, you can find it in the wiki), if the price reaches it, the broker is obliged to execute it (pending orders). A position is your position in the market at a certain price (market place), it means Buy and Sell. Buy and Sell cannot be an order (order), it has already been executed.

There is a lot of material written on mt5 in articles, in kodobase and on the forum

 
Vitaly Muzichenko:

The mt5 tester does not work with charts, you can only press buttons and that's it.

What is a position and an order, is a well-known fact: An order is an order (read the meaning / translation of the word, you can in the wiki), that is, an order if the price is reached, then the broker is obliged to execute it (Pending Orders), a position is your occupied position in the market at a certain price (market place), that is Buy and Sell. Buy and Sell cannot be an order (order), it has already been executed.

You can find a lot of material on mt5 in the articles, kodobase and on the forum.

I have already written many articles and reviews on mt5, thank you.

Can you tell me why OBJ_EDIT may not be shown on the real chart?

Reason: