peacefulLizard50262

Welford Bollinger Bands (WBB)

The Welford method is an algorithm for calculating the running average and variance of a series of numbers in a single pass, without the need to store all the previous values. It works by maintaining an ongoing running average and variance, updating them with each new value in the series. The running average is updated using a simple formula that adds the new value to the previous average, weighed by the number of values that have been processed so far. The variance is updated using a similar formula that takes into account the deviation of the new value from the running average.

The Welford method has several advantages that make it a good fit for use in calculating Bollinger Bands. First, it is more numerically stable than other methods, as it avoids accumulating round-off errors and can handle large numbers of data points without overflow or underflow. This is important when working with financial data, which can contain large price movements and wide ranges of values.

Second, the Welford method is well-suited for use in real-time or streaming data scenarios where all the data may not be available upfront. This is useful in the context of Bollinger Bands, which are often used to identify trend changes and trading opportunities in real-time, as the bands are updated with each new data point.

Finally, the Welford method is simple and efficient, making it easy to implement and fast to compute. This is important when creating technical indicators and trading strategies, as performance is often a critical factor.

Overall, the Welford method is a reliable and efficient way to calculate the running average and variance of a series of numbers, making it a good fit for use in calculating Bollinger Bands and other technical indicators.

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?