Help with iCustom MT4

#1
Hello mladen, im trying to use your indicator by iCustom function but seems not work. What im doing wrong?

You help and moderators is very apreciated. Thanks soo much.

Code: Select all

double 3row(int i)
{
 double up = iCustom(NULL,0,"3-in-a-row-trend_ride_mtf_alerts_nmc_1.02",0,i);
 double dn = iCustom(NULL,0,"3-in-a-row-trend_ride_mtf_alerts_nmc_1.02",1,i); 
 
 if(up)
 {
 return(1);
 }
 if(dn)
 {
 return(-1);
 }
 
 return(0);
}
3-in-a-row-trend_ride_mtf_alerts_nmc_1.02.mq4
(6.15 KiB) Downloaded 466 times


Re: Help with iCustom MT4

#2
Cladi39 wrote:Hello mladen, im trying to use your indicator by iCustom function but seems not work. What im doing wrong?

You help and moderators is very apreciated. Thanks soo much.
Both conditions (the "if(up)" and the "if(dn)") are always going to be true.

Compare it to EMPTY_VALUE (like this "if(up!=EMPTY_VALUE)" and "if(dn!=EMPTY_VALUE)")

Re: Help with iCustom MT4

#4
Cladi39 wrote:Don´t work 
Post the complete code you are trying to test. Otherwise it is just a simple guessing game what is going on with your code and nobody can help you


IdeaRe: Help with iCustom MT4

#6
Cladi39 wrote:
Fri Feb 24, 2017 6:01 am
Ok mladen i attach the 2 indicators i want to join and my code , thanks soo much.
You are using default parameters for "3-in-a-row-trend_ride_mtf_alerts_nmc_1.02" indicator.

When using default parameters the indicator is setting the signals 4 bars away from the current bar and you are trying to read 2nd bar from the current (which is still not set and will be set only when 2 more bars pass).

Add a parameter for "NumberOfBarsInARow" of "3-in-a-row-trend_ride_mtf_alerts_nmc_1.02" indicator and use it to pass it to the indicator and for testing purposes - that way you shall always test the exact bars the you are interested in (and which can change the state from EMPTY_VALUE)