I have an indicator that create rectangles for support and resistance, it draws several of them, all named : support-1 , support-2 , resistance-1 , resistance-2, ect.....
I want to use those values on an EA or an indicator, without having to enter every names one by one.
Is it possible to code something like : objectget price1 for every rectangle name support-X or resistance-X ? (then i will use it like if a bar close< and open> of a support or resistance, then do something)
Yes, it is possible and not much difficult. But if you have source code of your SR indicator the better way is to use this code in your code.
hello Petr Nosek,
thanks for the reply, can you point me to the right direction please, i can't find where to start.
I have several horizontal lines, i want an alert when a bar crossing it.
You have to use ObjectGetDouble() https://docs.mql4.com/objects/objectgetdouble to find out these horizontal lines properties (price) and then just check if the current price crosses this price.
You said in your first post:
"I have an indicator that create rectangles for support and resistance, it draws several of them, all named : support-1 , support-2 , resistance-1 , resistance-2, ect..... "
If it is true then you can find out all exact names of them and work with all the names in ObjectGetDouble().
BTW horizontal lines or rectangles ?
sorry for the misunderstanding, it s horizontal lines, there are several on my charts created by a market profile type indicator. Then If the bar is an upthrust for exemple, and crossing one of the lines , the EA or indicator should send an alert.
I am using the VP-Range-V6 (https://www.mql5.com/ru/code/15445), it's .Mq4 and free, so i guess it s ok the modify it for private use?
Yes, you can modify the code by adding alerts.