Hello guys,
I have an indicator (.ex4) which creates dots on the chart. I'm trying to understand if it is possible to know (with MQL4) when the dots appear, and generate an alert.
This is a screen of my indicator
Thanks in advance.
You can use an iCustom call to find the dots if the indicator uses buffers.
Looking at that image I am almost certain that it is a repainting indicator so you may find that you cannot get an alert when the dot happens
You can use an iCustom call to find the dots if the indicator uses buffers.
Looking at that image I am almost certain that it is a repainting indicator so you may find that you cannot get an alert when the dot happens
You want to know if a dot exists on a specific bar. Just get the value of the indicator, (one of two buffers,) and see if it is EMPTY_VALUE or not.
You should write a self documenting function instead of calling iCustom directly, see Detailed explanation of iCustom - MQL4 forum
You want to know if a dot exists on a specific bar. Just get the value of the indicator, (one of two buffers,) and see if it is EMPTY_VALUE or not.
You should write a self documenting function instead of calling iCustom directly, see Detailed explanation of iCustom - MQL4 forum
int start()
{
double buffer1 = iCustom(NULL,0,"myIndicator",10000,true,true,"alert2.wav","email.wav",false, 0, 0);
double buffer2 = iCustom(NULL,0,"myIndicator",10000,true,true,"alert2.wav","email.wav",false, 1, 0);
if(buffer1!=0 ) // I tried with -> if(buffer1!=EMPTY_VALUE) but buffer1 always returns 0 .
Alert(buffer1);
if(buffer2!=0)
Alert(buffer2);
return 0;
}
gabrisal94: I tried this code but it does not work: |
|
|
There is another way to see if exists a dot on the chart?
The indicator what i'm using does not repaint.
"Does not work" in the sense that the two buffers do not return a value different from zero.
There is another way to see if exists a dot on the chart?
- It doesn't repaint? That's not what you previously said.gabrisal94: Thanks for the reply, the indicator in the figure is only for an example (i know that repaints!)
- We don't know your indicator, we don't know that there are only two buffers or even if it is using any buffers, and we certainly don't know if it ever paints a dot on bar zero.
- Open the data window, look at the values displayed when you hover over a bar with a dot and without.
- It doesn't repaint? That's not what you previously said.
- We don't know your indicator, we don't know that there are only two buffers or even if it is using any buffers, and we certainly don't know if it ever paints a dot on bar zero.
- Open the data window, look at the values displayed when you hover over a bar with a dot and without.
1) I have said: "the indicator in the figure is only for an example".
2) Here you are the screen with dot and without
Red dot
without dot
Thanks
As WHRoeder has said, some indicators do not place any value in the buffer for the current bar. In such cases you will not get any value returned for
try
what to do if indicator draw arrow as object in the chart (Some indicators do not have up and down buffers)
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I have an indicator (.ex4) which creates dots on the chart. I'm trying to understand if it is possible to know (with MQL4) when the dots appear, and generate an alert.
This is a screen of my indicator
Thanks in advance.