My first order, need help

 

I am sending the first order on my live account, but it doesn't work. Can anybody tell me what's wrong ?

It is ok in demo but no on live. I use the below code, Thanks, Scheggia97 from Italy


OrderSend("EURGBP",OP_BUY,0.01,MarketInfo("EURGBP",MODE_ASK),3,0,MarketInfo("EURGBP",MODE_BID)+430*MarketInfo("EURGBP",MODE_POINT) );
 

could be u should send the order witout TP & SL, or try to check MarketInfo(Symbol, MODE_MINLOT), maybe it's 0.1, or try RefreshRates(), or MarketInfo("EURGBP",MODE_BID)+430*Point

instead of MarketInfo("EURGBP",MODE_BID)+430*MarketInfo("EURGBP",MODE_POINT)

 

qjol, thanks for you kind reply. If I send the order without tp it's ok but I need tp. I want use microlots

MarketInfo("EURGBP",MODE_BID)+430*Point - It doesn't work.

RefreshRates() - Where I should put this ?


Scheggia97

 

use OrderModify()

RefreshRates() before OrderSeend()

 
scheggia97:

[...]

RefreshRates() - Where I should put this ?

See here -> https://www.mql5.com/en/forum/126073. U don't necessarily need to use RefreshRates() before OrderSend().
 

Thanks qjol and gordon, I must study a solution.

If you may have any other idea please tell me.

Greeting from Italy,

Scheggia97

 
double Lots = 0.01;
int SL = 430;
int TP = 1000;
int Magic = 12345;


int ticket = OrderSend(Symbol(), OP_BUY, Lots, Ask, 3, 0, 0, "", Magic, 0, Blue);
if (ticket == -1)
   {
   Print("OrderSend() error - ", GetLastError());
   }
if (ticket > -1)
   {
   OrderSelect(ticket, SELECT_BY_TICKET);
   bool retrn = OrderModify(OrderTicket(), OrderOpenPrice(), Ask - SL*Point, Ask + TP*Point, 0, Blue);
   if (retrn == false)
      {
      Print("OrderModify() error - ", GetLastError());
      }
   }
 
gordon:
See here -> https://www.mql5.com/en/forum/126073. U don't necessarily need to use RefreshRates() before OrderSend().

From what it seems (OrderSend("EURGBP")), he uses the EA on a chart of a different currency, Therefore, there is a reason to use RefreshRates()
 
qjol:

From what it seems (OrderSend("EURGBP")), he uses the EA on a chart of a different currency, Therefore, there is reason to use RefreshRates()

No. In his example he is using MarketInfo() to read Bid, Ask and Point values. RefreshRates() is only needed when using any of the predefined variables (and he isn't). MarketInfo() does not require RefreshRates().

 
gordon:

No. In his example he is using MarketInfo() to read Bid, Ask and Point values. RefreshRates() is only needed when using any of the predefined variables (and he isn't).


then y not to use Bid Ask
 
qjol:

then y not to use Bid Ask
You gave the answer to that yourself. He is trading on another symbol than the one the expert is attached to (or it seems that he is).
Reason: