Questions from Beginners MQL5 MT5 MetaTrader 5 - page 872

 
Vladimir Karputov:

Check in the terminal for ticks on the date in 00-00

The ticks are there, an error in the modification function.

Thank you.

 

Can you tell me if there are any errors in the code?

Because when this code is added, the optimization speed drops drastically

//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
  {
if (UseEquityStop)
      {
        // если потеряно TotalEquityRisk (или больше) процентов депозита - закрываем позицию
        double AccountEquity = AccountInfoDouble(ACCOUNT_EQUITY);
        double AccountBalance = AccountInfoDouble(ACCOUNT_BALANCE);
        
        if (AccountEquity <= AccountBalance * (1 - TotalEquityRisk / 100))
          {
            Print("Потеряно ", TotalEquityRisk, "% депозита, принудительное закрытие позиции");
            CloseAllOrders();
          }
      }
//---------------------------------

бла бла код

Is there any way to speed up the optimization speed?

 
ilyav:

Can you tell me if there are any errors in the code?

Because when this code is added, the optimization speed drops drastically

Is there any way to speed up the optimization speed?

The balance and equity proportion can be calculated once and compared to the final result (no additional variables will be needed)

specify 100.0 in the divisor.

you perform idle checks and calculations at every tick even if there are no positions

 

Can you tell me why the bollinger bars in this simple code work so badly? The code is written as default as possible, so I can start calibrating it for a special indicator.

int OnInit()
  {
      iBands1_handle=iBands(_Symbol,0,peroid,shift,deviation,applied_price);
      return(0);
  } 
  
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int OnCalculate(const int rates_total,
                const int prev_calculated,
                const datetime &time[],
                const double &open[],
                const double &high[],
                const double &low[],
                const double &close[],
                const long &tick_volume[],
                const long &volume[],
                const int &spread[])
  {
   return(rates_total);
  }

The result:



 

When using ArrayPrint(), not all elements of the array are printed. Only the first 100 and the last 100 are printed. In the middle, an error is thrown

[100-10886] 10787 elements skipped by ARRAYPRINT_LIMIT flag

What does it mean?


 
clickaider:

Can you tell me why the bollinger bars in this simple code work so badly? The code is written as default as possible, so you can start calibrating it for a special indicator.

The result:



Where is the BB here ?
You see rubbish in uninitialised and unfilled indicator buffer.
 
Artyom Trishkin:
Where is the BB ?
You see rubbish in an uninitialised and unfilled indicator buffer.

Thank you, after adding the function below the graph has come to life

ChartIndicatorAdd(ChartID(),0,iBands1_handle);

Result:


 

Please add a function in Metatrader to the number of trades opened when a signal appears.

if ( description of deal opening condition )

int Kolsdel (number of trades, expiry time in candles, number of candles)

trade opening .

I can't believe I missed this function in mqvl5 .

 
Лауреат:

Please add a function in Metatrader to the number of trades opened when a signal appears.

if ( description of deal opening condition )

int Kolsdel (number of trades, expiry time in candles, number of candles)

trade opening .

I'm sorry, I'm afraid this mqvl5 is terrible without this function.

mql5 has everything you need to make such a function yourself.
You are the winner of the prize for laziest? :D
 
Artyom Trishkin:
mql5 has everything for making such a function by yourself.
Are you the winner of the award for laziest? :D

yes, you can. i couldn't find the video on youtube. the documentation is just for the smartest one.