How to close an order - page 2

 
ok. solved for closing position and change stoploss. For checking if order closed by stoploss I would do this: res1= OrderSelect(TicketNR); if (res1==false) // the order has been closed { res1=HistoryDealSelect(TicketNR); price=HistoryDealGetDouble(TicketNR,DEAL_PROFIT); if (price<0) && ??? HistoryDealGetDouble(TicketNR,DEAL_PRICE) ???? But TicketNR of the opened order TciketNR of deal? Thanks
Alain Verleyen:

To close a BUY position you have to send a SELL order with the same volume as your position.

To check if it's close by stoploss you can check the history of deals.

To change a stoploss you have to send an order TRADE_ACTION_SLTP.

Please read the documentation, the forum and articles. If you need help on coding please post your attempt.

 
Please suggest me if it's correct.....
Reason: