OrderSend Problem

 

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);
 

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); 
 
Now it says; 'ticket' - declaration without type
 
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.

 

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 =/ 

 
OrdersTotal()
int orders_max=5;

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

What do you mean with "do something"?

 
Rinor Memeti:

What do you mean with "do something"?

LOL...It means insert there the code you want, when the condition is true.
 
LOL....okay thanks :D
 
dear god...
Reason: