Download MetaTrader 5

Using a Custom .EX4 File in EA

To add comments, please log in or register
Chris
78
Chris  

Hi everyone,

Thanks in advance for future answers. I'm liking what I've learned today in regards to dealing with iCustom and interacting with objects on the charts. However, I have this .ex4 file and I don't know how to get the color of the indicator at a specific time or whether or not an arrow is on the chart and whether or not it is up or down. What do you recommend me doing in this case? I also looked for a way to extract information from the alerts tab, which this indicator gives out. From what I've read, this is not supported in MQL. I have the object name of the indicator and it appears that the whole indicator acts as one instead of a line and the arrows. Thanks again! 

Indicator 

Carl Schreiber
6693
Carl Schreiber  
If an indicator has two colours like yours it must have at least two buffers which and either one is not empty. Yours might have 4, two additional one for the arrows. Just look at the Datawindow below Volume the values of the buffers start.
Fernando Carreiro
2277
Fernando Carreiro  
gooly:
If an indicator has two colours like yours it must have at least two buffers which and either one is not empty. Yours might have 4, two additional one for the arrows. Just look at the Datawindow below Volume the values of the buffers start.
Actually, it looks like there may even be 6 buffers because there are also those weird little strokes on each bar above the red lines and below the blue lines.
whroeder1
14785
whroeder1  
  1. Definitely six. Two  for the histogram "strokes." Two for the colored lines. Two for the arrows.
  2. Detailed explanation of iCustom - MQL4 forum
Chris
78
Chris  

Hello everyone,

I would like to thank everyone. Okay, I haven't created an indicator before in MQL4. I'm more of an EA type of guy. My understanding of buffers is that it allows for the programmer to create a storage for an array. But anyhow, this is what I did:

I used the iCustom indicator and for the mode, I used 0 to 5, which includes 6 values since you all say that this indicator has 6 buffers. I printed the values to the journal and got a bunch of crazy numbers, with some of them being the same.

Here are the values:

 

The iCustom indicator only returns double. It would be great if I can pass a color variable. Anyhow, I don't know how to get useful information out of those values to place trades. I'm assuming that these values probably give you the location of the object on the chart, but those big numbers toward the

end, I don't know. From programming, I believe those are the largest double values that a computer can use from my college days or programming. But I don't see how that is useful and why I'm not seeing different values. 

Thanks 

Carl Schreiber
6693
Carl Schreiber  
The big number for some variable is the default EMPTY_VALUE for indicators. Just search in the editor's reference for this expression. It simply means no value has been assigned.
Fernando Carreiro
2277
Fernando Carreiro  
BernWillChris:

Hello everyone,

I would like to thank everyone. Okay, I haven't created an indicator before in MQL4. I'm more of an EA type of guy. My understanding of buffers is that it allows for the programmer to create a storage for an array. But anyhow, this is what I did:

I used the iCustom indicator and for the mode, I used 0 to 5, which includes 6 values since you all say that this indicator has 6 buffers. I printed the values to the journal and got a bunch of crazy numbers, with some of them being the same.

Here are the values:

The iCustom indicator only returns double. It would be great if I can pass a color variable. Anyhow, I don't know how to get useful information out of those values to place trades. I'm assuming that these values probably give you the location of the object on the chart, but those big numbers toward the

end, I don't know. From programming, I believe those are the largest double values that a computer can use from my college days or programming. But I don't see how that is useful and why I'm not seeing different values. 

  • The value 2147483647 is the constant EMPTY_VALUE, which is used when no valid value is to be used for the Buffer, and therefore those two last buffers are the ones used for the Arrows (signals).
  • Have a look at the Data Window and see what the Label is for each of those 6 buffers. That way, you will be able to know what each represents.
  • If the indicator is not paid for, and if it is in fact available for download for free, then attach it here so that we can help you, or at least tell us its name.
Chris
78
Chris  

The indicator has been attached. When I hover over the arrows or lines, I will see a label called value4 or value6 or etc with the values of where that object lies. Those are some useful values that I can probably program around. To be clear, if the arrow value is less than the line value, then I can program the EA to buy. As of now, I deleted the last two mode values (since they are EMPTY_VALUE) and now only using 4. From watching the values during the backtest, I noticed that value1, that I created, has a value when the indicator gives out a sell signal and I might can program around that alone. However, this arrow can repaint up until the next bar. After that, it can no longer repaint, which is a plus.

Sorry about that dumb question I asked about that big number. That is a value that I would've made a correct guess on any other day. Thanks again. 

FMIC, here is the Data Window view.

 

Fernando Carreiro
2277
Fernando Carreiro  
  1. Buffer 0 (Value 1): Blue Line
  2. Buffer 1 (Value 2): Red Line
  3. Buffer 2 (Value 3): High of Blue Bar (stroke) / Low of Red Bar (stroke)
  4. Buffer 3 (Value 4): Low of Blue Bar (stroke) / High of Red Bar (stroke)
  5. Buffer 4 (Value 5): Blue Arrow Signal
  6. Buffer 5 (Value 6): Red Arrow Signal

PS! Please note, that after further investigation, it seems that the indicator "BuySellArrowScalper" is a paid rip-off of the original "HalfTrend" by "AlexSoftware" that was in turn based on "Ozymandias" available in the Code Base section. I have attached the original source code of "HalfTrend-1.02.mq4" which will also help you identify the buffers or to allow you to adapt the Indicator to your needs.

Files:
Chris
78
Chris  
Thanks everyone, I believe I have enough information to finish the project. From what I got so far from this thread, MQL doesn't support the ability to retrieve the color of a particular object. I don't need that information to finish this project, but I can see this being useful in the future. Thanks again and have a great weekend.
Fernando Carreiro
2277
Fernando Carreiro  
BernWillChris:
The indicator does not use Chart Objects! It only uses buffers. Check the source code of the identical indicator "HalfTrend v1.02" that I attached in previous post!
12
To add comments, please log in or register