Order gets rejected when used in real trade - page 2

To add comments, please log in or register
Marco vd Heijden
Moderator
8426
Marco vd Heijden  

HAHA !! does it mean the comment on every trade has to be "Turbo" ?

thats kinda weird that is very hard to find out i think you did a great job at finding this issue !!

Laikennus
33
Laikennus  
Marco vd Heijden:

HAHA !! does it mean the comment on every trade has to be "Turbo" ?

thats kinda weird that is very hard to find out i think you did a great job at finding this issue !!

Ty man :)  . But if you guys didn't say that my original EA was supposed to be working, then I would have a much harder time figuring it out. If it was supposed to be working but it was not, then it must be something very unusual, like that

And yes, It's exactly as you say. I just tried changing the comment to "Turba" and the error came back lol. The broker really wanted the ppl to only use their EA and not another!

Rodrigo Malacarne
Moderator
11380
Rodrigo Malacarne  
Laikennus:

Ty man :)  . But if you guys didn't say that my original EA was supposed to be working, then I would have a much harder time figuring it out. If it was supposed to be working but it was not, then it must be something very unusual, like that

And yes, It's exactly as you say. I just tried changing the comment to "Turba" and the error came back lol. The broker really wanted the ppl to only use their EA and not another!

Hello Laikennus,

I think you're talking about CLEAR-PRD, a Brazilian broker. Please ask the broker's IT personnel about restrictions while running expert advisors on this broker.

As far as I know, expert advisors are temporarily blocked on this broker, as they do some IT-related improvements on the server-side.

Regards,
Malacarne

sergio.brito
16
sergio.brito  

Rodrigo, 

                eu também sou cliente XP aqui no Brasil e este problema está acontecendo comigo também somente na conta real. Na conta demo está funcionando normalmente. Já li alguns posts seus e você é daqui do Brasil também, correto? Poderia me informar o que pode está acontecendo com o meu código? O servidor da XP chega a aceitar minha ordem, conforme mensagens da captura de tela que anexei na imagem abaixo. Mas me parece que o OMS cancela minha ordem pendente em milésimos de segundo. Agradeço se me der uma caminho. Amanhã estarei entrando em contato com eles para saber se há algum bloqueio semelhante ao amigo acima da CLEAR.

 

         double volume=Lots;
         string symbol=_Symbol;    // specify the symbol, at which the order is placed
         double point=SymbolInfoDouble(symbol,SYMBOL_POINT);         // point
         double ask=SymbolInfoDouble(symbol,SYMBOL_ASK);             // current buy price
         double bid=SymbolInfoDouble(symbol,SYMBOL_BID);             // current sell price
         double price_buy=bid;                                 // preço de compra não normalizado
         double price_sell=ask;                                 // preço de venda não normalizado
         price_buy=NormalizeDouble(price_buy,2);                      // normalizing open price
         price_sell=NormalizeDouble(price_sell,2);                      // normalizing open price
         double SL_BuyLimit=price_buy-SL+point;  // Stop Loss não normalizado das ordens BuyLimit
         double SL_SellLimit=price_sell+SL*point;  // Stop Loss não normalizado das ordens SellLimit
         SL_BuyLimit=NormalizeDouble(SL_BuyLimit,2);  // Stop Loss normalizado das ordens BuyLimit
         SL_SellLimit=NormalizeDouble(SL_SellLimit,2);  // Stop Loss normalizado das ordens SellLimit
         double TP_BuyLimit=price_buy+TP*point;  // Stop Loss não normalizado das ordens BuyLimit
         double TP_SellLimit=price_sell-TP*point;  // Stop Loss não normalizado das ordens SellLimit
         TP_BuyLimit=NormalizeDouble(TP_BuyLimit,2);  // Stop Loss normalizado das ordens BuyLimit
         TP_SellLimit=NormalizeDouble(TP_SellLimit,2);  // Stop Loss normalizado das ordens SellLimit
         datetime expiration=TimeTradeServer()+PeriodSeconds(PERIOD_D1);
         string comment_buy=StringFormat("Buy Limit %s, lote de %d ações a %f, SL=%f TP=%f",
                               symbol,volume,
                               DoubleToString(price_buy,2),
                               DoubleToString(SL_BuyLimit,2),
                               DoubleToString(TP_BuyLimit,2));
         string comment_sell=StringFormat("Sell Limit %s, lote de %d ações a %f, SL=%f TP=%f",
                               symbol,volume,
                               DoubleToString(price_sell,2),
                               DoubleToString(SL_SellLimit,2),
                               DoubleToString(TP_SellLimit,2));
                               
         //--- Todas as variaveis prontas, enviando ordens pendentes de BuyLimit e SellLimit ao servidor
         if(!Trade.BuyLimit(volume,price_buy,symbol,SL_BuyLimit,TP_BuyLimit,ORDER_TIME_GTC,expiration,comment_buy))
           {
           //--- Mensagem caso a ordem BuyLimit falhe
           Print("BuyLimit() method failed. Return code=",Trade.ResultRetcode(),
                 ". Descrição do código: ",Trade.ResultRetcodeDescription());
           }
         else
           {
           //--- Mensagem caso a ordem seja executada com sucesso
           Print("BuyLimit() method executed successfully. Return code=",Trade.ResultRetcode(),
                 " (",Trade.ResultRetcodeDescription(),") and Ticket order=", Trade.ResultOrder());
           buylimit_order=Trade.ResultOrder();
           }                      
         if(!Trade.SellLimit(volume,price_sell,symbol,SL_SellLimit,TP_SellLimit,ORDER_TIME_GTC,expiration,comment_buy))
           {
           //--- Mensagem caso a ordem BuyLimit falhe
           Print("SellLimit() method failed. Return code=",Trade.ResultRetcode(),
                 ". Descrição do código: ",Trade.ResultRetcodeDescription());
           }
         else
           {
           Print("SellLimit() method executed successfully. Return code=",Trade.ResultRetcode(),
                 " (",Trade.ResultRetcodeDescription(),") and Ticket order=", Trade.ResultOrder());
           selllimit_order=Trade.ResultOrder();
           }                      
