Download MetaTrader 5

Should I login to my account before sending orders in MT5?

To add comments, please log in or register
What is a social trading? Read the article to find that out!
sd2000sd
212
sd2000sd 2014.02.01 08:08 

Should I login to my account before sending orders in MT5?

I mean before using commands like: Ordersend(), should I send user information to server? should I do somehting else? because the server rejects all of my orders, but when I manually put them there is no error.

sd2000sd
212
sd2000sd 2014.02.01 09:27  

I want to send an order to the server using CTrade class.

I want to send the following order to the server:

Type: buyLimit

Volume: 1000

Price: 3000

Stop Loss: 0

Take profit = 0

Fill policy= return

Expiration: Today

 

what is the complete needed code for that?

should I use CTrade.OrderOpen() method first and then use CTrade.OrderSend()?

or is it just enough to use CTrade.BuyLimit() method?

Please explain

thanks

Alain Verleyen
Moderator
30742
Alain Verleyen 2014.02.01 09:57  
sd2000sd:

I want to send an order to the server using CTrade class.

I want to send the following order to the server:

Type: buyLimit

Volume: 1000

Price: 3000

Stop Loss: 0

Take profit = 0

Fill policy= return

Expiration: Today

 

what is the complete needed code for that?

should I use CTrade.OrderOpen() method first and then use CTrade.OrderSend()?

or is it just enough to use CTrade.BuyLimit() method?

Please explain

thanks

Show your code.
sd2000sd
212
sd2000sd 2014.02.01 11:23  
angevoyageur:
Show your code.
CTrade trade;
trade.SetTypeFilling(ORDER_FILLING_RETURN);
   
   trade.OrderOpen(Symbol(),ORDER_TYPE_BUY_LIMIT,300,0,3746,0,0,ORDER_TIME_DAY,0,"comment");
   
   trade.BuyLimit(300,3746,Symbol(),0,0,ORDER_TIME_DAY,0,"comment");
Simon Gniadkowski
Moderator
18001
Simon Gniadkowski 2014.02.01 13:55  
sd2000sd:

Should I login to my account before sending orders in MT5?

I mean before using commands like: Ordersend(), should I send user information to server? should I do somehting else? because the server rejects all of my orders, but when I manually put them there is no error.

How does the Server know what account the Order is for if you haven't logged in ?
sd2000sd
212
sd2000sd 2014.02.01 16:47  
RaptorUK:
How does the Server know what account the Order is for if you haven't logged in ?
you're right
To add comments, please log in or register