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.

Skript med en öppen källkod

I sann TradingView-anda har författaren publicerat detta skript med öppen källkod så att andra handlare kan förstå och verifiera det. Hatten av för författaren! Du kan använda det gratis men återanvändning av den här koden i en publikation regleras av våra ordningsregler. Du kan ange den som favorit för att använda den i ett diagram.

Frånsägelse av ansvar

Informationen och publikationerna är inte avsedda att vara, och utgör inte heller finansiella, investerings-, handels- eller andra typer av råd eller rekommendationer som tillhandahålls eller stöds av TradingView. Läs mer i Användarvillkoren.

Vill du använda det här skriptet i ett diagram?