Download MetaTrader 5

A technical question

To add comments, please log in or register
Carry on your private correspondence in your profile. It is secure!
Prataprai Kaneria
308
Prataprai Kaneria 2016.07.03 10:42 
How do I code in mql4 to find out if there is an arrow on the previous bar and the type of arrow, i.e. up or down? Appreciate any help.
Carl Schreiber
6590
Carl Schreiber 2016.07.03 11:29  
Does an indicator- buffer paints the arrows (see: iCustom(..)) or are they graphical objects (see: ObjectsTotal(..)).
Prataprai Kaneria
308
Prataprai Kaneria 2016.07.03 11:40  
Arrows are painted by an indicator buffer.
Carl Schreiber
6590
Carl Schreiber 2016.07.03 12:49  
So ckeck w
7325453863:
Arrows are painted by an indicator buffer.
Well check whether iCustom(..) returns an (probably) an EMPTY_Value or not (=arrow);
Prataprai Kaneria
308
Prataprai Kaneria 2016.07.03 13:11  

Thanks gooly for your help. But I know very little about indicators in general. I got a feeling that there must be a simple way just to see if there is an arrow or a dot or something on a previous bar regardless of how it was created.

When I use Icustom, how do I specify current bar or previous bar ? Documentation tells me that I should use symbol, period and then input parameters of the indicator. Then icustom returns a value or emptyvalue. If I get a value how do I decipher it. In other word, how do I know whether it is up arrow or down arrow?

whroeder1
14514
whroeder1 2016.07.03 13:13  
Prataprai Kaneria
308
Prataprai Kaneria 2016.07.03 14:33  

Thanks Mr. Roeder. The explanation is describing a situation where you know everything about an indicator and you have the source code. I have indicator in a .ex4 format with no explanation. All I know is that it has two inputs. But there is no explanation of what these inputs do, so I leave them as default. But this indicator draws arrows in right places.

All I want is a simple thing. I want to know if there was an arrow on the last bar and if so was it a down arrow or up arrow. It does not matter how it got created thru buffers or objectcreate or whatever. There has to be a way.

honest_knave
Moderator
2213
honest_knave 2016.07.03 15:14  

There is a way, and that way is as gooly and WHRoeder have said: iCustom. It isn't complicated once you get the hang of it.

You just need to find out which buffer number is used for up arrows, and which buffer number is used for down arrows.

If you add the indicator, it would help us give more detailed explanation.

whroeder1
14514
whroeder1 2016.07.03 18:24  
  1. 7325453863: It does not matter how it got created thru buffers or objectcreate or whatever. There has to be a way.
    1. Of course it matters, different way requires different call.
    2. We already gave you the way.
    honest_knave: You just need to find out which buffer number is used for up arrows, and which buffer number is used for down arrows.
    1. Put the indicator on a chart
    2. Open the data window
    3. mouse over a bar that has a arrow
    4. Look at which entry has a value

Prataprai Kaneria
308
Prataprai Kaneria 2016.07.03 18:49  
Thanks a lot every one. My learning never ends. I did not know about data window. Now that I know,  I am going to decipher. Fabulous.
Prataprai Kaneria
308
Prataprai Kaneria 2016.07.05 20:59  

I thought I will figure it out but no. I still need help. If you look at the attached picture, I have data window open and it shows four outputs from the indicator which are labeled as 1. forex lever 2. value2 3. value3 and 4. value4.

When I move cursor over the red arrow, value3 has a non zero value and value4 is zero. This I verified by moving cursor over all the red arrows. When I move cursor over the blue arrow, value3 is 0 and value4 has a nonzero value.

I thought value3 corresponded to buffer3 and value4 corresponded to buffer4. But that is not the case. So how do I read value3 and value4 from the indicator?

12
To add comments, please log in or register