Errors, bugs, questions - page 384

 

Bug in MT5 build 441:

When debugging an EA, if no tool windows are opened before debugging, then after closing the EA, the position of the Market Watch and Navigator windows changes - they line up from left to right, regardless of their initial position. Besides, in this case, toolbars line up from top to bottom irrespective of their initial positions:

MT5

Which is not convenient. Then I have to switch everything back manually.

Oh, and one more question: can one use quotes from the strategy tester in the debug mode of the Expert Advisor? If it is possible, how?

Thank you!

 
IgnatyevName:

Bug in MT5 build 441:

Whendebugging an EA, if no tool windows are opened before debugging, then after closing the EA, the position of the Market Watch and Navigator windows changes - they line up from left to right, regardless of their initial position. Besides, in this case, toolbars are lined up from top to bottom, irrespective of their initial position:

1. This is a bug in all builds of MT4/5 from the initial ones.

2) The bug often appears when you quickly go to the terminal by F4 during compilation.

3. The bug appears less often when you bring up the terminal from the taskbar.

The impression is that somehow the file(?) of windows settings is blocked at the moment of loading and the terminal puts settings of panels location by default.

I'd be glad if developers would fix this nuisance too.

 

Good afternoon!

Can you tell me why there is no chart scrolling event among OnChartEvent() events list?

The first thing that comes to mind as an alternative - to check the number of the first visible bar in OnTimer,

but taking into account the minimum timer refresh period of 1 second, this option appears to be too slow.

Are there other more adequate alternatives and is it possible to add a scrolling event directly?

As far as I noticed, the mql5 programming platform is developing similar to other popular programming environments,

but all of them have a scrolling event.

Документация по MQL5: Стандартные константы, перечисления и структуры / Константы графиков / Свойства графиков
Документация по MQL5: Стандартные константы, перечисления и структуры / Константы графиков / Свойства графиков
  • www.mql5.com
Стандартные константы, перечисления и структуры / Константы графиков / Свойства графиков - Документация по MQL5
 

Good afternoon!

I am trying to find out the amount ofcollateral required to open 1 lot for a currency.

I am using the function:

SymbolInfoDouble(m_symbol.Name(),SYMBOL_MARGIN_INITIAL);

And any currencies I haven't checked, be it "EURUSD", "GBPUSD" etc... function returns 0.

How can this be?

Документация по MQL5: Стандартные константы, перечисления и структуры / Состояние окружения / Информация об инструменте
Документация по MQL5: Стандартные константы, перечисления и структуры / Состояние окружения / Информация об инструменте
  • www.mql5.com
Стандартные константы, перечисления и структуры / Состояние окружения / Информация об инструменте - Документация по MQL5
 
bobsley:

Good afternoon!

I am trying to find out the amount ofcollateral required to open 1 lot for a currency.

I am using the function:

And any currencies I haven't checked, be it "EURUSD", "GBPUSD" etc... The function returns 0.

How can this be?

As far as I understand, the alternative to this code also returns 0 in MQL4.

//MQL5
SymbolInfoDouble(m_symbol.Name(),SYMBOL_MARGIN_INITIAL);
//MQL4
MarketInfo(Symbol(),MODE_MARGININIT);

At least, no matter how hard I tried to get a different value...

The developer should explain this to you and provide you with an example of working with SYMBOL_MARGIN_INITIAL.

 

So, I need an MT4 analogue then.

MarketInfo("EURUSD",MODE_MARGINREQUIRED);

Is there anything in MT5 like this, or do I have to count by hand?

 

Initial and maintenance margins are not used on forex symbols.

Use OrderCalcMargin to check the margin.

 
alexey_petrov:

Initial and maintenance margins are not used on forex symbols.

Use OrderCalcMargin to check the margin.

This is it!!! thank you!
 
alexey_petrov:

Initial and maintenance margins are not used on forex symbols.

Use OrderCalcMargin to check the margin.

Tried to use. Got an error:

ERR_FUNCTION_NOT_ALLOWED

4014

System function is not allowed to be called


What am I doing wrong?

double  margin;
bool   res = OrderCalcMargin( ORDER_TYPE_SELL, "EURUSD", 1.00, Bid, margin );
 
Dima_S:

Tried to use it. Got an error:

ERR_FUNCTION_NOT_ALLOWED

4014

System function is not allowed to be called


What am I doing wrong?

Are you calling in an indicator?
Reason: