Errors, bugs, questions - page 882

 
A100:

Question: Is the min delay between calls documented

Huh, unlikely. Not only that, the maximum is likely too :) .
 

then it's strange that error code = 4754 is the same as for a known non-existent ticket

OrderSelect( 123456789/*произвольное число*/ );
I think I could have come up with a different code (busy for example) - someone gave me the ticket number result.order
 
A100:

then it is strange that the error code = 4754 is the same as that of a known non-existent ticket

Yeah, the event hasn't been processed by the terminal yet.

 
A100: then it's strange, that error code = 4754 is the same as for a knowingly non-existing ticket - I think we could have come up with another code (busy for example) - someone gave me the ticket number result.order

Here we have:

  • OrderSelect(ticket ) - copies the active order by its ticket from the terminal database into the cache of current orders for further reference to its properties using the OrderGetDouble(), OrderGetInteger() and OrderGetString() functions
  • Correspondingly, the order cannot be found in the base of the terminal . And that's why 4754 is returned. Even if the ticket is known.
    Have a look at the articles:

    Orders, Positions and Trades in MetaTrader 5;

    Trade Events in MetaTrader 5

     
    Yedelkin:
    Thanks for studying it, but I don't quite understand - with this code
    OrderSelect( tiket20 );
    OrderSelect( tiket20 ); //обращения последовательные, тикет то же
    

    How many times a request will be made to the terminal database: 2 or 1

    In other words, do I need to monitor the frequency ofOrderSelect( tiket20 ) calls not in terms of relevance of information, but in terms of time spent on the frequency of consecutive requests to the terminal base for the same question? (the question is not directly related to the previous one)

     
    A100:
    Thanks for studying it, but I don't quite understand - with this code

    How many times a request will be made to the terminal database: 2 or 1

    In other words, do I need to monitor the frequency ofOrderSelect( tiket20 ) calls not in terms of relevance of information, but in terms of time spent on the frequency of consecutive requests to the terminal base for the same question? (the question is not directly related to the previous one)

    Wait for the trade event in OnTradeTransaction() and check state of orders, positions and trade history.
     

    A100:
    Спасибо изучил, но не совсем понял - при таком коде

    OrderSelect( tiket20 );
    OrderSelect( tiket20 ); //обращения последовательные, тикет то же

    How many times will the terminal base be queried: 2 or 1

    Two consecutive calls to the OrderSelect() function will result in two consecutive requests to the terminal database, regardless of which ticket is specified as a function parameter. Another thing is that if our order (order details) still does not appear in the terminal database during those consecutive requests, the function will still return the "order not found" error code.

    A100 : In other words, should I keep track of the frequency ofOrderSelect( tiket20 ) calls not in terms of relevance of the information, but in terms of time spent on the frequency of consecutive requests to the terminal database for the same question? (the question is not directly related to the previous one)

    Yes, I need to control the frequency of one-type calls to the terminal database. Roche already suggested one of the options. I'm not used to OnTradeTransaction() function yet (too lazy to filter all trade events), therefore I act in an old fashioned way - using event-driven, if I may say so. I.e., I access the terminal's base when a next tick comes; if the order is not detected at a next tick, I simply "skip the turn" regarding that order.

     
    m_handle=iMA(m_strategy_symbol,(ENUM_TIMEFRAMES)m_period,maperiod,0,MODE_EMA,PRICE_CLOSE); - question why if optimization picks up m_period then it goes with some periods and not with some?
    Документация по MQL5: Стандартные константы, перечисления и структуры / Константы индикаторов / Ценовые константы
    Документация по MQL5: Стандартные константы, перечисления и структуры / Константы индикаторов / Ценовые константы
    • www.mql5.com
    Стандартные константы, перечисления и структуры / Константы индикаторов / Ценовые константы - Документация по MQL5
     
    AndreyS:
    m_handle=iMA(m_strategy_symbol,(ENUM_TIMEFRAMES)m_period,maperiod,0,MODE_EMA,PRICE_CLOSE); - the question is why if the optimization picks up m_period then with some periods it goes on and with some not?

    The only possible answer to this vague question is the same vague answer - Periods of charts
     

    AndreyS: 

      m_handle=iMA(m_strategy_symbol,(ENUM_TIMEFRAMES)m_period,maperiod,0,MODE_EMA,PRICE_CLOSE);

    - question why if optimisation selects m_period, then some periods are damped and some are not???

    1. Insert your code correctly.

    2. How is the m_period parameter optimized/selected? I.e. what is its value during your optimization?

    Reason: