Cannot close using Resistance option

 

I am trying to close a Open BUY trade after it goes below 20 pips, but instead it closes after 1 pip.


void OnTick()
  {
  
   double high = High[iHighest(NULL,0,MODE_HIGH,4,1)];
  
   //Close Buy
   if ((high-Close[1]) <= 20*Point)
     {   
      if(IsTradeAllowed())
         myOrderClose(OP_BUY, 100, "");
      else                                      //not autotrading => only send alert
         myAlert("order", "couldn't close");
     }
   
Any Suggestion would be greatly appreciated.

   

 

kekdge: I am trying to close a Open BUY trade after it goes below 20 pips, but instead it closes after 1 pip.

void OnTick()
  {
  
   double high = High[iHighest(NULL,0,MODE_HIGH,4,1)];
  
   //Close Buy
   if ((high-Close[1]) <= 20*Point)
     {   
      if(IsTradeAllowed())
         myOrderClose(OP_BUY, 100, "");
      else                                      //not autotrading => only send alert
         myAlert("order", "couldn't close");
     }
20 pips is not 20 points on brokers using 5 digits. On such brokers, 20 pips = 200 points, and 20 points = 2 pips!
 
kekdge:

I am trying to close a Open BUY trade after it goes below 20 pips, but instead it closes after 1 pip.


Any Suggestion would be greatly appreciated.

   


What do you mean "after it goes below 20 pips" do you mean 20 pips loss? If so put a stop loss on the order.

 
Keith Watford:


What do you mean "after it goes below 20 pips" do you mean 20 pips loss? If so put a stop loss on the order.

Good call. Thank you.