ok thanks
Buy("EURUSD",0.01) * 10;
that's also correct
that's also correct
No it's not, this is :
Buy("EURUSD",0.01); Buy("EURUSD",0.01); Buy("EURUSD",0.01); Buy("EURUSD",0.01); Buy("EURUSD",0.01); Buy("EURUSD",0.01); Buy("EURUSD",0.01); Buy("EURUSD",0.01); Buy("EURUSD",0.01); Buy("EURUSD",0.01);
Yes. Don't buy ten times 0.01 lots, buy directly 0.1, done once slippage is counted once.
i have this code how can i change it such that it can buy/sell multiple trades at same time.
void OnTick(){
orderNum=0; dir=0;
for (int i=OrdersTotal()-1;i>-1;i--){
if(OrderSelect(i,SELECT_BY_POS)==false)continue;
if(OrderMagicNumber()!=BN||OrderSymbol()!=_Symbol)continue;
if(OrderType()==0)dir=1;else dir=-1;
orderNum++;
i have this code how can i change it such that it can buy/sell multiple trades at same time.
void OnTick(){
orderNum=0; dir=0;
for (int i=OrdersTotal()-1;i>-1;i--){
if(OrderSelect(i,SELECT_BY_POS)==false)continue;
if(OrderMagicNumber()!=BN||OrderSymbol()!=_Symbol)continue;
if(OrderType()==0)dir=1;else dir=-1;
orderNum++;
It's not there it should be used, find the "OrderSend" in your code & copy paste the right function. Don't forget the ...
alt+s to paste code in
OrderSend(_Symbol,cmd,lot,pr,slip,SL,TP,comment,BN);
here cmd is used for buy/sell and pr for ask/bid and BN for magic number
what should i add in them such that it can buy/sell the pair more than one times
OrderSend(_Symbol,cmd,lot,pr,slip,SL,TP,comment,BN);
here cmd is used for buy/sell and pr for ask/bid and BN for magic number
what should i add in them such that it can buy/sell the pair more than one times
Your previous code that starts with
for (int i=OrdersTotal()-1;i>-1;i--){
That just loops through the orders you have open already.
The OrderSend function sends one order. If you want to send more than one order you will have to call it more than once. You can use a for loop to do that as well if you would like.
int howMany=10;
for(;howMany>0;howMany--)
{
// put whatever you want to happen 10 times in here.
}
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
what is the function for (buy/sell) same pair multiple time
means buy eurusd lot 0.01 ten times at same time