depending on what the iCustom indicators are sending out...
double buyvaluecurrent = iCustom(indicator1);
double buyvaluecurrent2 = iCustom(indicator2);
double sellvaluecurrent = iCustom(indicator1);
int trenendvup = iCustom(indicator3);
so...
if((buyvaluecurrent !=0 && buyvaluecurrent2 !=0) && (trendenvup !=0)) {buycondition=0;}
if((buyvaluecurrent !=0 && buyvaluecurrent2 !=0) && (trendenvup !=1)) {buycondition=1;}
you can't get a bool into your buycondition only by using "&&" and some conditions, use if() function...
hope this helps, otherwise it's a little step closer
Quote:
Originally Posted by payback
no i don't want to publish all but i think is a problem with the types match of variables i'll try to explain more
indicator1 e 2 are double right
so i have buyvaluecurrent = icustom(indicator1 etc etc);
buyvaluecurrent2 = icustom(indicator2 etc etc);
sellvaluecurrent = icustom(indicator1 etc etc); //doubles right?
trenendvup =icustom (indicator3 etc etc) ; //int
and so on
so buycondition= ((buyvaluecurrent !=0 && buyvaluecurrent2 !=0) && (trendenvup != Empty_Value);
this statment works only sometimes and also could be a problem, so my question is why? i want that buycondition returns 1 or 0 no matter of what type is bool or double
|