[Archive!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass it by. Couldn't go anywhere without you - 2. - page 114

 
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 .....
 
alsu:

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!

 
BBSL:


if trading is not allowed,

... IsExpertEnabled() will give you false. In this case, only enable by hand with the button
 
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

And of course, there are logical errors.
 

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?

 
Circle:

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?

Yes, you can. Read here. ObjectsTotal() will give the total number of objects, ObjectName() - object name by its index. Then work by object name.
 
alsu:
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!!!
 
alsu:
... 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!))

 
Hello! Can you please tell me if it is possible to use an EA in the mobile version of the terminal?