OrderSend wont execute

 

Guys please help me out, Im sure I got some obvious mistake on my OrderSend function but I cant find whats wrong with it. The if statements appear to be wright because I get the Print SELL and BUY when I want to,  but no order gets executed. 


stopLoss = 5 pips, MaxRiskPerTrade = 1, slippage = 2.


if(!CheckOpenBuyOrders() && Close[0] > L3 && iTime(Symbol(),PERIOD_M1,0) >= timeWhenPriceHit + 60 && L3PriceHit){ 
Print("BUY");
       TicketBuyOrder = OrderSend(Symbol(),
                                  OP_BUY,
                                  (AccountBalance()*MaxRiskPerTrade/100)/(stopLoss * MarketInfo(Symbol(),MODE_TICKVALUE) * Point),
                                  Ask,
                                  Slippage,
                                  Bid - stopLoss * Point ,
                                  0,
                                  "My order BUY",
                                  magicNumber,
                                  0,
                                  clrGreen);
L3PriceHit = false;                                           
} 
      


if(!CheckOpenSellOrders() && Close[0] < H3 && NewBar(PERIOD_M1) && iTime(Symbol(),PERIOD_M1,0) >= timeWhenPriceHit + 60 && H3PriceHit) {
 Print("SELL");    
        TicketSellOrder = OrderSend(Symbol(),
                                    OP_SELL,
                                    (AccountBalance()*MaxRiskPerTrade/100)/(stopLoss * MarketInfo(Symbol(),MODE_TICKVALUE) * Point),
                                    Bid,
                                    Slippage,
                                    Ask + stopLoss * Point,
                                    0,
                                    "My order SELL",
                                    magicNumber,
                                    0,
                                    clrRed);
H3PriceHit = false;            
}


  

 

Always use

#property strict

and you will get the warning to check the return of the OrderSend().

If the OrderSend() fails, print the error.


In future please post in the correct section

I will move your topic to the MQL4 and Metatrader 4 section.