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

 
potom:

How to add a First/Previous function to an already ready-made indicator. That is, edit it.

Everyone says that this

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

It should be replaced with this

int OnCalculate (const int rates_total,
                 const int prev_calculated,
                 const int begin,
                 const double &price[])
  {

But all this does not give results. It may help to write it rather than edit it.

Please tell me how to put this function in!??, if possible in more detail.

1. If you use the SRC button to insert code, the code will look like this.

2. If you want a proper answer, you'd better ask the right question. The question, as posed in this post, is quite well answered.

 
Alexey Viktorov:

1. If you use the SRC button to insert the code, the code will look like this.

2. If you want to get the right answer, you'd better answer the question correctly. The question as asked in this message has a good answer.

For example, we have an ADX indicator, we want it to be able to read information not from the main chart, but from another indicator - Apply to Previous Indicatots Data.

The question - How to do it?

 
potom:

For example, we have an ADX indicator, we need to make it so that it could not read information from the main chart, but from another indicator - Apply to Previous Indicatots Data.

Question - How do I do this?


specify in the parameters of other symbols / period, and the data will be from another chart

and use the standard ones to calculate by array:
iMAOnArray
iRSIOnArray
...
 
Good night / day / evening / morning.

If the last quote came 1 second before the close of the candle, will the new candle appear on the chart only with the arrival of the new quote or will the start of a new candle be generated after 1 second regardless?
 
Ilya Prozumentov:
Good night / day / evening / morning.

If the last quote was received 1 second before the end of the candle, will a new candle appear on the chart only with the arrival of a new quote or will the start of a new candle be generated after 1 second regardless?
With the arrival of a new one. If it arrives later than the candle's period, the bar will be skipped.
 
Artyom Trishkin:
With the arrival of the new one. If it arrives later than the candle's period, there will be a missed bar.

And this missed bar will not be included in the bar count?

 
Taras Slobodyanik:

specify a different symbol/period in the parameters, and there will be data from a different graph

And for array calculation use the standard ones:
Thousand thanks
 
Ilya Prozumentov:

And this missed bar will not be counted in the bar count?

Who is the "bar counter"?

 
Artyom Trishkin:

Who is this "bar counter" ?

Bars / iBars

 
Ilya Prozumentov:

Bars / iBars

Check it out - find the "holey" story and have a look.