to get the values of severals objects

 

Hello,

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)

Thanks

 
max05:

Hello,

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)

Thanks

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.

 
Petr Nosek:

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.


thanks

 
max05:
 

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.

 
Easiest way is to wrap the object with a chart-object class from the std lib and use the class methods. 
 
Petr Nosek:

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.

there are several horizontal lines with different names, is there a way to use ObjectGetDouble() without having to name them all?
 
max05:
there are several horizontal lines with different names, is there a way to use ObjectGetDouble() without having to name them all?

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 ?

 
Petr Nosek:

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.

 
max05:

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 understand you what you want. As I said, if you have a source code of your market profile indicator the best way is to add an alert into this indicator code. If you don't have the source code then you have to code a new EA/Indicator that provides alert based on the horizontal lines.
 
Petr Nosek:
I understand you what you want. As I said, if you have a source code of your market profile indicator the best way is to add an alert into this indicator code. If you don't have the source code then you have to code a new EA/Indicator that provides alert based on the horizontal lines.


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?

Volume Profile + Range v6.0
Volume Profile + Range v6.0
  • votes: 24
  • 2016.05.10
  • Olexiy Polyakov
  • www.mql5.com
Индикатор Volume Profile + Range v6.0 (бывший TPO). Распределение сделок по ценовым уровням на заданном временном участке. Показывается в виде гистограммы. Ширина гистограммы на данном уровне означает, условно, количество сделок, проведенных на ней. Если брокер предоставляет данные по реальному объёму, индикатор может показывать распределение и...
 
max05:


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.

Reason: