Errors, bugs, questions - page 407

 

the problem of brakes and loading indicators"in chunks" like in an old movie,

has not gone away... unfortunately ....


new build did not help ...

Документация по MQL5: Программы MQL5 / Выполнение программ
Документация по MQL5: Программы MQL5 / Выполнение программ
  • www.mql5.com
Программы MQL5 / Выполнение программ - Документация по MQL5
 
Graff:

The function for defining a new bar is taken from the article:

Why possible loss of data due to type conversion is appearing on datetime lastbar_time=SeriesInfoInteger("EURUSD",PERIOD_M1,SERIES_LASTBAR_DATE); ????

A trivial warning to the compiler about possible data loss as a result of data type conversion. In this particular case you can ignore the warning, but it is better to write it like this (forcing you to specify the type into which the data should be converted)

datetime lastbar_time = (datetime)SeriesInfoInteger(Symbol(),Period(),SERIES_LASTBAR_DATE);
 

People, please help.

Getting ready for the championship. In my multi-currency EA, I need to warn about a stop-out situation.

"The Stop Out level (for forced closing of positions) is 50%." -It is written in the rules.

I want to make a check in every tick that the level is 45% (or 55%?) and do something about it when it triggers.

How to write a check in MQL5? Maybe there is a ready code?

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

People, please help me.

Getting ready for the championship. In my multi-currency EA, I need to warn about a stop-out situation.

"The Stop Out level (for forced closing of positions) is 50%." -It is written in the rules.

I want to make a check in every tick that the level is 45% (or 55%?) and do something about it when it triggers.

How to write a check in MQL5? Maybe there is a ready code?

Do you write the code from scratch by yourself, use the standard library or generate the Expert Advisor by Wizard?
 
Virty:

People, please help.

Getting ready for the championship. In my multi-currency EA, I need to warn about a stop-out situation.

"The Stop Out level (for forced closing of positions) is 50%." -It is written in the rules.

I want to make a check in every tick that the level is 45% (or 55%?) and do something about it when it triggers.

How to write a check in MQL5? Maybe there is a ready code?

if(AccountInfoDouble(ACCOUNT_MARGIN_LEVEL)<55.0)

    { ... }



 
Valmars:



Thank you!
 
gumgum:

Why aren't the brackets highlighted when the distance is long?

The maximum number of lines between which opening/closing brackets will be highlighted is 128. This limitation was introduced because there is no reason to highlight opening and closing parentheses which do not fit into one screen. Besides, the performance of MetaEditor has considerably increased after this restriction was introduced.

 
Valmars:

if(AccountInfoDouble(ACCOUNT_MARGIN_LEVEL)<55.0)

As far as I remember, this value can also be negative and there may not be any Reversal with the closing of negative positions.

 

I think it is better to use these properties

ACCOUNT_MARGIN_SO_CALL

The level of margin at which a deposit is required (Margin Call). Depending onACCOUNT_MARGIN_SO_MODEthis is expressed as percentage or in currency of deposit

double

ACCOUNT_MARGIN_SO_SO

The level of margin funds, upon reaching of which the stop out of the most unprofitable position is forcedly closed. Dependingon the set ACCOUNT_MARGIN_SO_MODE is expressed asa percentage or in the currency of deposit

double

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

I think it is better to use these properties

ACCOUNT_MARGIN_SO_CALL

The level of margin funds at which a deposit is required (Margin Call). Depending onACCOUNT_MARGIN_SO_MODEthis is expressed as percentage or in currency of deposit

double

ACCOUNT_MARGIN_SO_SO

Level of margin funds, upon reaching of which the stop out of the most unprofitable position is forcedly closed. Depending onACCOUNT_MARGIN_SO_MODEset ,it is expressed as a percentage or in the currency of deposit

double

The properties specify levels, but don't process events related to them.

Exactly the processing was needed.

PS

If I'm not mistaken the level should be calculated by balance and funds and the event will occur if the funds reach the level of X percent of the balance.

That is, if I understand correctly, the event should occur if in our case the funds are 50% of the balance.