Alain Verleyen
36601
Alain Verleyen  
sergio.brito:

Rodrigo, 

                eu também sou cliente XP aqui no Brasil e este problema está acontecendo comigo também somente na conta real. Na conta demo está funcionando normalmente. Já li alguns posts seus e você é daqui do Brasil também, correto? Poderia me informar o que pode está acontecendo com o meu código? O servidor da XP chega a aceitar minha ordem, conforme mensagens da captura de tela que anexei na imagem abaixo. Mas me parece que o OMS cancela minha ordem pendente em milésimos de segundo. Agradeço se me der uma caminho. Amanhã estarei entrando em contato com eles para saber se há algum bloqueio semelhante ao amigo acima da CLEAR.

 

Please post in English on this forum. We also have a Portuguese section.

Translation:

I am also XP client in Brazil and this problem is happening to me also only the real account. In the demo account it is operating normally. I've read some of your posts and you are here in Brazil too, right? Could you tell me what's going on can with my code? The XP server comes to take my order as screenshot of messages that have attached the image below. But it seems that the WHO cancel my pending order in milliseconds. I appreciate if you give me one way. Tomorrow I will be contacting them to find out if there are any similar blocking his friend above the CLEAR.

sergio.brito
16
sergio.brito  
Alain Verleyen:

Please post in English on this forum. We also have a Portuguese section.

Translation:

Alain, 

 

            sorry. I am new here in this forum and did not realize that. Thanks!  

 

Sergio Brito 

hdemarco
26
hdemarco  

I am also CLEAR user and I am getting the same error: orders are reject without an error message. I also tried using "Turbo" comment and then I started receiving "Expert not authorized!" error.

The EA works perfect using DEMO account, but in PROD don't.

Alain Verleyen
36601
Alain Verleyen  
hdemarco:

I am also CLEAR user and I am getting the same error: orders are reject without an error message. I also tried using "Turbo" comment and then I started receiving "Expert not authorized!" error.

The EA works perfect using DEMO account, but in PROD don't.

Did you ask to your broker ?
hdemarco
26
hdemarco  
Alain Verleyen:
Did you ask to your broker ?

Yes. About 3 minutes ago they answered my e-mail saying PROD server does not allow automated trades using Meta Trader. It requires risk management and tools that they do not have available. I thought: WTF???????

So, if you are reading this and planning to sign up a contract to use Meta Trader with Clear, you will only have DEMO mode.

At this time I am closing my account at Clear Broker.

EduardoDSuarez
9
EduardoDSuarez  

Hi everyone, 

I think that I have the same problem with Clear Broker, and I just send an e-email just a minutes ago, and now searching the problem I find this poster.
I would like to know what home's broker are avaible here in Brazil without that problem. I want to use the metatrader 5 in real account

Thanks for the comments

123
To add comments, please log in or register