What does “warning: not all control paths return a value” mean? as I received this error after compiling
Why does an int function return a bool?
If Type does not equal 0 or 1, your function does not return anything.
OrderSend() does not return a bool.
I have deleted your other topics.
Please do not start a new topic everytime you make small changes in the same code.
This is the code that you posted
bool TradeEntry(int type){ if (type == 0) {double BTP = Ask + (TakeProfit*Point); double BSL = Ask - (StopLoss*Point); if( OrderSend(Symbol(),OP_BUY,Volume_,Ask,10,BSL,BTP,NULL,0,0,clrBlue)){ return true;} }else{ return false;} if(type == 1) {double STP = Bid - (TakeProfit*Point); double SSL = Bid + (StopLoss*Point); if( OrderSend(Symbol(),OP_SELL,Volume_,Bid,10,SSL,STP,NULL,0,0,clrRed)){ return true;} }else{ return false;} return false; }
Note from my earlier post.
OrderSend() does not return a bool.
and yet you have totally ignored it!
You have already been told in previous topic
You don't mention what warning you get.
Probably that the return from OrderSend should be checked.
Check that it returns >0 else print the error.
Again totally ignored.
Why ask for help and then don't act on the help that you get??
I have deleted your other topics.
Please do not start a new topic everytime you make small changes in the same code.
This is the code that you posted
Note from my earlier post.
and yet you have totally ignored it!
You have already been told in previous topic
Again totally ignored.
Why ask for help and then don't act on the help that you get??
I did not ignore it, I make some changes and when I face an issue that I cant figure it out I just ask those who has experience, no harm meant
I did not ignore it, I make some changes and when I face an issue that I cant figure it out I just ask those who has experience, no harm meant
You did ignore it!
Your revised code includes
if( OrderSend(Symbol(),OP_BUY,Volume_,Ask,10,BSL,BTP,NULL,0,0,clrBlue))
So you have completely ignored
OrderSend() does not return a bool.
and
You don't mention what warning you get.
Probably that the return from OrderSend should be checked.
Check that it returns >0 else print the error.
You did ignore it!
Your revised code includes
So you have completely ignored
and
I will not debate with you technically because definitely you are more experienced , but I do not understand the aggression and offensiveness of your response although I tried to clear my intention, I thought that a friendly public forum to share knowledge
No need, go ahead and delete the rest of posts if you want
I will not debate with you technically because definitely you are more experienced , but I do not understand the aggression and offensiveness of your response although I tried to clear my intention, I thought that a friendly public forum to share knowledge
No need, go ahead and delete the rest of posts if you want
There is no technical debate here and I don't believe that I am being aggressive.
You obviously don't understand how annoying and frustrating it is to waste your free time giving advise only to have that advise ignored.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use