Gurus..............Your response is anxiously awaited.
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);
}

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
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
}