Multiple ordersend

 

Hi!


This is my code:

if(..........something.........) 
      {
      ticket1=OrderSend("EURUSD",OP_SELL,lots,Bid,1,0,0,"",0,0,Green); 
      ticket2=OrderSend("USDJPY",OP_BUY,lots,Ask,1,0,0,"",0,0,Green); 
      return(0);
      }


This code orders EURUSD only. How can I order the USDJPY too?


Thanks

 

Your error is that you specify Ask price for the charted pair (apparently EURUSD), not for USDJPY.

Bid and Ask are variables that hold prices for the pair on the chart.

See MarketInfo() to get the Bid and Ask for any pair.

 
ggekko wrote >>

Hi!

This is my code:

This code orders EURUSD only. How can I order the USDJPY too?

Thanks

string parite;

paritex="EURUSD";

ticket1=OrderSend(parite,OP_SELL,lots,Marketinfo(paritex, MODE_BID),1,0,0,"",0,0,Green);

paritex="USDJPY";

ticket2=OrderSend("parite",OP_BUY,lots,Marketinfo(paritex,MODE_ASK),1,0,0,"",0,0,Green);
i am using in. no problems.

OrderSend("USDCHF", OP_BUY, LotMiktari, MarketInfo("USDCHF", MODE_ASK), 3, 0, 0);
OrderSend("EURUSD", OP_BUY, LotMiktari, MarketInfo("EURUSD", MODE_ASK), 3, 0, 0);

OrderSend("GBPUSD", OP_BUY, LotMiktari, MarketInfo("GBPUSD", MODE_ASK), 3, 0, 0);
OrderSend("EURJPY", OP_BUY, LotMiktari, MarketInfo("EURJPY", MODE_ASK), 3, 0, 0);

OrderSend("GBPJPY", OP_BUY, LotMiktari, MarketInfo("GBPJPY", MODE_ASK), 3, 0, 0);
OrderSend("AUDUSD", OP_BUY, LotMiktari, MarketInfo("AUDUSD", MODE_ASK), 3, 0, 0);

OrderSend("NZDUSD", OP_BUY, LotMiktari, MarketInfo("GBPJPY", MODE_ASK), 3, 0, 0);
OrderSend("EURCAD", OP_BUY, LotMiktari, MarketInfo("AUDUSD", MODE_ASK), 3, 0, 0);

 
Thank you guys!