Download MetaTrader 5
To add comments, please log in or register
You can test an application before buying it. Find out how to do that!
Paul
529
Paul 2014.06.24 13:06 

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
2408
Drazen Penic 2014.06.24 14:59  

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