Trade history moves to foreground

 

Hello Community,

when you attach a dialog to the chart, for instance, the Contorls Dialog located in folder Expert Advisor / Examples

and Chart on foreground is switched off, the dialog is in z order "on surface", so that the trade lines (of order history) are behind

the dialog. So the dialog is in foreground.



If you then place an order, the trade history moves on forground.

For me this seems to be an unwanted side effect.


Is it possible to turn this behaviour somehow off?

Thank you for help.


MetaTrader 5, Build 4755.

 
Cornelius Eichhorst:

Hello Community,

when you attach a dialog to the chart, for instance, the Contorls Dialog located in folder Expert Advisor / Examples

and Chart on foreground is switched off, the dialog is in z order "on surface", so that the trade lines (of order history) are behind

the dialog. So the dialog is in foreground.



If you then place an order, the trade history moves on forground.

For me this seems to be an unwanted side effect.


Is it possible to turn this behaviour somehow off?

Thank you for help.


MetaTrader 5, Build 4755.

Trade history objects are Objects just like other objects. You can right click in your chart, click on the Object List, and edit the trade history into the background.

Or you could write a script that programmatically finds and modifies the Objects' properties semi-automatically.

 
Ryan L Johnson #:

Trade history objects are Objects just like other objects. You can right click in your chart, click on the Object List, and edit the trade history into the background.

Or you could write a script that programmatically finds and modifies the Objects' properties semi-automatically.

Thank you for comment. Perhaps i was not clear enough.


The point is:

- There is a trade history.

- Then i attach the controls dialog to the chart.

- All lines of the trade history and trades are behind the dialog.


So far so good.


Now i place an order.

This moves ALL trade history to foreground.

That seems not correct to me.


I checked out what happens, when open object list, select all, click on Properties and check "Draw object as background".

Nothing changes. The trade history remains in foreground. But this is not what i want, even it would work.


Just want the dialog to be/stay in foreground in any case because overlapping objects make the look somehow weird.

This behaviour applies for the sample dialog provided by MetaQuotes and can easily be reproduced.


The script could be a solution but requires to run on each new transaction.

The question remains: Why do all the trades lose their z-order just because a new order been placed?

Thank you for ideas.

 
Cornelius Eichhorst #:

Thank you for comment. Perhaps i was not clear enough.


The point is:

- There is a trade history.

- Then i attach the controls dialog to the chart.

- All lines of the trade history and trades are behind the dialog.


So far so good.


Now i place an order.

This moves ALL trade history to foreground.

That seems not correct to me.


I checked out what happens, when open object list, select all, click on Properties and check "Draw object as background".

Nothing changes. The trade history remains in foreground. But this is not what i want, even it would work.


Just want the dialog to be/stay in foreground in any case because overlapping objects make the look somehow weird.

This behaviour applies for the sample dialog provided by MetaQuotes and can easily be reproduced.


The script could be a solution but requires to run on each new transaction.

The question remains: Why do all the trades lose their z-order just because a new order been placed?

Thank you for ideas.

Although I recall another trader who was running a "module" having fixed Objects to the background, I'm unable to find that post in the forum. I don't know whether that module was the same as your dialogue. Sorry.

 
Ryan L Johnson #:

Although I recall another trader who was running a "module" having fixed Objects to the background, I'm unable to find that post in the forum. I don't know whether that module was the same as your dialogue. Sorry.

No matter.

The dialog I use is part of the distribution, essentially CAppDialog. Setting the background flag for all “autotrade” objects was not successful.

However, when handling transactions for the chart symbol, only TRADE_TRANSACTION_DEAL_ADD and in this case simply call
CAppDialog::Hide() followed by CAppDialog::Show() and ChartRedraw(0), the dialog remains in the foreground.

This solves the problem for me.

 
Cornelius Eichhorst #:

No matter.

The dialog I use is part of the distribution, essentially CAppDialog. Setting the background flag for all “autotrade” objects was not successful.

However, when handling transactions for the chart symbol, only TRADE_TRANSACTION_DEAL_ADD and in this case simply call
CAppDialog::Hide() followed by CAppDialog::Show() and ChartRedraw(0), the dialog remains in the foreground.

This solves the problem for me.

Now that is what I call thinking outside the box.👍

This thread should now be a sticky topic in the forum.