Questions from Beginners MQL4 MT4 MetaTrader 4 - page 198

 
Good afternoon. Could you please tell me how to know the start and end time of the trading day? This is to learn the number of bars in the trading day, as it is different for different instruments. Many thanks in advance.
 

Hello, could you tell me how to correctly orcaniate the limit value?


Option 1:

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[])
  {

//---
   int i=0;
   int limit=0;
   int CountedBars=0;

   CountedBars=BarsCount;//IndicatorCounted();
   if(CountedBars>Bars-1)
      CountedBars=Bars-1;
   if(CountedBars<0)
      return(-1);
   if(CountedBars>0)
      CountedBars--;
   limit=CountedBars;

   for(i=limit-1; i>=0; i--)
     {


Option 2:

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[])
  {

//---
   int limit;
//---
   if(rates_total<=1)
      return(0);
//--- last counted bar will be recounted
   limit=rates_total-prev_calculated;
   if(prev_calculated>0)
      limit=limit+1;
      
            
   for(int i=limit-1; i>=0; i--)
     {
  

If option 2, how does it limit the calculation to 10,000 bars instead of all the bars on the chart?


Thank you.

 

Good day to all.
I am studying the theme of arrays (MT4) by Kovalev's tutorial. In the section array indexing, there are examples of what the array indexes can be specified as.
I understand that indexes are specified as numbers by default. But they can also be specified as variables. But the tutorial doesn't say how indexes expressed as numbers can be changed to indexes expressed as symbols, i.e. as variables. Or how to set indexes of an array as variables.
I would be very grateful if you could tell me which function is used to do this. I have not found such a function in the textbook or reference book. Or it is done by writing a special code. Please give me an example of such a code.
Thanks all for the help.

 
ANDREY:

Good day to all.
I am studying the theme of arrays from Kovalev's tutorial (MT4). In the section array indexing, there are examples of what the array indexes can be.
I understand that indexes are specified as numbers by default. But they can also be specified as variables. But the tutorial doesn't say how indexes expressed as numbers can be changed to indexes expressed as symbols, i.e. as variables. Or how to set indexes of an array as variables.
I would be very grateful if you could tell me which function is used to do this. I have not found such a function in the textbook or reference book. Or it is done by writing a special code. Please give me an example of such a code.
Thanks all for the help.

An array index is like house numbers on a street, they can only have numbers

 
the terminal(MT4) is not able to authorise mql5 . there were no problems before .
 
Hello. I was cleaning the keyboard and accidentally pressed a key and my toolbar settings got messed up. I set them manually but now after restarting the terminal they are not saved and I have to set them again each time. Can you please tell me how to save these toolbar settings for the terminal? http://prntscr.com/rlioyi
Скриншот
Скриншот
  • prnt.sc
Снято с помощью Lightshot
 
hmil:
Hello. I was cleaning the keyboard and accidentally pressed a key and my toolbar settings got messed up. I set them manually but now after restarting the terminal they are not saved and I have to set them again each time. Can you please tell me how to save these terminal toolbar settings ? http://prntscr.com/rlioyi
F11
 
Afternoon,when you create a synthetic chart with Period_Converter_Opt in MT4,for some reason they do not work with sound alerts for events,for example stochastics below 20,but they work on standard charts.Can you suggest the problem and how to fix it,can you add something to the indicator or Period_Converter_Opt.Thanks so much
 
Artyom Trishkin:
F11
Thank you
Artyom Trishkin:
F11
 
The timeframe does not switch on the same euro/dollar pair.
Reason: