newbie questions 2

 

Hi guys

couple of questions from a new to mq4 guy:

1. About this forum, should i open a new topic every time i have a questions?! is there any partition to subjects?

2. About the iCustom function: how do i know what parameters the indicator needs? are these the "extern" parameters in the indicator's code?

3. About Alert function: how do i clean the Alert window so that in the next time this function is called it would show a window with only the current alert message?

4. Can anyone please explain what are the SetIndexBuffer mean? and also its mapping to the ExtMapBuffer variables? I know this is a general question, but i couldn't find a high-level explanation to the subject in the referance...

Thanks in advanced.

Wasseem

 
wasseem:

Hi guys

couple of questions from a new to mq4 guy:

1. About this forum, should i open a new topic every time i have a questions?! is there any partition to subjects?

after searching the forum u didn't find an answer, yes

2. About the iCustom function: how do i know what parameters the indicator needs? are these the "extern" parameters in the indicator's code?

u can use the "extern" parameters & u can your own parameters

3. About Alert function: how do i clean the Alert window so that in the next time this function is called it would show a window with only the current alert message?

AFAIK the only way is by restarting the terminal

4. Can anyone please explain what are the SetIndexBuffer mean? and also its mapping to the ExtMapBuffer variables? I know this is a general question, but i couldn't find a high-level explanation to the subject in the referance...

SetIndexBuffer

Thanks in advanced.

Wasseem

 

Thanks gjol

I've read the reference documentation about SetIndexBuffer before, but i haven't 100% grasped the concept of what buffers are and why they are useful.

and in iCustom, can i just ignore the indicators parameters when importing data from it? (knowing that it will take the default values)

 

wasseem:

2. About the iCustom function: how do i know what parameters the indicator needs? are these the "extern" parameters in the indicator's code?

Yes. And if you don't have the source of the indicator you can simply look at the settings dialog that comes up when you put the indicator onto a chart and count the parameters, you need to specify the exact same number of parameters exactly in the order they appear in this setting dialog and with their correct types.
 

wasseem:

i haven't 100% grasped the concept of what buffers are and why they are useful.

From the indicator's point of view the buffers are just the arrays into which it writes its calculated values. A series of numerical values. It can have up to 8 different buffers (plot 8 curves into the chart).

Later when you call iCustom(......, x, y) you can access the contents of these buffers, one value at a time. if you want to read the entire buffer x you would have to loop through all bar numbers y and call it for each of them to be able to read the entire buffer. But in most cases you are only interested in the latest value or maybe the last two or three values.

(Don't worry about the performance, the buffers will be cached and not recalculated every time you call iCustom(), subsequent calls to iCustom() will just read values from these buffers, the indicator itself (which stays loaded invisible in the background) will only recalculate itself when a new tick arrives.)