Questions from Beginners MQL5 MT5 MetaTrader 5 - page 1409

 

There is such a function in MQL5:

SymbolInfoDouble(Symbol(),SYMBOL_SESSION_PRICE_LIMIT_MAX)

According to the description, it returns "Maximum allowable price value per session".

Nobody knows what this value means? Is it the price limit above which trading will be stopped (if we believe the description)?


 

Can you tell me how to interrupt and remove from the report (or not to put in the report) a specific run under certain conditions (equality of values of two parameters to be searched) when optimising in MT5. If I just interrupt execution, the zero value still remains in the listof runs (Optimisation Result), clogging and slowing down the optimisation process .

 
alph:
Can you please tell me, is this tester's performance in life realistic? And is it good or bad result for a year with depo 3000$?

Why did you only take the 12th year? You should have taken the period from 12th to 22nd year, where you would have lost in the interval.

 
friends how to write a programme that adds A plus B.
 
Лауреат write a programme to add A plus B.

Good morning! You can write it like this:

//+------------------------------------------------------------------+
//|                                                     A_plus_B.mq5 |
//|                                  Copyright 2022, MetaQuotes Ltd. |
//|                                             https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2022, MetaQuotes Ltd."
#property link      "https://www.mql5.com"
#property version   "1.00"
#property script_show_inputs
//--- ВХОДНЫЕ ПАРАМЕТРЫ
input int A=0; // Переменная А
input int B=0; // Переменная В
//+------------------------------------------------------------------+
//| Script program start function                                    |
//+------------------------------------------------------------------+
void OnStart()
  {
//---
   int C=A+B;
   Comment("A + B равно: ",C);
   while(!IsStopped()) // проверим на принудительное завершение работы скрипта
      ChartRedraw(0); // если есть, то запустим принудительную перерисовку текущего графика
   Comment(""); // и уберём с графика комментарии
  }
//+------------------------------------------------------------------+

Regards, Vladimir.

Files:
A_plus_B.mq5  3 kb
 

Good day!

I am trying tocreate Expert Advisors through generation and faced the problem of a small number of signal modules (about 20). I want to combine, for example, Ishimoku or Bolinger with another one(s), but in the standard MT5 there are no signals of these indicators.
On the videos in the Internet you can see that people have an extended database of signal modules - can you tell me where to get it?

Как самому создать советника или индикатор - Алгоритмический трейдинг, торговые роботы - Справка по MetaTrader 5
Как самому создать советника или индикатор - Алгоритмический трейдинг, торговые роботы - Справка по MetaTrader 5
  • www.metatrader5.com
Для разработки торговых систем в платформу встроен собственный язык программирования MetaQuotes Language 5 ( MQL5 ), среда разработки MetaEditor и...
 
Владимир Самусёв #:

Good day!

I am trying tocreate Expert Advisors through generation and faced the problem of a small number of signal modules (about 20). I want to combine, for example, Ishimoku or Bolinger with another one(s), but in the standard MT5 there are no signals of these indicators.
On the videos in the Internet you can see that people have an extended database of signal modules - can you tell me where to get it?

Hello, Vladimir!

There are many trading modules in CodeBase. Look there. If you can't find it, you have two more options: either try to write your own trading signal(but for free!) based on the article MQL5 Wizard: How to write your own trading signal module or contact Freelance and they will write any trading module for you, but for money.

Regards, Vladimir.

 
Rost17 #:

Can you tell me how to interrupt and remove from the report (or not to put in the report) a particular run under certain conditions (equality of values of two parameters to be searched) when optimising in MT5. If I just interrupt execution, the zero value still remains in the listof runs (Optimisation Result), clogging and slowing down the optimisation process .

Try checking in Init() that no run is needed with these parameters, and if so, return INIT_PARAMERTERS_INCORRECT from that function.
This will probably give you what you need.
P.S. Check the names in the help, I wrote from memory
 
Yuriy Bykov #:
Try checking in Init() that no run is needed with such parameters, and if so, return INIT_PARAMERTERS_INCORRECT from this function.
This will probably give you what you need.
P.S. Check the names in the help, I wrote from memory

Thanks, Yuri!

 

Guys, hi all the pros and who knows how!

I have a problem with getting data from an indicator -- please help me, who can do it....

