Strange Requoting

Back to topics list To post a new topic, please log in or register
avatar
25
neverman 2015.10.30 14:25
 

Hello guys,


I got puzzle for you that can't solve.

A last several orders were requoted by my broker. Their explanation is that my orders come with old prices, thats why slippage does not work and order is requoted.


I'm checking every 1 ms the broker quotes with Refreshrate() and MarketInfo, send the orders with MarketInfo data and I have 2 ms latency to my broker.


Can you tell me some possible reason, my orders to reach the MT4 server with old quotes ?

avatar
3134
qjol 2015.10.30 14:30 #
 
show the relevant code, and someone may assist you
avatar
25
neverman 2015.10.30 14:51 #
 
int Begin=GetTickCount();
   while(GetTickCount()<Begin+
13000)
   {
      Sleep(1);
      RefreshRates();
     
      int StartOrder=GetTickCount();


    //calculations not related to ordering

      if (Conditions)
         {
            Alert("Order 8001-BUY GOLD "," Buy Price=", MarketInfo("GOLD",MODE_ASK));
            FirstOrderAsk = MarketInfo("GOLD",MODE_ASK);
            _Order = OrderSend("GOLD",0,LotsGold,MarketInfo("GOLD",MODE_ASK),GoldSlippage,MarketInfo("GOLD",MODE_ASK)-MarketInfo("GOLD",MODE_POINT)*300,0,"",8001);
           
            err = GetLastError();
            while (!exit_loop)
                 {
                 RefreshRates();
               if (
                    !exit_loop &&
                    FirstOrderAsk != MarketInfo("GOLD",MODE_ASK) &&
                    Conditions
                  )                 
                       {
                           FirstOrderAsk = MarketInfo("GOLD",MODE_ASK);
                           _Order = OrderSend("GOLD",0,LotsGold,MarketInfo("GOLD",MODE_ASK),GoldSlippage,MarketInfo("GOLD",MODE_ASK)-MarketInfo("GOLD",MODE_POINT)*300,0,"",8001);
                           err = GetLastError();
                       }
               if (
                    !exit_loop &&
                    !Conditions
                  )                 
                    {
                       exit_loop = true;
                       Alert(Exit ordering! Ask=",MarketInfo("GOLD",MODE_ASK));
                    } 
                      
                    switch (err)
                        {
                            case ERR_NO_ERROR:
                                exit_loop = true;
                                Alert("GOLD Executed Buy Price=", MarketInfo("GOLD",MODE_ASK), " for ",GetTickCount()-StartOrder," ms" );
                                break; //Order executed successfully, break cycle
                           
                            case ERR_REQUOTE:
                                Alert("GOLD BUY Order REQUOTED! Lost time was ",GetTickCount()-StartOrder," ms" );
                                Sleep(1);
                                continue;    // continue until there is no error
                               
                        }  // end switch
                    } //while
                     

            RefreshRates();
         }
avatar
Moderator
3412
GumRai 2015.10.30 21:55 #
 

Do you run this on the Gold chart?

Is Gold open in the Market watch window? 

What code are you using, the above code will not compile

            Alert(Exit ordering! Ask=",MarketInfo("GOLD",MODE_ASK));

 missing "

 

Please use the SRC button when posting code 

avatar
25
neverman 2015.10.30 22:04 #
 

sorry, I'm using the forum rarely. I missed SRC button :(

Yes, Gold is opening in Market watch window.

In Alert there is missing " because the original text was on other language and missed the "

avatar
12992
WHRoeder 2015.10.30 23:08 #
 
What is GoldSlippage?
avatar
25
neverman 2015.10.31 08:36 #
 
200 ... but the support told me that the order is requoted because it comes with old price and slippage is irrelevant in this case.
Back to topics list  

To add comments, please log in or register