I will paste it tonight, I can't do it now.
Thank you.
Antoine:
See attach my EA:
See attach my EA:
Your problem is quite easy - your main function is int OnCalculate and, as it is declared as function returning an integer (int) value, it should return such value at the end of function body. OnCalculate should return rates_total:
... CANDLE_STRUCTURE cand3; cand3=cand2; cand2=cand1; if(!RecognizeCandle(_Symbol,_Period,time[i-2],InpPeriodSMA,cand1)) continue; bool Buy_Condition_1 = (cand3.trend==DOWN && !cand3.bull); bool Buy_Condition_2 = (cand3.type==CAND_LONG || cand3.type==CAND_MARIBOZU || cand3.type==CAND_MARIBOZU_LONG); } return(rates_total); // this is what your code was lacking }
arminbahramian:
what is my problems?
You have your return inside the if condition.
You need to return something if the if condition is not satisfied.
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
Hello,
I meet a problem when I try to compile my EA, it return me a error message " '}' - not all control paths return a value" .
How can I solve it??