Questions from Beginners MQL5 MT5 MetaTrader 5 - page 836

 
Opened two positions at a time. Yesterday it started to be restricted - could not open a trade over 100, although before it was at 700...
 
RashRash:
You can ask the support team of the brokerage company you opened a demo account with:

I don't think anyone here can tell you anything from the balance screenshots. At the very least you need the terminal logs.

You can also ask questions to the technical support of your brokerage company.

 
Got it, thanks!
 
... I'll try another terminal ... .
 

Thought I knew, but now I don't.

Question about indicator buffers. Is it correct to understand that the indicator buffer (on the basis of which indicator lines are built) is organized as follows:

the leftmost (aka oldest) index of the buffer has index 0 and the indexing of array-indicator-buffer elements by history is from left to right?

In other words, at the time of Elvis Presley (on the left) items with indexes 0, 1, 2 etc. were filled with data in the indicator buffer and in our bright present (on the right) items with indexes 1000001, 1000002, 1000003 etc. are filled with data.

Is this the correct understanding?

 
Good evening!Please help me to complete this function, I'm at a standstill, I need to make the balance increase by N%-increase, and the drawdown at this time is less than dd% - withdraw the money.
//вот функции набросок 
void Withdraw(double dep=500, double growth=10, double _dd=5) { 
double _bal=AccountInfoDouble(ACCOUNT_BALANCE); 
double _eq=AccountInfoDouble(ACCOUNT_EQUITY); 
double _ldd="что сюда?"; if(_ldd < _dd) 
TesterWithdrawal(_dep-_bal); // Снимаем: нач.депозит - баланс }

 
Denis Pershin:
Good evening,please help me to write the function, I'm stalled, I need to make, if balance has increased by N%-increase and drawdown at the moment is less than dd% - withdraw money.

If the balance has grown, then you have to fix the initial balance, for example, during initialization of the EA and then look at the growth and the equity status of the EA.

 
Aleksey Vyazmikin:

If your balance has increased, you need to fix the initial balance, for example, during the initialization of the Expert Advisor, and then look at the growth and the equity status of the balance.

If there is a deposit of 500, if the balance has increased by 10%, the 10% is removed, provided the current drawdown is not more than 5%. These input data are included in the function, but it is not possible to calculate the growth and drawdown.

 
Denis Pershin:

There is a deposit of 500, if the balance has grown by 10%, then we withdraw this 10%, provided that the current drawdown is no more than 5%. These inputs are included in the function, but it is not possible to calculate the growth and drawdown.

Are you looking for the replenishment on the whole history? This is how equity drawdown works for me

   double Balance=AccountInfoDouble(ACCOUNT_BALANCE);
   double Eguity=AccountInfoDouble(ACCOUNT_EQUITY);
   double Proc=0.0;
   if(Balance>0 && Eguity>0) Proc=Eguity/Balance*100;
   else Proc=100.0;
   if(Proc>100-5)//Закрываем все
Reason: