Download MetaTrader 5

iCustom adressing

To add comments, please log in or register
Articles can help you to solidify your knowledge. Come and read them!
fxnew5
58
fxnew5 2016.11.04 12:26 

Hello to the expers,


I want to see/check custom indicator values in an EA.

This variation on built in indicators works fine:

OnInit part:      MA_handle=iMA(NULL,0,21,0,MODE_EMA,PRICE_CLOSE);

OnTick Part:      CopyBuffer(MA_handle,0,0,100,MA); ArraySetAsSeries(MA,true);     Comment(MA[0]);    the Comment shows the current MA value

....

Now I tried my CustomIndicator (has 5 inputs (A-E) and 3 buffers)

OnInit part:     MA_handle=iCustom(NULL, 0, "Indic. Name",A,B,C,D,E);

OnTick Part:      CopyBuffer(MA_handle,0,0,100,MA); ArraySetAsSeries(MA,true);     Comment(MA[0]);      (same line as above)


and the comment doesn't show the indicator value, but a static value (a large number, not -1 or 0 etc.)

For any helpful hints, thanks in advance


Mike



  

Rudinei Felipetto
1086
Rudinei Felipetto 2016.11.04 13:10  
fxnew5:

Hello to the expers,


I want to see/check custom indicator values in an EA.

This variation on built in indicators works fine:

OnInit part:      MA_handle=iMA(NULL,0,21,0,MODE_EMA,PRICE_CLOSE);

OnTick Part:      CopyBuffer(MA_handle,0,0,100,MA); ArraySetAsSeries(MA,true);     Comment(MA[0]);    the Comment shows the current MA value

....

Now I tried my CustomIndicator (has 5 inputs (A-E) and 3 buffers)

OnInit part:     MA_handle=iCustom(NULL, 0, "Indic. Name",A,B,C,D,E);

OnTick Part:      CopyBuffer(MA_handle,0,0,100,MA); ArraySetAsSeries(MA,true);     Comment(MA[0]);      (same line as above)


and the comment doesn't show the indicator value, but a static value (a large number, not -1 or 0 etc.)

For any helpful hints, thanks in advance


Mike



  

Test whether the CopyBuffer is copying the data. 

int copy=CopyBuffer(MA_handle,0,0,100,MA);
if(copy<=0) Print("ERROR!");


 

Mladen Rakic
54583
Mladen Rakic 2016.11.04 13:12  
fxnew5:

Hello to the expers,


I want to see/check custom indicator values in an EA.

This variation on built in indicators works fine:

OnInit part:      MA_handle=iMA(NULL,0,21,0,MODE_EMA,PRICE_CLOSE);

OnTick Part:      CopyBuffer(MA_handle,0,0,100,MA); ArraySetAsSeries(MA,true);     Comment(MA[0]);    the Comment shows the current MA value

....

Now I tried my CustomIndicator (has 5 inputs (A-E) and 3 buffers)

OnInit part:     MA_handle=iCustom(NULL, 0, "Indic. Name",A,B,C,D,E);

OnTick Part:      CopyBuffer(MA_handle,0,0,100,MA); ArraySetAsSeries(MA,true);     Comment(MA[0]);      (same line as above)


and the comment doesn't show the indicator value, but a static value (a large number, not -1 or 0 etc.)

For any helpful hints, thanks in advance


Mike



  

Is your large value equal to 2147483647 ? If yes, the that is known as EMPTY_VALUE - check the indicator when does it place EMPTY_VALUE in the 1st buffer it is using (since you are trying to access the first buffer). Also check if you are trying to access the correct buffer for values

fxnew5
58
fxnew5 2016.11.04 14:22  
Mladen Rakic:

Is your large value equal to 2147483647 ? If yes, the that is known as EMPTY_VALUE - check the indicator when does it place EMPTY_VALUE in the 1st buffer it is using (since you are trying to access the first buffer). Also check if you are trying to access the correct buffer for values

thanks for the fast feedback!

I checked the following:

placed Comment(MA_handle) instead and got by using the MA_handle=iMA(NULL,0,21,0,MODE_EMA,PRICE_CLOSE);    an integer "10"


now when using / replacing


MA_handle=iCustom(NULL,0,"ParabolicSAR",

                          0.04,        // Step

                          0.5          // Maximum

      );   

or my own indicator  I get "-1"   so even the built in Parabolic isn't adressed correctly ?!

Alain Verleyen
Moderator
30739
Alain Verleyen 2016.11.04 14:36  
Mladen Rakic:

Is your large value equal to 2147483647 ? If yes, the that is known as EMPTY_VALUE - check the indicator when does it place EMPTY_VALUE in the 1st buffer it is using (since you are trying to access the first buffer). Also check if you are trying to access the correct buffer for values

2147483647 is not EMPTY_VALUE with mql5. It's DBL_MAX.
fxnew5
58
fxnew5 2016.11.04 14:51  
and what's the reason for getting the error message "-1" when using

Comment(MA_handle)

and

MA_handle=iCustom(NULL,0,"ParabolicSAR",

                          0.04,        // Step

                          0.5          // Maximum

      );  
or my own indicator??  
fxnew5
58
fxnew5 2016.11.04 16:56  
Isn't any moderator in the forum able to solve this (probably for the experts rather simple) obstacle??
Fernando Carreiro
2349
Fernando Carreiro 2016.11.04 17:15  
fxnew5:

Isn't any moderator in the forum able to solve this (probably for the experts rather simple) obstacle??

Moderators are "moderators" and have no obligation to solve your problems!

You are the one that is supposed to solve your own problem.

The users that post here only offer their advice and guidance and it is up to you to apply that and follow-up on with your own research.

If you are not getting the advice you believe that is due, then consider also that your query may not be all that well explained or with too little detail to be able to spot the problem.

You should also consider the fact, that you just need to apply yourself more in learning to code properly by doing more reading and research about it.

fxnew5
58
fxnew5 2016.11.04 17:24  

well, my friend, the question can't be that complicated for an expert to solve

MT 5 is supposed to be a professional platform, spread all over the world, my friend.

When you look at the translation of the manual, you realize (maybe your native language is an astonishing exception) that is was translated by some kinda program. And the result is, that it's not at a professional company level.


Alain Verleyen
Moderator
30739
Alain Verleyen 2016.11.04 17:28  
fxnew5:

well, my friend, the question can't be that complicated for an expert to solve

MT 5 is supposed to be a professional platform, spread all over the world, my friend.

When you look at the translation of the manual, you realize (maybe your native language is an astonishing exception) that is was translated by some kinda program. And the result is, that it's not at a professional company level.


Why some one should solve YOUR issue ? For my part, it's a very basic issue and I am not interested to invest my time.

It's of course simpler to blame others, documentation or the language itself.

fxnew5
58
fxnew5 2016.11.04 17:49  

"I am not interested to invest my time."


great altruistic approach, could be a role model for the world nowadays , thank you indeed.

so the issue is clear, now.

12
To add comments, please log in or register