DailySignal Function Problem

 

I am using the folloing function to get 1/-1 value, but its not returning anything. Why??? I can see MACD lines making V shapes on the chart, but the following function is not returning anything.

int DailySignal()
{
double MD1,MD2,MD3;
MD1=iMACD(NULL,PERIOD_D1,12,26,9,PRICE_CLOSE,MODE_MAIN,0);
MD2=iMACD(NULL,PERIOD_D1,12,26,9,PRICE_CLOSE,MODE_MAIN,1);
MD3=iMACD(NULL,PERIOD_D1,12,26,9,PRICE_CLOSE,MODE_MAIN,2);
//Check Longs
if(MD2>0&&MD2<=MD3&&MD1>MD2){return(1);}//V Signal above zero
//Check Shorts
if(MD2<0&&MD2>MD3&&MD1<MD2){return(-1);}//V' Signal below zero
}

 
Gurus..............Your response is anxiously awaited.
 

I am using the folloing function to get 1/-1 value, but its not returning anything...

I should think it is returning something.

What debug steps have you tried?

Also, you have declared it to return an integer, but there is no default return value.

Add return(0);

 
on which line of the code do I need to add ...returen(0); Should I replace return(1/-1) part???.........how do I get 1/-1 signal then??
 

.

.

if(MD2<0&&MD2>MD3&&MD1<MD2){return(-1);}//V' Signal below zero
return(0);

}

Reason: