Not Opening Trade

7 January 2015, 19:08
savedbygrace
0
32

I am writing an EA and wrote the code below but it is not opening a sell trade.  Please HELP.... Thanks



extern double lots = 0.01;

extern int takeprofit = 40;

extern int stoploss = 40;

extern int magic = 333454;



//+------------------------------------------------------------------+

//| Expert initialization function                                   |

//+------------------------------------------------------------------+

int init()

  {

  

  opensell();

  

  return (0);


  }

//+------------------------------------------------------------------+

//| Expert deinitialization function                                 |

//+------------------------------------------------------------------+

int deinit()

  {

  

  return (0);

   

  }

//+------------------------------------------------------------------+

//| Expert start function                                             |

//+------------------------------------------------------------------+

int start()

  {

    

  return (0);

   

  }


void opensell()

   {

   

  int x = OrderSend(Symbol(), OP_SELL, lots, Bid, 3, Bid+stoploss*Point, Bid-takeprofit*Point, NULL, magic, Blue);

  

   }


 


Share it with friends: