Обсуждение статьи "Автоматический поиск дивергенций и конвергенций" - страница 3

 
odlambda:

...

I am trying to create prices of another index in one indicator. Instead of the RSI or MACD oscillator showing me linearly the price of an asset (future, currency), etc. But let's see how I can find a solution :)

...

First of all, you need to be sure that the prices of the other symbol are ok. You can do this with the Bars (OtherSymbol) function. If the function Bars () returns 0 or -1, then do return(0) from OnCalculate(), so that the next tick will attempt to recalculate the indicator.

To get the bar index of another symbol corresponding to the index of the calculated bar, use the CopyRates() function, but specify not the bar index, but time  (3-th parameter).

Example: https://www.mql5.com/ru/code/19832

 
Dmitry Fedoseev :

En primer lugar, debe haber de los precios del otro símbolo estaban bien. Puede hacer esto con la función Bars (OtherSymbol). Si la función Bars () devuelve 0 o -1, entonces devuelve (0) de OnCalculate (), de modo que el siguiente tick intentará recalcular el indicador.

Para obtener el índice de la barra de otro símbolo correspondiente al índice de la barra calculada, utilizar la función CopyRates (), pero no especifique el índice de la barra, sino el tiempo (parámetro 3-th).

Ejemplo: https://www.mql5.com/en/code/19832


Are you a machine or a super programmer. This envy gives me everything you know (in the healthy way that I tell you). In a few days I will tell you how it went. I like to study programming, I teach it in my country, and the truth is that this is a vice :).


Very grateful for your time.

Regards from Spain!!!!!