I am sorry but I am eager to understand this
The below function is supposed to be buy and sell sending orders that will be executed for EA
The problem is the EA was executing the buy orders only
The solution of the problem was to delete - else{return false;} - in the below code after that it executed both buy and sell but I do not understand why,
would someone help me understand the logic of the solution and how (else{return false;} ) affected the code that way that made it execute only the buy orders
thanks
int TradeEntry(int Type){
if(Type == 0){
double BTP = Ask + (TakeProfit *Point);
double BSL = Ask - (StopLoss *Point);
if(OrderSend(Symbol(),OP_BUY,0.1,Ask,10,BSL,BTP,NULL,0,0,clrBlue)){
return true;}
else{return false;} //this line I delete then it executed the selling trades[/u][/u]
}
if(Type ==1){
double STP = Bid - (TakeProfit *Point);
double SSL = Bid + (StopLoss *Point);
if(OrderSend(Symbol(),OP_SELL,0.1,Bid,10,SSL,STP,NULL,0,0,clrRed)){
return true;}
else{return false;} //this line I delete then it executed the selling trades[/u][/u]
}
return false;
}