I did so, but it doesn't always work correctly, probably, it is easier to fix if the price reaches the necessary levels. Here we should consider that buy orders open by Ask and close by Bid, while sell orders on the contrary, open by Bid and close by Ask. According to this method we have to correctly select the necessary levels. But this method is not reliable, one glitch may occur and the system will not work properly. You should check that everything is running as intended and report an error if something is going wrong. Thanks for the help. I think I can work it out.
IgorM:
If we just record the fact of a trigger, then we can record the number of orders on the previous tick and compare it with the next tick - if the number of orders has changed, it means .....
So you blatantly have no tick in the terminal. I.e. either it is not connected, or you are working on offline chart, or check IsExpertEnabled() in the init and if it is not allowed, then enable EAs.
The chart is 100% offline, Expert Advisor fills some data and outputs it to me via Print.
Looks like you are right, there is a cross icon in the chart window, I missed that point for some reason!
Please advise if trading is not allowed, how can I programmatically allow it.
Jaguar1974: I did, but it doesn't always work correctly...
It may not work correctly if you, perhaps, do not understand the difference between global and local variables, and as an option, you can declare with a modifier static
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
If we just record the fact of a trigger, then we can record the number of orders on the previous tick and compare it with the next tick - if the number of orders has changed, it means .....
So you blatantly have no tick in the terminal. I.e. either it is not connected, or you are working on offline chart, or check IsExpertEnabled() in the init and if it is not allowed, then enable EAs.
The chart is 100% offline, Expert Advisor fills some data and outputs it to me via Print.
Looks like you are right, there is a cross icon in the chart window, I missed that point for some reason!
Please advise if trading is not allowed, how can I programmatically allow it.
Thanks in advance!
if trading is not allowed,
I did, but it doesn't always work correctly...
And of course, there are logical errors.It may not work correctly if you, perhaps, do not understand the difference between global and local variables, and as an option, you can declare with a modifier static
Hello.
Can you please tell me how to get a list (collection) of all graphical objects on a chart?
There are several horizontal lines on the chart... How can I learn their number and parameters?
Hello.
Can you please tell me how to get a list (collection) of all graphical objects located on a chart?
Is it possible to refer to graphical objects by indices?
You can. Read here. ObjectsTotal() will give the total number of objects, ObjectName() - object name by its index. Then work by object name.
Thank you very much!!!
... IsExpertEnabled() will give you false. In this case, only turn on the button by hand
Krasawela))
Thank you very much, everything works!))
Respect to all!))