Download MetaTrader 5

OrderSend Problem

To add comments, please log in or register
Rinor Memeti
2706
Rinor Memeti  

hey i am a rookie in programming, i have the following problem:

Compiler says: 'OrderSend' - declaration without type

 What i should do?

 Code:

// BUY ORDER DEFINITION
   OrderSend(Symbol(),OP_BUY,LotSize,Ask,Slippage,BuyStopLoss,BuyTakeProfit,"Buy Order",MagicNumber,0,Green);
   
// Sell order definition
   OrderSend(Symbol(),OP_SELL,LotSize,Ask,Slippage,BuyStopLoss,BuyTakeProfit,"Sell Order",MagicNumber,0,Red);
soeherman effendy
1256
soeherman effendy  

maybe you can  try this

 

 

// BUY ORDER DEFINITION
  ticket=OrderSend(Symbol(),OP_BUY,LotSize,Ask,Slippage,BuyStopLoss,BuyTakeProfit,"Buy Order",MagicNumber,0,Green);
   
// Sell order definition 
   ticket=OrderSend(Symbol(),OP_SELL,LotSize,Ask,Slippage,BuyStopLoss,BuyTakeProfit,"Sell Order",MagicNumber,0,Red); 
Rinor Memeti
2706
Rinor Memeti  
Now it says; 'ticket' - declaration without type
Alain Verleyen
Moderator
31477
Alain Verleyen  
Rinor Memeti:

hey i am a rookie in programming, i have the following problem:

Compiler says: 'OrderSend' - declaration without type

 What i should do?

 Code:

Where is placed this code ?

You have to include this code in an event handler (OnTick, OnTimer...) or a function.

Rinor Memeti
2706
Rinor Memeti  

Okay thanks. Problem solved =)

 

Can you tell me how to code "maximum number of positions" function ?

searched in the internet but didnt found something useful =/ 

Marco vd Heijden
Moderator
4804
Marco vd Heijden  
OrdersTotal()
int orders_max=5;

if(OrdersTotal()<orders_max)
 {
  //Do Something
 }
Rinor Memeti
2706
Rinor Memeti  
Nice. Thanks. I will guve it a try
Rinor Memeti
2706
Rinor Memeti  

What do you mean with "do something"?

Alain Verleyen
Moderator
31477
Alain Verleyen  
Rinor Memeti:

What do you mean with "do something"?

LOL...It means insert there the code you want, when the condition is true.
Rinor Memeti
2706
Rinor Memeti  
LOL....okay thanks :D
Marco vd Heijden
Moderator
4804
Marco vd Heijden  
dear god...
12
To add comments, please log in or register