Questions from Beginners MQL5 MT5 MetaTrader 5 - page 670

 
Alexey Volchanskiy:

Something is clearly not in the properties. And what if in tester mode you create something on the chart, for example, a button with a tricky name and then check its presence?

No, the indicator is on the main chart and during testing the chart of the tested pair is opened and at this moment the indicator understands that another chart has been added to the terminal and tries to manage it. But since it is a tester chart and not added from the market review, it does not need to be controlled.

How can I cut off a tester chart without adding anything to it?

 

Good afternoon.

Help me solve a problem: I need to protect the robot from switching the period and changing the instrument in the robot window to remember the start instrument and period, I think to create a global variable of the terminal with the name of the instrument and period, and the value is the ID of the chart window, but the ID is of long type, and the value of GPT type double, tried to transfer from long to double, but the terminal rounds the last two digits, how to fix it?! Or how to manage the chart differently, even in case of restarting the terminal.

Thanks.

 
Vitaly Muzichenko:

No, the indicator is on the main chart, but during testing the chart of the tested pair is opened, and at this moment the indicator realizes that another chart has been added to the terminal and tries to manage it. But since it is a tester chart and not added from the market review, it does not need to be controlled.

How can I cut off a tester chart without adding anything to it?

For example: On the main chart background colour is 1

on the tested chart background colour 2

The indicator polls the chart background colour

Or : the tester chart is launched by the Expert Advisor

Request the name of the Expert Advisor in the indicator

 
pako:

For example: on the main graph, background colour 1

on the test chart background colour 2

The indicator polls the background colour of the chart

The essence of the indicator: Many charts are open and the indicator is installed on only one chart. When adding a new chart from the market review, the indicator picks it up on the fly and manages it

Indicator: The usual synchronizer of all charts in the terminal, created for fast management and analysis, if you switch timeframe on one, it will switch to all in parallel, zoom in/out, synchronized scrolling.

In essence, charts can be different in colour and in the presence of objects on them, or even without objects. A tested chart may have different backgrounds depending on the TS under test and the mood.

Developers, isn't there any way to programmatically determine that the chart is from the tester?

 
Vitaly Muzichenko:

The essence of the indicator: Many charts are open and the indicator is installed on only one chart, when you add a new chart from market review, the indicator picks it up on the fly and manages it

Indicator: The usual synchronizer of all charts in the terminal, created for fast management and analysis, if you switch timeframe on one, it will switch to all in parallel, zoom in/out, synchronized scrolling.

In essence, charts can be different in colour and in the presence of objects on them, or even without objects. A tested chart may have different backgrounds depending on the TS under test and the mood.

Is there no way to programmatically determine that the chart is from the tester?

This will not work?

CHART_EXPERT_NAME

Name of the Expert Advisor running on the chart with the specified chart_id

https://www.mql5.com/ru/docs/constants/chartconstants/enum_chart_property#enum_chart_property_string
Документация по MQL5: Стандартные константы, перечисления и структуры / Константы графиков / Свойства графиков
Документация по MQL5: Стандартные константы, перечисления и структуры / Константы графиков / Свойства графиков
  • www.mql5.com
Стандартные константы, перечисления и структуры / Константы графиков / Свойства графиков - справочник по языку алгоритмического/автоматического трейдинга для MetaTrader 5
 
pako:

Will this not do?

The crux of the problem here

I'm re-attaching the code.
for(long currChart = ChartFirst(); currChart != -1; currChart=ChartNext(currChart)) { // проходим по всем графикам в терминале
  if(currChart == график тестера) continue; // Что сюда написать чтоб его пропустить?
  ObjectSetInteger(currChart,"Sync","что-то делаем с графиками");
}
 
Hello!
During weekends the Market is closed and there are no ticks with "last known server time" but there is a connection to the server. How can I find out the current time on the server at the weekend?
 
Leo59:
Hello!
During weekends the Market is closed and there are no ticks with "last known server time" but there is a connection to the server. How do I know the current time on the server at the weekend?
Communication is there but no ticks and server time comes with a tick. So only indirectly, through TimeLocal() and time zone difference.
 
Vitalie Postolache:
The connection is there, but there are no ticks, and the server time comes with a tick. So only indirectly, via TimeLocal() and time zone difference.
The server reacts to an attempt to open or set an order by returning error 132 ("Market is closed"). How can I extract and "pick up" the server time from this error signal?
 
Leo59:
The server reacts to an attempt to open or set an order by returning error 132 ("Market is closed"). How can the server time be extracted and "picked up" from this error signal?
This is just the return code of the trading server. It does not contain anything other than that code.
Reason: