Calling functions from the dll and returning results

 
I am interested in this question: yes, we can call dll function from EA and pass current parameters there, but how from dll after decision to place order???? The first thing that comes to mind is to return the result so that EA sets the order, but in some other difficult cases, e.g. we decide to close the old order and put 2 pending orders in different directions with stop loss and take profit. How should we signal to the Expert Advisor in this case? There is no structure or list in the language. And this is the easiest case, what should we do if the system is working with several orders at the same time? If we could close/execute/modify orders directly from dll, no problem.
 
Organise one or more arrays in the EA. Pass them to the dll. There you make useful actions and fill these arrays with values. Then analyse these values in the Expert Advisor and place orders as and where you want.
 
It's terribly inconvenient, if only there were an array of structures... As it is, if there are several orders, it means an array for each order parameter and this whole crowd of arrays into a function... It would be easier to pass 3 references to procedures of setting/deleting/modifying orders, and the dll would just pick them up internally. Besides, there is no definition of constants or enumerated types, which means that instead of res_SetOrder I must pass 1 or another number and remember all these values... And they want to sell this as a "full-fledged" api replacement...
 
And you think about it and you will find a great and beautiful solution.
You just have to want to...
 
You mean there is already a solution and I am invited to guess about it :) or am I invited to invent it because you don't know about it? For me the most normal solution would be to give the dll the ability to set orders and have access to information on open positions - there would be no need to run parameters back and forth.
 
You mean there is a solution and I'm invited to guess it :) or am I invited to invent it because you don't know about it?


No, he's just showing off. His hypertrophied sense of self-importance prevents him from giving a normal answer. Undivided by the forum :)
 
В смысле решение уже есть и мне предлагается о нем догадаться :) или мне предлагается его изобрести потому что Вы о нем не знаете?


No, he's just showing off. His hypertrophied sense of self-importance prevents him from giving a proper reply. Not shared by the forum :)

Dear tester,

For venomous remarks, there are other, freer forums where much is permitted.
And in our forum the rules apply, described on the page https://www.mql5.com/en/forum, which you agreed to when you entered the forum. Please read it again.

This is a warning.
 
Mmmm, what about the answer to my question? Is there a solution or is there not? And if there is, please read it out.
 
В смысле решение уже есть и мне предлагается о нем догадаться :) или мне предлагается его изобрести потому что Вы о нем не знаете?


Да нет, он просто выпендривается. Дать нормальный ответ ему не позволяет гипертрофированное чувство собственной значимости. Неразделенное форумом :)

Dear tester,

For venomous remarks there are other freer forums where much is permitted.
And our forum has rules, described on the page https://www.mql5.com/en/forum, which you agreed to when you entered the forum. Please read it again.

This is a warning.


I'm sorry, which paragraph did I violate?
 
Shit, tester, did you have to write such a provocative post? What was the point of it? Mike asked a question that interests a lot of people, me for sure, Renat said that there is a nice solution. So you need to give him an understandable answer. Do you need an answer or an opportunity to argue? (Just in case - after each sentence - :)

Dear Renat! Could you clarify your idea of a simple and beautiful solution a bit? Or at least give a hint, where the dog is hidden?

Respectfully, etc.
 
Shit, tester, did you have to write such a provocative post? What was the point of it? Mike asked a question that interests a lot of people, me for sure, Renat said that there is a nice solution. Well, you need to give him an understandable answer. Do you need an answer or an opportunity to argue? (just in case - after every sentence - :)<br / translate="no">

Yeah, had to :( Wanted to help Renat understand that his replies of this kind are just a veiled form of telling him to fuck off... Instead of substantive answers it's a show of his own awesomeness. Ah, the youth :)

That's why I wouldn't want to engage in "spinning him for an understandable answer". I would like to receive understandable answers without spinning it. But that requires a desire to help users, rather than brushing aside their "stupid" questions.

P.S. Although I must admit I had that attitude when I was young :)
Reason: