Luandre Ezra:
Hi everyone I have this simple code function that give me an error message "'}' - not all control paths return a value"
I have a return value but why it gives me an error of return value, anyone knows how to fix it?
You declared it as a function that returns a boolean so ensure that all paths through the code end with a boolean returned.
If the IF statement is false what happens = no declared value for the return in your code.
bool GreenCandle(int shift = 0) { if(iOpen(Symbol(),PERIOD_CURRENT,shift) < iClose(Symbol(),PERIOD_CURRENT,shift)) return(true); return(false); }

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
Hi everyone I have this simple code function that give me an error message "'}' - not all control paths return a value"
I have a return value but why it gives me an error of return value, anyone knows how to fix it?