cant get the stop loss to work

 
can someone point out the problem please, its the starter i just wanted the stoploss and trailing stop.thanks
{
        OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES);
        if(OrderType() <= OP_SELL && OrderSymbol() == Symbol())
          {
            if(OrderType() == OP_BUY)   // long position is opened
              {
                // check for trailing stop
                if(TrailingStop > 0)  
                  {                 
                    if(Bid - OrderOpenPrice() > Point*TrailingStop)
                      {
                        if(OrderStopLoss() < Bid - Point*TrailingStop)
                          {
                            OrderModify(OrderTicket(), OrderOpenPrice(), 
                                        Bid - Point*TrailingStop, 
                                        OrderTakeProfit(), 0, Green);
                            return(0);
                          }
                      }
                  }
              }
            else // go to short position
 
What the message do You get in the logs (expert log and client terminal log)?

Insert GetLastError function call after trade function and see what the error code You get.
Reason: