icustom calling

 

I have some doubts regarding calling of icustom function from within an indicator.the documentation does not state anything in this regard.even it does not state whether EA can call custom indicator using icustom function although it is possible.any clarification is welcome..

thnks

 

What part of "Calculates the specified custom indicator and returns its value" is unclear? Where in there do you see any restrictions?

Detailed explanation of iCustom - MQL4 forum



 
double iCustom(string symbol, int timeframe, string name, ..., int mode, int shift)

Calculates the specified custom indicator and returns its value. The custom indicator must be compiled (*.EX4 file) and be in the terminal_directory\experts\indicators directory.

thnx for your time but this is not clear.returns its value to where?.which program should call it?.as I see it is not explicitly stated here.does it meant any scripts,indicator and EAs can call it and accepts its return value?.so I need clarification.

other case,behaviour of icustom still surprise me.in one EA I called custom indicator using icustom after setting correct line index value and backtest in a tester and note the results .then I set line index value to wrong index number which belongs to other line buffer and backtets it and got the same results.it is surprise that the EA even runs! particularly the value feed line array with setindex 2 feeds values to two other line arrays with index 0 and 1 depending on happening of certain conditions.so I suspect my EA is confused because it is somewhat related!.currently iam trying to call custom indicator from another

custom indicator but not sure what will be the results. another thing not clear is syntax of calling it.for e.g

double arr1[posindex]= iCustom(string symbol, int timeframe, string name, ..., int mode, int shift)
the syntax is actually an assignment statement just like variable value on RHS is assign to variable on LHS.this works even if the called indicator does not return
anything with return(something) statement in its code.what is the actual behaviour of icustom returning some values?
 
MirTD:
double iCustom(string symbol, int timeframe, string name, ..., int mode, int shift)

Calculates the specified custom indicator and returns its value. The custom indicator must be compiled (*.EX4 file) and be in the terminal_directory\experts\indicators directory.

thnx for your time but this is not clear.returns its value to where?.which program should call it?.as I see it is not explicitly stated here.does it meant any scripts,indicator and EAs can call it and accepts its return value?.so I need clarification.

iCustom() is a function just like any other . . . ir returns it's value to the code that called it.

MirTD:

double arr1[posindex]= iCustom(string symbol, int timeframe, string name, ..., int mode, int shift)
the syntax is actually an assignment statement just like variable value on RHS is assign to variable on LHS.this works even if the called indicator does not return
anything with return(something) statement in its code.what is the actual behaviour of icustom returning some values?

No, you don't declare an array or buffer like that . . .

Read this, it might help: What are Function return values ? How do I use them ?

 
returns its value to where?To where ever you put it. You just posted
arr1[posindex]= iCustom(...);
You already know the answer. learn to code
which program should call it?Any program that needs the value - DUH.
does it meant any scripts,indicator and EAs can call it and accepts its return value?.What part of NO RESTRICTIONs was unclear?
it is surprise that the EA even runs!This topic was about iCustom. IF your EA is broken, fix it.
particularly the value feed line array with setindex 2 feeds values to two other line arrays with index 0 and 1 depending on happening of certain conditions.Stop babbling, write English.
currently iam trying to call custom indicator from another custom indicatorYou already know the syntax, you quoted it.
this works even if the called indicator does not return anything with return(something) statement in its code.what is the actual behaviour of icustom returning some values?
iCustom just returns the value from the specified buffer (mode) with the specified index (shift)
 
RaptorUK:

iCustom() is a function just like any other . . . ir returns it's value to the code that called it.

No, you don't declare an array or buffer like that . . .

Read this, it might help: What are Function return values ? How do I use them ?

thx RaptorUK.Your iCustom() is a function just like any other is helpful.

 
WHRoeder:
returns its value to where?To where ever you put it. You just posted You already know the answer. learn to code
which program should call it?Any program that needs the value - DUH.
does it meant any scripts,indicator and EAs can call it and accepts its return value?.What part of NO RESTRICTIONs was unclear?
it is surprise that the EA even runs!This topic was about iCustom. IF your EA is broken, fix it.
particularly the value feed line array with setindex 2 feeds values to two other line arrays with index 0 and 1 depending on happening of certain conditions.Stop babbling, write English.
currently iam trying to call custom indicator from another custom indicatorYou already know the syntax, you quoted it.
this works even if the called indicator does not return anything with return(something) statement in its code.what is the actual behaviour of icustom returning some values?
iCustom just returns the value from the specified buffer (mode) with the specified index (shift)

WHRoeder.why do you think iam babbling?iam not!and iam writing in English!does it mean you do not experience it means I do not experience it also?the following description is clearly about calling an indicator using icustom from a custom indicator as I thought I may have add it there .well, I admit you are more expert in mql4 coding

but iam not totally a beginner either.i go from step to step depending on need.thats my style.in fact there are many functions which I haven't use till now.this is one of them which iam tying to use it.:C

 
particularly the value feed line array with setindex 2 feeds values to two other line arrays with index 0 and 1 depending on happening of certain conditions.
Because your were. That sequence of words was not English. There was no subject, no verb, it was babel. I've been speaking English for 54 years I've been coding for 40 years. What you wrote was unintelligible. I challenge you to explain that quoted sentence in one Proper English sentence where the meaning was clear to any coder.
 

I would like to know why the OP did not just try it and see. How hard is it to create a test indicator/script/EA.

double val;

val = iCustom(NULL,0,"My_Indicator",etc,);

Print( val );

 
SDC:

I would like to know why the OP did not just try it and see. How hard is it to create a test indicator/script/EA.

double val;

val = iCustom(NULL,0,"My_Indicator",etc,);

Print( val );

Probably because it is easier to ask, I am sure we have all done that on occasion.
 
WHRoeder:
Because your were. That sequence of words was not English. There was no subject, no verb, it was babel. I've been speaking English for 54 years I've been coding for 40 years. What you wrote was unintelligible. I challenge you to explain that quoted sentence in one Proper English sentence where the meaning was clear to any coder.

well, I thought punctuations is not very important here...! what I meant by the sentence below

particularly the value feed line array with setindex 2 feeds values to two other line arrays with index 0 and 1 depending on happening of certain conditions.

is this

particularly, the value-feed line-array with setindex 2 feeds values to two other line-arrays with index 0 and 1 depending on happening of certain conditions.

I hope it is clear to any coders now.(I did experience a situation like that mention earlier in my first post and its DIRECTLY related to using icustom)

Reason: