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

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Versuchen Sie es (ich habe es nicht getestet)
Thank you, I will check later.
Please help me to position the function correctly
...
But how and where to insert
To send a message when a stop loss ortake profit is reached?
Are we talking about the same thing?
I found an example that tracks the SL exit withOnTradeTransaction:https://www.mql5.com/ru/code/21147.
The same EA on two different instruments
Hello! Could you please help me out?
I have an EA which works on the chart on which it has been dragged (the Symbol() value is taken as the name of the symbol).
But this EA also has a ticket_exist variable which contains a ticket of an placed order and the EA understands that if the ticket_exist is not equal to zero,the order is placed here.
Question: If I open such an EA on two different instruments and the ticket_exist variable is not equal to zero on one instrument, will the variable with the same name remain equal to zero on the other instrument?
SU.
The same EA on two different instruments
Hello! Could you please help me out?
I have an EA which works on the chart on which it has been dragged (the Symbol() value is taken as the name of the symbol).
But this EA also has a ticket_exist variable which contains a ticket of the set order and the EA understands that if the ticket_exist is not equal to zero,the order is set here.
Question: If I open such an EA on two different instruments and the ticket_exist variable is not equal to zero on one instrument, will the variable with the same name remain equal to zero on the other instrument?
SU.
The value of the variable in one EA is not available for another EA. The main thing is that either the symbols, or magiks, or both are different.
Can you tell me what time it is in ticks? Server time or UTC ?
I remember reading somewhere, but can't remember where...
The value of a variable in one EA is not available to another EA. The main thing is that either the symbols, or magics, or both of them should be different.
Thank you! If I understood correctly, then in order to get a conflict of EAs (two absolutely identical ones) working with different symbols, their variables should be set as global (for the whole terminal) or, for example, an order should be accessed by its sequence number or simply by the fact of its existence?
Try this (I haven't tested it)
It doesn't work, it gives compile errors.
I tried it this way and it compiles without any problems but I can't test it with the rink closed
I'll be back to work tomorrow.
it doesn't work, it gives compile errors
I tried it this way, it compiles without any problems, but when the rink is closed I can't test it
I'll finish it tomorrow.
you didn't put the code in correctly!
I fixed it a little and it's working.
you didn't put the code in correctly!
I corrected it a bit, it works (I checked it).
Here, we need to trace the fact that the deal was closed exactly by SL or TP. And usingOnTradeTransaction we get ready data right after closing of the deal.
If there is more than one trade closed at TimeCurrent, what result should be returned? And the presence of a profit does not mean that the trade was closed by the SL or TP. This needs to be tracked, as I said before. So, usingOnTradeTransaction, is the easiest solution!
Here, we also need to trace that the trade was closed exactly on the SL or TP.
I understood it as a notification of deal closing, maybe I got it wrong...
Mihail Matkovskij:
If more than one trade is closed at TimeCurrent, what result should I get back?
don't know, need to check