Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 1726

 
MakarFX #:
First of all, it depends on the indicator that draws the fractals
How? I can find out if there is a signal on the n-th candle. But how do I know if the signal is on the interval of n candles?
 
Snajper007 #:
How do I know? I can find out if there is a signal on the n-th candle. But how do I know if the signal is present on the interval of n candlesticks?

Use a cycle. Go through n for x bars and find out if there were signals there or not

 
Nikolay Ivanov #:

Use a cycle. Go through n for x bars and find out if there were signals there or not

Unfortunately, I'm not that good at programming( That's why I ask such nerdy questions(
 
Snajper007 #:
Unfortunately, I'm not that good at programming( That's why I ask such nerdy questions(
   int n=10;
   datetime bar_sig;
   for(int i=n;i>=0;i--)
     {
      if(iCustom(NULL,0,"Твой индикатор",0,n)=="Сигнал")
         bar_sig=time[n];
     }
 
Can you tell me how to take the value of a candle a long time ago? That is, a very far back value. For example, if you write Close[10000], the terminal swears
 
Ivan Butko #:
Can you tell me how to take the value of a candle a long time ago? That is, a very far back value. For example, if I write Close[10000], then the terminal will swear.
Indicator or Expert Advisor? How does it alert? What is in the journal?
 
MakarFX #:
How does it affect me? What is in the log? Indicator or Expert Advisor?

EA (training, without trading functions)

EURUSD,M1: array out of range in 'Tutorial.mq4'

extern int    Period_check = 10000;

        

//+------------------------------------------------------------------+


void OnTick()

  {           

    Print("High = ", High[Period_check], ", Low = ", Low[Period_check]);  // тут ошибка EURUSD,M1: array out of range in 'Учебный.mq4' )

 }

 
Ivan Butko #:

EA (training, without trading functions)

EURUSD,M1: array out of range in 'Tutorial.mq4'

If it is an Expert Advisor, download its history.

Use iBars to check it.

 
Ivan Butko #:
Please, advise how to take the value of a candlestick a long time ago? That is, a very distant value. For example, if you write Close[10000], the terminal swears

Before accessing an array, make sure that the index does not exceed its limits. That is, find out the size of the array.

For timeseries this is iBars or Bars.

 
MakarFX #:

If an EA, download the history

Use iBars to check.

Taras Slobodyanik #:

Before you access an array, you need to make sure that the index does not go beyond its limits. That is, find out the size of the array.

For time series, it is iBars or Bars.

Thank you.

I wrote Print("Bar count on the 'EURUSD,M1' is ",iBars("EURUSD",PERIOD_M1));), from the documentation. The terminal logged the number 1001.) Although, the history is loaded, the max is more than 1000000 bars in the settings.

Please advise how to solve the problem
Reason: