Questions from Beginners MQL5 MT5 MetaTrader 5 - page 1451

 
Hello. I have a problem with trailing stop for MOEX. During clearing the position is closed and opened at the price at the time of clearing, accordingly trailing stop is calculated from the clearing price, which breaks all logic, but on the chart there is a mark in the form of an arrow (autotrade # .......) which contains data about the initial opening price. Question: where in the code to take data from this mark?
 
Keep a record of the opening prices of current positions in your array, and then reconcile.
 
Pavel Nikiforov MOEX. During clearing the position is closed and opened at the price at the time of clearing, accordingly trailing stop is calculated from the clearing price, which breaks all logic, but on the chart there is a mark in the form of an arrow (autotrade # .......) which contains data about the initial opening price. Question: where in the code to take data from this mark?

1. The price is in the deal (deals, there can be several of them for one order) of opening a position in the history.

2. I save the price, again, taking into account all deals and their volume, in the robot's status file.

 
Aleksei Stepanenko current positions in my array and then check it against each other.

At first I thought about it, but the data is already stored in the label and maybe there is a way to access it?

 

6779

1

 
This is not reliable. A label can be accidentally deleted or dragged. Array, and loading it from a file when EA starts is better. It is more complicated, of course, but not by much
 
Pavel Nikiforov #:

I thought of that at first, but the data is already stored in the tag and maybe there is a way to access it?

And if there are several robots trading on the chart, how can I find out where the mark is?

Take an order, search the history for all trades on that order.

 
That's right
 

Are single test reports always created as .htm?

Changing the extension differently I didn't get any other way.

[Tester]

  • Report - name of the file where the report on the results oftesting or optimisation will be saved. The file will be created in the directory of the trading platform. The path of file saving can be specified in relation to this directory, for example \reports\tester.htm. The subfolder where the report is saved must exist. If no extension is specified in the file name, the ".htm" extension will be automatically used for the test report and the *.xml extension will be used for the optimisation report. If this option is not present, the test report will not be saved as a file. If forward testing is enabled, its results will be saved as a separate file with the suffix ".forward". For example, tester.forward.htm.
 

2. Do you have to start a task and close the terminal to start the next task always?

3. Can't you make a configuration file

путь_к_платформе\terminal64.exe /config:c:\myconfiguration.ini

in which there would be several tasks instead of one?


https://www.metatrader5.com/ru/terminal/help/start_advanced/start

Запуск платформы - Для продвинутых пользователей - Начало работы - Справка по MetaTrader 5
  • www.metatrader5.com
По завершении установки в меню "Пуск" создается группа программ торговой платформы, а на рабочем столе дополнительно помещается ярлык...
Reason: