Download MetaTrader 5

Limit Order Question

To add comments, please log in or register
Paul
526
Paul  

I would like to be able to place a Limit order at a specific price, and then when the order is placed, put another limit order at the previous price.  I know how to open and close trades, but haven't worked with Limit orders.  Does anyone have ideas on how I would accomplish this?


Thanks!

Drazen Penic
2684
Drazen Penic  

Limit orders are placed same way you place trades - with OrderSend(). Difference is only in second parameter of OrderSend() where you specify type of order you want to send.

For example: 

int ticket=OrderSend(Symbol(),OP_BUYLIMIT,1,price,3,stoploss,takeprofit,"My order",16384,0,clrGreen);

 

 Of course, you must take care that parameters are correct for selected order type.

To add comments, please log in or register