Errors, bugs, questions - page 1913

 
Doesn't work on demo either with example from help. ReplacedORDER_TIME_DAY with each of 4 modes in turn, still Invalid Expiration.
 
KirBiz:

Does the broker have a limit at the bottom to the time of expiry of the order? Minimum 10 min.


Find the answer to your question in "Trading on the Exchange".

 
prostotrader:

Look for an answer to your question in the "Exchange Trading" section.

Are you talking to me? I have searched everything possible on the topic 10022 and did not find a working answer.

 
Ilya Malev:
On demo also doesn't work with the example from the help. ReplacedORDER_TIME_DAY with each of the 4 modes in turn, still Invalid Expiration.

Expiration has nothing to do with it. Go like this

Request.type_filling = ORDER_FILLING_RETURN;
This indicates a bug in fact

Forum on trading, automated trading systems and strategy testing

Experiments with MetaTrader 5 at Opening

fxsaber, 2016.11.12 12:21

#define TOSTRING(A) #A + " = " + (string)(A)

void OnStart()
{
  Print(EnumToString((ENUM_SYMBOL_TRADE_EXECUTION)SymbolInfoInteger(_Symbol, SYMBOL_TRADE_EXEMODE)));
  Print(TOSTRING(SymbolInfoInteger(_Symbol, SYMBOL_FILLING_MODE)));  
  Print(TOSTRING(SYMBOL_FILLING_IOC));
  Print(TOSTRING(SYMBOL_FILLING_FOK));
}

On Metaquotes-Demo correct settings (all allowed)

Test (Si-12.16,M1)      SYMBOL_TRADE_EXECUTION_EXCHANGE
Test (Si-12.16,M1)      SymbolInfoInteger(_Symbol,SYMBOL_FILLING_MODE) = 3
Test (Si-12.16,M1)      SYMBOL_FILLING_IOC = 2
Test (Si-12.16,M1)      SYMBOL_FILLING_FOK = 1
All Filling modes are allowed and work for market and limit orders. But for stop orders only ORDER_FILLING_RETURN.
 
fxsaber:

Expiration has nothing to do with it. Make it like this

This shows a bug in fact
All Filling-modes are allowed and they work for markets and Limits. But for stop orders, only ORDER_FILLING_RETURN.

Thanks for the tip, it works that way.

 

For some reason, intelligence does not work when pointing to a global context, e.g. when typing

::StringToTime()

the tooltip appears only after the function name is fully entered:

Whereas in the class context, intelliance works:


 

strange glitch appeared in MT5 v1607, I am testing on real ticks, when testing in strategy tester in market review, tester shows date 2017.03.07 and time of last tick 11:01, however in log there are operations already 2017.03.09, while tester seems to hang as it stands still, who had similar experience and how is it treated?

 

Here's a simple code like this:

void CloseAllOrders()
{
bool Ans;
int i=0;
   for(i=1; i <=OrdersTotal(); i++)     
      {      
      Print("Проход № ", i);      
      if (OrderSelect(i-1,SELECT_BY_POS)==true) 
         {  
         if (OrderSymbol() != Symbol())
            continue;
         if (OrderType()==0)
	     {
//            Ans=OrderClose(OrderTicket(),OrderLots(), NormalizeDouble(Bid,Digits),25);
             }           
         if (OrderType()==1)
             {
//            Ans=OrderClose(OrderTicket(),OrderLots(), NormalizeDouble(Ask,Digits),25);
             } 
         }
      }      
         
return;
   
}

At the moment the function is started, two Buy positions are open. The function prints the presence of two orders twice: Passage 1, Passage 2.

We remove the comments and run the function again. It vigorously takes down one buy order, declares "Passage #1" and leaves the loop. The message "Passage #2" does not appear.

What's the magic?


 
nys2000:

What's the magic?


The wrong cycle
 
Artyom Trishkin:
In the wrong cycle

Could you be more specific?