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 open-source

Nello spirito di condivisione promosso da TradingView, l'autore (al quale vanno i nostri ringraziamenti) ha deciso di pubblicare questo script in modalità open-source, così che chiunque possa comprenderlo e testarlo. Puoi utilizzarlo gratuitamente, ma il riutilizzo del codice è subordinato al rispetto del Regolamento. Per aggiungerlo al grafico, mettilo tra i preferiti.

Declinazione di responsabilità

Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.

Vuoi usare questo script sui tuoi grafici?