Errors, bugs, questions - page 2631

 
Alexey Viktorov:

This is for exchange traded instruments. Use OrderCalcMargin

how do I go from margin to lot if the margin per lot is zero?

 
Igor Zakharov:

how do I go from margin to lot if the margin per lot is zero?

bool  OrderCalcMargin(
   ENUM_ORDER_TYPE       action,           // тип ордера
   string                symbol,           // имя символа
   double                volume,           // объем
   double                price,            // цена открытия
   double&               margin            // переменная для получения значения маржи
   );
Документация по MQL5: Торговые функции / OrderCalcMargin
Документация по MQL5: Торговые функции / OrderCalcMargin
  • www.mql5.com
Вычисляет размер маржи, необходимой для указанного типа ордера на текущем счете и при текущем рыночном окружении без учета текущих отложенных ордеров и открытых позиций. Позволяет оценить размер маржи для планируемой торговой операции. Значение возвращается в валюте счета. [out]  Переменная, в которую...
 

Forum on trading, automated trading systems and trading strategy testing

Bugs, bugs, questions

Vladislav Andruschenko, 2020.01.23 09:59

Error on account switching with different symbol names.: Bild 2300


Suppose:

There is an account with all symbols without a suffix ! e.g. EURUSD

Installed Expert Advisor, everything is OK:


everything works.


Then we change the account without such symbols, but with another one with the suffix !

No chart is loaded, Expert Advisor is not initialized. OK

I.e. EA does not show life. OK! There is no chart!


We change the chart to another one (drag and drop the symbol in the window) The chart is built, but EA does not call the OnInit() function



Even OnTick does not work after these actions. I.e. the EA is dead, although it shows it is there!



Checked it on MACD Sample - the same thing.


The same is in build 2308.


Although I was wondering whether it is important to fix it. what percentage of those who will change accounts with different pairs and do as i did. ?

But just in case, I'll throw it in my profile. Otherwise I'll forget.



I remembered they wrote about this mistake before. I didn't know what it was. Now I've got myself in trouble. Better try to fix it though.
 

What could be causing the speed of execution?

2020.01.30 09:54:49.896 Terminal        MetaTrader 5 x64 build 2307 started (MetaQuotes Software Corp.)
2020.01.30 09:54:49.896 Terminal        Windows 7 Service Pack 1 (build 7601) x64, IE 11, AMD FX-4170 Quad-Core Processor , Memory: 10330 / 12255 Mb, Disk: 54 / 465 Gb, GMT+3
2020.01.30 09:54:49.896 Terminal        D:\MetaTrader 5\Hadge MT5
2020.01.31 10:15:15.179 Trades  '19251730': modify #518263462 buy 4.00 GBPUSD -> sl: 1.31010, tp: 1.31560 done in 39589.527 ms

Given the fact that

2020.01.30 09:54:50.856 Network '19251730': authorized on MetaQuotes-Demo through Access Point EU 2 (ping: 66.87 ms)
2020.01.30 20:57:52.825 Trades  use Hosting Service to speed up the execution - 0.78 ms via 'MQL5 Amsterdam 02 (MQL5.community)' instead of 71.27 ms
 
Alexey Viktorov:

What could be causing the speed of execution?

For all that.

Communication problems, SL/TP close to the market, broker spoiling, and a million other reasons.

 
Andrey Khatimlianskii:

Communication problems, SL/TP close to the market, broker spoiling, and a million other reasons.

I haven't noticed any problems with the connection, SL/TP are not close to the market at all. The broker cannot be spoiled because it is a MetaQuotes-Demo. Accordingly, there could be far fewer than a million reasons.
 
Alexey Viktorov:

got it... calculate the margin per lot using this function, that will be the answer...

 
Alexey Viktorov:
I haven't noticed any problems with communication, SL/TP is not close at all. The broker cannot pamper because it is MetaQuotes-Demo. Accordingly, the reasons may be much less than a million.

In MQ such errors can be emulated for testing purposes. Re-quotes (long enough) and disconnections are also common.

This is not worth paying attention to.

 
Alexey Viktorov:
Didn't notice any problems with connectivity, SL/TP is not close at all. The broker cannot pamper itself due to the fact that it is MetaQuotes-Demo. Accordingly, the reasons may be much less than a million.

I don't recommend checking the strategy and hoping for results from this server.
This server is more of a bug test server.
And this delay happens often.
Sometimes it takes 5 to 10 seconds for positions to open. Especially if it is a permanent opening (we try to test it that way).
This is not a broker and it's not obliged to provide the conditions.
Better to open cent accounts to test and more or less understandable results.
 
Andrey Khatimlianskii:

In MQ such errors can be emulated for testing purposes. Re-quotes (long enough) and disconnections are also common.

Do not pay attention to it.

Vladislav Andruschenko:

I do not recommend to test the strategy and hope for results from this server.
This server is more for testing bugs.
And this delay happens often.
Sometimes the opening of positions lasts for 5 to 10 seconds. Especially if it is a permanent opening (we try to test it that way).
This is not a broker and he is not obliged to provide the conditions.

Thank God it's not an MT5 error. I didn't pay any attention to it before. Now I just happened to see such figures.