My approach. The core is the engine. - page 61

 
Dmitry Fedoseev:

You can do something like this: in a dll, an array or two arrays, one for the object name and the other for the event type.

here!

I haven't checked it yet, but if the developers have advanced support for C#.Net, then maybe the exchange of complex data types between MT5 and .dll works , i.e., structures.

If the exchange of structures works, the task becomes even simpler and primitive.

we fill the structure with OrderProfit,OrderTicket,OrderStoploss.... on the tick ...and send this structure to a .dll and receive a response structure from the user ... Then the form rotates visual information on its own, the terminal itself.


Tag Konow:

And then create a TOTAL memory inside the .dll.

With increasing number of form elements and increasing complexity of MT5 program, this interaction becomes HEAVILY busy and complex.

Hmmm, what's complicated about that? You separate the visualization = .dll, separately the MT work

difficult to explain, do you have any idea what the speed of data exchange through memory? - we're not talking about a hundred thousand bytes per second there, not even millions, several billion bytes per second, and you're talking about the complexity of the exchange )))))

 
Реter Konow:

OK.

So it's necessary to:

  1. Create a DLL.
  2. Connect DLL to Windows application with a form.
  3. Write methods that translate events of pressing buttons and checkboxes into dll.
  4. Write methods that change the state of buttons and checkboxes in the widow application.
  5. Create shared memory in the dll. So that when accessing from MT5 the flag of state change for buttons and checkboxes is set. Then the Windows application accesses the shared memory, reads flags and uses them to know the state of one or another form element to be changed.
  6. Write cyclic reference to DLL from timer in MT5 for reading flags of function calls or entering text into fields.

    What if there are hundreds of elements?

    How to organize shared memory?

    What if it is necessary to change not only pressed/released state of elements in a form, but also their colour (for example, for buttons)?

    What if it is necessary to change text in entry fields of a form programmatically from МТ5?


    1. What is the problem? It's selecting the type of project when you create it.

    2. As seen in the example shown by Igor, the connection is done in one line, you don't even need to describe the import.

    3. A method is written once, saved to a file, and then it is used in all the projects without any changes.

    4. Probably, it is necessary, but they are simple. Not all of them are likely to be required, the interaction between control elements in c# will be different, and it may be necessary to place one event, and there will be 100 buttons on the form.

    5. This is related to point 3.

    6. Also one line with the right approach in point 3.

    7 - You have all the power of C# in your hands, the scale of which you seem to have no idea is enormous.

     
    Реter Konow:

    No offence, but sorry to be off-topic.

    You're taking the SIMPLEST example and extrapolating from it, thinking that the complexity won't increase. This is a mistake.

    Even the simplest example you gave is wrong. Because in addition to created form, you also need to create a DLL. And then create a TOTAL memory inside the DLL.

    As the number of form elements grows and the functionality of the program on MT5 becomes more complex, this interaction becomes HEAVILY busy and complicated.

    I have tested all this in practice.

    The conclusion is completely wrong.

     

    The problem is that I've REALLY done what I'm talking about. And I know the complexity of organizing the interaction between a complex MT program and a complex third-party program.

    And the layman's approach is usually to say "That's easy... What's the problem? It's like this, it's like that...".

    Give me an example of connecting complex MT-program to complex Windows form, where the program can:

    1. Change states of elements and output text to input fields.
    2. Where the program can accept text from the form fields and change the colours of the items.
    3. Where the program can control the form windows phenomena (open some and close others).
    I can provide an example of this which fully works on MT.

     
    Реter Konow:

    The problem is that I've REALLY done what I'm talking about. And I know the complexity of organizing the interaction between a complex MT program and a complex third-party program.

    And the layman's approach is usually to say "That's easy... What's the problem? It's like this, it's like that...".

    Give me an example of connecting complex MT-program to complex Windows form, where the program can:

    1. Change states of elements and output text to input fields.
    2. Where the program can accept text from the form fields and change the colours of the items.
    3. Where the program can control the form windows phenomena (open some and close others).
    I can provide an example of this which fully works on MT.

    If you did then you wouldn't be asking questions like today. Learn c# and do it yourself. How to connect dll and call methods Igor showed yesterday.

     
    Dmitry Fedoseev:

    1. What is the problem? It is the choice of project type when you create it.

    2. As seen in the example shown by Igor, the connection is done in one line, even the import does not need to be described.

    3. A method is written once, saved to a file, and then it is used in all the projects without any changes.

    4. Probably, it is necessary, but they are simple. Not all of them are likely to be required, the interaction between control elements in c# will be different, and it may be necessary to place one event, and there will be 100 buttons on the form.

    5. This is related to point 3.

    6. Also one line with the right approach in point 3.

    7 - In your hands all power of C#, of which you seem to have no idea, is enormous.

    Dmitry, use the HUGE power of C# and make a not very complex application with a form, which interacts with the MT application and executes these items:

    1. Changes item states and outputs text toinput fields.
    2. Takes text from the form input fields and changes element colours.
    3. Controls the phenomenon of form windows (opens some and closes others).
    Igor and you claim it's very easy. So you will manage it quickly. I will provide an analogue completely in MT. And we will compare the quality of execution and complexity.
     
    Реter Konow:

    Dimitri, use the GREAT power of C# and make a not very complex application with a form that interacts with the MT application and executes these items:

    1. Changes item states and outputs text toinput fields.
    2. Takes text from the form input fields and changes the colours of the items.
    3. Controls the phenomenon of form windows (opens some and closes others).
    Igor and you claim it's very easy. So you will manage it quickly. I will provide an analogue completely in MT. And we will compare the quality of execution and complexity.

    I have a lot to do. But you can continue in your delusions.

     

    And oh yes, a miracle unseen in programming - to do something, you have to write a function to do it.

     
    Dmitry Fedoseev:

    I have things to do. ...

    OK, maybe Igor will do it then...

     
    Реter Konow:

    OK, maybe Igor will do it then...

    Igor has already shown too much. And I've told too much.

    Reason: