Combined two EA's and just have one error left to solve. Struggling to solve!

 

Hi All,


I've been practicing/learning MQL4 by modifying and tweaking a few example EA's to make this one and just have this one error left that I can't seem to spot the cause of! I don't suppose anything stands out to any of you does it? 


The error is: "not all control paths return a value" and is on line 213.

Thanks in advance for any pointers!!


            
Basic Principles - Trading Operations - MetaTrader 5 Help
Basic Principles - Trading Operations - MetaTrader 5 Help
  • www.metatrader5.com
is an instruction given to a broker to buy or sell a financial instrument. There are two main types of orders: Market and Pending. In addition, there are special Take Profit and Stop Loss levels. is the commercial exchange (buying or selling) of a financial security. Buying is executed at the demand price (Ask), and Sell is performed at the...
 
  1. When you post code please use the SRC button! Please edit your post.
              General rules and best pratices of the Forum. - General - MQL5 programming forum

  2. string FindOpType(int k){
       if(k == 1) return("SELL");
       if(k == 0) return("BUY");
            ********Error is at this line*********** What value are you returning here?
    }
    
 
whroeder1:
  1. When you post code please use the SRC button! Please edit your post.
              General rules and best pratices of the Forum. - General - MQL5 programming forum

Just tried to cut and paste the code into the SRC box and it said please enter the text of your post...


As for what value im returning there, its an EA that I didn't write that im trying to stich together with this EA that i have modified, so im not sure what value this is supposed to be returning in all honesty!

 
Jowin6789:

Just tried to cut and paste the code into the SRC box and it said please enter the text of your post...


As for what value im returning there, its an EA that I didn't write that im trying to stich together with this EA that i have modified, so im not sure what value this is supposed to be returning in all honesty!

in fact, just noticed i hadn't put Return(0) in, this removes the error but the EA for moving the stop loss to break even that works seperately doesn't seem to work when i combine it with this one. arrgghh!

Reason: