should i use, OP_SELLLIMIT or OP_BUYLIMIT

To add comments, please log in or register
zeeyeetee
66
zeeyeetee  

Hi,

I'm new using MQL4,

for instance, current gold price is 1200, I would like to place an sell order,(maybe called pend order), when the price going down to 1190, should I use ordersend, OP_SELLLIMIT or OP_BUYLIMIT or OP_BUYSTOP or OP_SELLSTOP


thanks in advance.

Keith Watford
Moderator
13923
Keith Watford  
zeeyeetee:

Hi,

I'm new using MQL4,

for instance, current gold price is 1200, I would like to place an sell order,(maybe called pend order), when the price going down to 1190, should I use ordersend, OP_SELLLIMIT or OP_BUYLIMIT or OP_BUYSTOP or OP_SELLSTOP


thanks in advance.

OP_SELLSTOP

Jozsef Bognar
805
Jozsef Bognar  
zeeyeetee
66
zeeyeetee  
Keith Watford:

OP_SELLSTOP

thanks,
zeeyeetee
66
zeeyeetee  
Jozsef Bognar:
thanks, i've collected your graphic,
zeeyeetee
66
zeeyeetee  
I've got  OrderSend Error: 3 with following code when doing the backtesting, 

could you please help me again. 

thanks

ticketSell = OrderSend(NULL,OP_SELLSTOP, lots, SellPrice,100, SellPrice+stoploss*Point, SellPrice-takeprofit*Point,"Sell Trade",magic, clrRed);

if(ticketSell < 0)
   {
      Alert("OrderSend Error: ", GetLastError());
   }
   else
   {
      Alert("Order Sent Successfully, Ticket # is: " + string(ticketSell)); 
   }


Keith Watford
Moderator
13923
Keith Watford  

You have no expiration parameter, set it to 0.

NULL is not a valid symbol, use _Symbol

Make sure that the entry is below the current price.

To add comments, please log in or register