Function Objective: Calculate the average distance in points between the outer lines of the indicator"Bollinger Bands", for the specified period.

The essence of the problem: I can't get the real values of the price on the indicator lines for the specified bar, because for some reason the same price value is written to different buffers of the indicator, which also does not correspond to the real values of any of the lines on this bar. And as a result, some unknown price value is written to different buffers (at different requests), which nullifies the whole further work of the function.
Moreover, using exactly the same method as in this function, I was able to get indicators from any other indicators, but here it doesn't work....

int Bollinger_Bands(int _Average_Period, int _Number)
{
   double   Buffer_BASE_LINE[];                                                                          // Массив Буффера Линии BASE_LINE
   double   Buffer_UPPER_BAND[];                                                                         // Массив Буффера Линии UPPER_BAND
   double   Buffer_LOWER_BAND[];                                                                         // Массив Буффера Линии LOWER_BAND
   int      Bar_Cash             = _Average_Period;                                                                       // Количество плучаемых значений от индикатора
   int      Bands_Handel         = 0;                                                                       // Хендл индикатора Bollinger_Bands
   //---//
   double   Base_Line            = 0;                                                                       // Значение линии BASE_LINE
   double   Upper_Line           = 0;                                                                       // Значение линии UPPER_BAND
   double   Lower_Line           = 0;                                                                       // Значение линии LOWER_BAND
   //---//
   double   Band_Size_Buffer[];											// Буфер расчётных значений разницы между линиями индикатора 
   int      Band_Size_Total      = 0;										// Итог среднего значения расстояния между линиями в пунктах
   ENUM_APPLIED_PRICE   applied_price = PRICE_CLOSE; // тип цены 
   //---//
      ArrayResize(Band_Size_Buffer,_Average_Period+1);  
      ArrayResize(Buffer_UPPER_BAND,_Average_Period+1);
      ArrayResize(Buffer_LOWER_BAND,_Average_Period+1);
      //---//
         Bands_Handel = iBands(_Symbol,PERIOD_CURRENT,20,2,0,applied_price);
         //---//      
            CopyBuffer(Bands_Handel,0,_Number,_Average_Period,Buffer_BASE_LINE);       ArraySetAsSeries(Buffer_BASE_LINE,true);
            CopyBuffer(Bands_Handel,1,_Number,_Average_Period,Buffer_UPPER_BAND);      ArraySetAsSeries(Buffer_UPPER_BAND,true);
            CopyBuffer(Bands_Handel,2,_Number,_Average_Period,Buffer_LOWER_BAND);      ArraySetAsSeries(Buffer_LOWER_BAND,true);
            //---//

         //---//  Тут получение значений для выбранного номера бара из переменной которая передаётся в функцию (использовал как проверку получения данных по линиям)
         Base_Line   = NormalizeDouble(Buffer_BASE_LINE[_Number], _Digits);      //Alert("Base_Line[",_Number,"] = ",Base_Line);
         Upper_Line  = NormalizeDouble(Buffer_UPPER_BAND[_Number], _Digits);     //Alert("Upper_Line[",_Number,"] = ",Upper_Line);
         Lower_Line  = NormalizeDouble(Buffer_LOWER_BAND[_Number], _Digits);     //Alert("Lower_Line[",_Number,"] = ",Lower_Line);
             //---//
         
         
         //---// ** А это расчёт среднего расстояния между внешними линиями Боллинджера за указанный период. Получается 0 потому что одно число отнимается само от себя.
         for(int i=_Average_Period; i>=0; i--) { 
         //---//
            Upper_Line  = NormalizeDouble(Buffer_UPPER_BAND[i], _Digits);     //Alert("Upper_Line[",i,"] = ",Upper_Line);
            Lower_Line  = NormalizeDouble(Buffer_LOWER_BAND[i], _Digits);     //Alert("Lower_Line[",i,"] = ",Lower_Line);
            //---//
               Band_Size_Buffer[i] = NormalizeDouble( ((Upper_Line - Lower_Line) / _Point), 2);     //Alert("Band_Size_Buffer[",i,"] = ",Band_Size_Buffer[i]);
              }//---//
         
               Band_Size_Total = (int) MathMean(Band_Size_Buffer);
               //---//

   
 return(Band_Size_Total);
}
Reason: