Errors, bugs, questions - page 1832

 
Vladislav Andruschenko:


in mt5?

Yeah, kinda,

I don't use extern in mt5 for a long time.


Ok. Then how do I change values in input parameters from the trading panel without opening them? After all, if they are displayed, it means that they cannot be changed.
 
Alexander Fedosov:

Ok. Then how do I change values in input parameters from the trading panel without opening them? After all, if they are displayed, it means that they cannot be changed.

no idea to be honest,


but the externs are not shown in the input parameters - has it been like this for a long time? you can tell from the beginning of the mt5 terminal

 
Vladislav Andruschenko:

no idea to be honest,


but externs are not shown in the input parameters - has this been the case since the beginning of mt5?


Well then it's time, probably in the SD, because I have a compiled version earlier than 1550 and there through the panel change variables like extern and are shown in the input parameters.
 
Alexander Fedosov:

Well, it must be time, apparently in the SD, because I have a compiled version before 1550 and there through the panel change variables like extern and are displayed in the input parameters.

Maybe they were introduced later and then removed again? since 2012 I understood that externs were replaced by input and actually changed everything to input
 

Hello I have 2 terminals mt5 Alpari and mt5 broker Otkritie. \

I have 12 tools in Otkritie + indicators installed. CPU load 5-10%.

There are 3 open windows in Alpari with the same indicators and CPU load 25-30%.

Both of them have 5000 bars in history settings
even with all charts closed and market symbols window closed, Alpari has 14% load

I would like to open more symbols, but this glitch with load does not allow me to do so.

CPU load is 8-9% when minimized window

I guess it's a glitch with rendering of charts? But then why doesn't the Discover Broker have such a problem?


 
Alexander Fedosov:

Well then it's time, apparently in SD, because I have a compiled on version before 1550 and there through the panel change variables of extern type and displayed in the input parameters.


this was originally written for this type of data, why you had them working as input parameters is not clear.

Extern variables

The keyword extern is used to declare variable identifiers as identifiers of a static memory class with global lifetime. Such variables exist at the start of program execution and are allocated and initialized right after the program starts.

It is possible to create programs consisting of several source files - for this purpose the #include preprocessor directive is used. Variables declared as extern with the same type and identifier can exist in different source files of the same project.

When the entire project is compiled, all extern variables with the same type and identifier are associated with the same area of memory pool of global variables. Extern variables are useful for separate compilation of source files. Extern variables can be initialized, but only once - it is unacceptable existence of several initialized extern variables of the same type and with the same identifier.

 
What is it?
2017.03.14 09:51:34.866 Trades  use Hosting Service to speed up the execution - 0.31 ms via 'MQL5 Amsterdam 2 (MQL5 Ltd.)' instead of 72.36 ms
 
fxsaber:
What is this?
Advertising:)
 

Hadn't noticed 1554 request states before

Interestingly, even before the requested state, the margin data is fully available.

 

Forum on trading, automated trading systems and trading strategies testing

Features of mql5 language, subtleties and tricks

fxsaber, 2017.03.14 08:38

  • In MT4/5 it is not possible for pending orders to change the magic, comment and volume.
Trading server FXOpen-MT5, launch the script
void OnStart()
{
  MqlTradeRequest Request = {0};
  
  Request.action = TRADE_ACTION_PENDING;
  Request.symbol = _Symbol;
  Request.volume = 1;
  Request.price = SymbolInfoDouble(Request.symbol, SYMBOL_ASK) - 100 * _Point;
  Request.type = ORDER_TYPE_BUY_LIMIT;
  Request.type_filling = ORDER_FILLING_IOC;
  Request.comment = "FirstComment";
  
  MqlTradeResult Result;
  
  if (OrderSend(Request, Result))
  {        
    Request.action = TRADE_ACTION_MODIFY;
    Request.order = Result.order;
    Request.type_time = ORDER_TIME_SPECIFIED;
    Request.expiration = TimeCurrent() + 1000;
    Request.comment = "NewComment";    

    OrderSend(Request, Result);  
  }
}

It places a pending order and modifies it by setting a new Request.comment field.

Script execution log

2017.03.14 11:33:47.642 Trades  '10127': buy limit 1.00 EURUSD at 1.06314
2017.03.14 11:33:47.775 Trades  '10127': accepted buy limit 1.00 EURUSD at 1.06314
2017.03.14 11:33:47.777 Trades  '10127': buy limit 1.00 EURUSD at 1.06314 placed for execution
2017.03.14 11:33:47.797 Trades  '10127': order #61938 buy limit 1.00 / 1.00 EURUSD at 1.06314 done in 154.608 ms (FirstComment)
2017.03.14 11:33:47.797 Trades  '10127': modify order #61938 buy limit 1.00 EURUSD at 1.06314 sl: 0.00000 tp: 0.00000 -> 1.06314, sl: 0.00000 tp: 0.00000
2017.03.14 11:33:47.930 Trades  '10127': accepted modify order #61938 buy limit 1.00 EURUSD at 1.06314 sl: 0.00000 tp: 0.00000 -> 1.06314, sl: 0.00000 tp: 0.00000
2017.03.14 11:33:47.930 Trades  '10127': modify order #61938 buy limit 1.00 EURUSD at 1.06314 sl: 0.00000 tp: 0.00000 -> 1.06314, sl: 0.00000 tp: 0.00000 placed for execution
2017.03.14 11:33:47.950 Trades  '10127': modify #61938 buy limit 1.00 EURUSD -> price: 1.06314, sl: 0.00000, tp: 0.00000) done in 154.566 ms (NewComment)

Terminal shows

Now delete the pending order manually and obtain the appropriate journal entries

2017.03.14 11:35:01.198 Trades  '10127': cancel order #61938 buy limit 1.00 EURUSD at 1.06314
2017.03.14 11:35:01.330 Trades  '10127': accepted cancel order #61938 buy limit 1.00 EURUSD at 1.06314
2017.03.14 11:35:01.333 Trades  '10127': cancel order #61938 buy limit 1.00 EURUSD at 1.06314 placed for execution
2017.03.14 11:35:01.465 Trades  '10127': cancel #61938 buy limit 1.00 EURUSD at 1.06314 done in 268.415 ms (NewComment)

Terminal shows




I.e., the comment of the pending order has actually changed. But the terminal could only show this in the logs and history - BAG!