Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 811

 
Artyom Trishkin:
Do you have a curve? It's never too late to learn.

More of a topic from the category: I want to achieve more impact and make programmes more compact and structured, which ultimately improves programme performance.

 
How do I return the variable address and index element of an array cell?
 
Seric29:
How to return address of variable and array cell index element?

https://docs.mql4.com/ru/basis/types/this

MQL programs do not have physical access to memory, they can only get a pointer to an object

Ссылки. Модификатор & и ключевое слово this - Типы данных - Основы языка - Справочник MQL4
Ссылки. Модификатор & и ключевое слово this - Типы данных - Основы языка - Справочник MQL4
  • docs.mql4.com
В MQL4 параметры простых типов можно передавать как по значению, так и по ссылке, в то время как параметры сложных типов всегда передаются по ссылке. Для указания компилятору на необходимость передачи параметра по ссылке, перед именем параметра ставится знак амперсанда Передача параметра по ссылке означает передачу адреса переменной, поэтому...
 

Please advise my friends. I am getting requotes on the MT5 with Marekt Execution.

How do I correctly process this error to open a trade? I understand that my broker sends back the request to open the deal at 1.12875? How do you deal with this?

CTrade::OrderSend: instant buy 0.01 EURUSD at 1.12879 sl: 1.12655 tp: 1.14879 [requote (1.12875/1.12881)]

 
Yury Smagin:

Please advise my friends. I am getting requotes on the MT5 with Marekt Execution.

How do I correctly process this error to open a trade? I understand that my broker sends back the request to open the deal at 1.12875? How do you handle it?


Request

   uint              ResultRetcode(void)                   const { return(m_result.retcode);            }
and decide on the error code. Update the prices and try again.
 

Hello, during testing, I identified a situation that is not clear to me, when setting the timeframe of the graph M30, entry does not happen on the order, when setting M1, entry is, in the settings is testing on every tick. I thought that this setting does not affect the time frame chart and I can put the one that I feel comfortable with for reviewing the test results. Please help me to understand.

I am writing it down. I have just run the tests:

- setting every tick, no visualization, 1M: Gross profit 17695, Gross loss -19836

- setting every tick, without visualization, 30M: Gross profit 17634, Gross loss -19227


Тестирование стратегий - Алгоритмический трейдинг, торговые роботы - MetaTrader 5
Тестирование стратегий - Алгоритмический трейдинг, торговые роботы - MetaTrader 5
  • www.metatrader5.com
Тестер стратегий позволяет тестировать и оптимизировать торговые стратегии (советники) перед началом использования их в реальной торговле. При тестировании советника происходит его однократная прогонка с начальными параметрами на исторических данных. При оптимизации торговая стратегия прогоняется несколько раз с различным набором параметров...
 
Igor Makanu:

MQL programs do not have physical access to memory, they can only get a pointer to an object

That's bad - that's why we have all the trouble. And how to get it, what can be done? As far as I understand, it is possible to access the descriptor, but I do not know how to influence the address of storage variable through the descriptor. Is it possible to do it with a descriptor?

 

Yesterday I made a record in the following format.

int mas[0]=4,mas[1]=3;then I declared an array and tried to fill it with the values that are stored in the cells of this array

int Arr[]={mas[0],mas[1]}

and what do you think the error will be. If I had a sledgehammer at hand I'd smash the computer with it, go to America or wherever, find these idiots developers who put a ton of restrictions on mql and smash them with it, it's horrible. You can only write

int Arr[]={4,3} everything is so static, it's horrible.

Who knows how to write a letter to mql4 developers, is it possible to write in Russian, is there a technical support service?

 
Seric29:

It's bad, that's where all the trouble comes from. And how to get it what can be done? As far as I understood there is a way to access the descriptor, but I don't know how to influence the variable storage address through the descriptor. Is it possible to do this with a descriptor?

there is no problem

MQL is 90% like C++, there is no direct work with memory, such as allocation of memory, working with memory via pointers, etc., because MQL works under the control of the terminal, and is not an independent program in the OS

If you need to pass a value into a function - pass it by value or by reference

https://www.mql5.com/ru/docs/basis/function


pointers are used only when working with classes


you are looking for a spherical horse in a vacuum for several days, there is a specific task - there will be a specific implementation, MQL is quite a flexible language, with rich functionality and provides full interaction with the MT trading terminal - getting and processing historical data, sending trading commands, getting information about a trading instrument.... all information necessary for trading

If you need to write in a third-party software, MQL supports the connection of .dll - search through the forum - there are about 20 articles on the subject

Документация по MQL5: Основы языка / Функции
Документация по MQL5: Основы языка / Функции
  • www.mql5.com
Всякая задача может быть разбита на подзадачи, каждую из которых можно либо непосредственно представить в виде кода, либо разбить на еще более мелкие подзадачи. Данный метод называется определения функции. Заголовок функции включает в себя описание типа возвращаемого значения, имени (идентификатора) и формальных параметров.  Количество...
 
Igor Makanu:

https://docs.mql4.com/ru/basis/types/this

MQL programs do not have physical access to memory, they can only get a pointer to an object

I read this topic, the description is very overloaded and of course I don't understand it correctly. The description of how to access the class, how to call the class, what its members should be accessed or to call the whole form or to access via point, it is not clear how to describe the class separately or internally, and many other things seem to be present and cool, but it is not clear how it works. Are you saying that through a class and an ampersand you can access an address (this is the descriptor principle, working through an intermediary via a prototype)?