Page 1 of 1
Help with iCustom MT4
Posted: Thu Feb 23, 2017 4:36 pm
by Cladi39
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);
}
Re: Help with iCustom MT4
Posted: Thu Feb 23, 2017 7:39 pm
by mladen
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
Posted: Fri Feb 24, 2017 4:44 am
by Cladi39
Don´t work

Re: Help with iCustom MT4
Posted: Fri Feb 24, 2017 5:39 am
by mladen
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
Re: Help with iCustom MT4
Posted: Fri Feb 24, 2017 6:01 am
by Cladi39
Ok mladen i attach the 2 indicators i want to join and my code , thanks soo much.
Re: Help with iCustom MT4
Posted: Fri Feb 24, 2017 6:21 am
by mladen
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)
Re: Help with iCustom MT4
Posted: Fri Feb 24, 2017 8:54 am
by Cladi39
Thanks soo much mladen, will try like you said.