Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 212
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
Hello,
Looking for the following information:
1. regarding the implementation of SMS-notifications when processing key events in the work of the EA.
About realization of opening and closing of trade from 12-00 PST till 18-00 PST (with sms-notification of course :) about the beginning and end of a weekly trading session ).
About implementing an email notification after completion of trade (18-00 PTN) - sending report on the work of the advisor for a weekly trading session, in the tester, with a graph and indication of dates of opening, closing dates, prices, profits/losses after closing positions. Or will the reports be in txt format ?
Please advise which functions or scripts will implement it ? How can I do it? May be there is a topic about it - SMS and e-mail notifications and reports.
https://www.mql5.com/ru/articles/1454
Here's something like this, but to make it simpler)))
https://www.mql5.com/ru/forum/53920
The algorithm of sms notifications is not bad, our EA sends us email, and the email operator sends us the text of the letter. All brilliantly simple. All we need is to register our mobile phone. It's easier now.
I'll go read, I found a similar function - SendMail().I wonder how complicated it is?
Good afternoon everyone!
Made this code - delete all orders at once.
The problem is that almost all orders are closed. But we still have 1-2 orders that are not deleted.
And no matter how many times I access this function, this function does not close the remaining orders.
I get an error showing wrong price.
I thought it was requotes but if we request this function 500000 times already, what requotes may be?
What cannot be the wrong price?
I have never had such a nonsense with other EAs.
Good afternoon everyone!
Made this code - delete all orders at once.
The problem is that almost all orders are closed. But we still have 1-2 orders that are not deleted.
And no matter how many times I access this function, this function does not close the remaining orders.
I get an error showing wrong price.
I thought it was requotes but if we request this function 500000 times already, what requotes may be?
What cannot be the wrong price?
I have never had such a nonsense with other EAs.
If there are a lot of orders, the price has time to become out of date. Add RefreshRates() and it should be fine.
That's the thing: one or two orders are left.
I have made a cycle of calls to this function until all orders are deleted.
In idea, if the order is for buy, it should be closed by Bid, and it does not matter what price it is now.
It should close by Bid at any price.
And if we have addressed this function many thousands of times, the price should close anyway.
Or maybe I do not understand something?
That's the thing: one or two orders are left.
I have made a cycle of calls to this function until all orders are deleted.
In idea, if the order is for buy, it should be closed by Bid, and it does not matter what price it is now.
It should close by Bid at any price.
And if we have addressed this function many thousands of times, the price should close anyway.
Or is there something I do not understand?
Are there errors in the log when deleting?
The price can go far enough during the cycle. Ask and Bid are constants that are updated either forcibly (when calling RefreshRates()) or when processing a new tick. So, after each loop turn, call RefreshRates() and see what happens.
That's the thing, there's one or two orders left.
I have made a loop of calls to this function until all the orders are deleted.
In theory, if the order is for buy, it should be closed by Bid and it does not matter what price it is at that moment.
It should close by Bid at any price.
And if we have addressed this function many thousands of times, the price should close anyway.
Or maybe I do not understand something?
Try 1) replace Print with Alert to see the result on the screen immediately - it's faster 2) You get the error code there. Print it and see 3) Get and print the error code of the OrderSelect function and immediately OrderSymbol(), OpderType(), OrderTicket()
Try 1) replace Print with Alert to see the result on the screen immediately - it's faster 2) You get the error code there. Print it and see 3) Get and print the error code of the OrderSelect function and immediately OrderSymbol(), OpderType(), OrderTicket().
Tried RefreshRates() as well. Nothing has changed. Alert - same as print, gives out - wrong parameters.
Error 3.
I got up in the morning and saw that the EA had triggered and was showing the function to delete all the orders the whole night.
The counter of requests shows several millions of requests. This means that orders are not deleted.
This EA also checks if all orders are deleted, it is like an insurance. If there are orders, we will call the
The function of deletion is called for. The program gets stuck. This means, the loop will not stop until all orders are deleted.
Such troubles occur on 2 currency pairs. I have already lost my mind. What to do?
I have tried RefreshRates(). Nothing has changed. Alert - same as print, it says - wrong parameters.
Error 3.
Woke up this morning and saw that the EA had triggered and was showing a call to delete all orders all night.
The counter of requests showed several millions of requests. It means that orders are not deleted.
This EA also checks if all orders are deleted, it is like an insurance. If there are orders, we will call the
The function of deletion is called for. The program gets stuck. This means, the loop will not stop until all orders are deleted.
Such troubles occur on 2 currency pairs. I have already lost my mind. What to do?
And what is the error() function?
It may be the problem.
What is the error() function?
It is possible that this is the problem.
The error() function just displays an error code. There is no problem with this function, I have it in many EAs and I never change it.
So it's definitely not the case.
The function itself is right here: