antondmt

Array to SMA/EMA

This script is to help people with converting arrays to Simple Moving Average and Exponential Moving Average arrays. It is the same as using ta.sma() or ta.ema() in v5 with series but it takes an array as input instead. Both functions have inbuilt bad-input checking logic to ensure that the period length is not too high or too low - which could give unwanted results. If such values are used, the functions will output an array of the same length with NaN values. The EMA function also has an optional argument called sma_seed, which determines whether the first value in the output array will be the SMA of the first value from the input array (true) or the first value itself (false). Both functions work independently of one another, all you have to do is copy the entire function into your code and off you go! I can add more functions such as RMA or VWMA if there is demand, let me know and leave a like! ~ if you want.
Script de código abierto

Siguiendo el verdadero espíritu de TradingView, el autor de este script lo ha publicado en código abierto, para que los traders puedan entenderlo y verificarlo. ¡Un hurra por el autor! Puede utilizarlo de forma gratuita, aunque si vuelve a utilizar este código en una publicación, debe cumplir con lo establecido en las Normas internas. Puede añadir este script a sus favoritos y usarlo en un gráfico.

Exención de responsabilidad

La información y las publicaciones que ofrecemos, no implican ni constituyen un asesoramiento financiero, ni de inversión, trading o cualquier otro tipo de consejo o recomendación emitida o respaldada por TradingView. Puede obtener información adicional en las Condiciones de uso.

¿Quiere utilizar este script en un gráfico?