Bollinger Bands

Overview


Bollinger bands are calculated by taking a moving average, and then finding the one standard deviation price level above and below the moving average.

Definition


The following code demonstrates calculating a bollinger band using the channels library.


let tc = await import('/lib/finance/technical/v1.0.0/channels.mjs');

let prices = [{price:100},{price:101},{price:102},{price:103},{price:104},{price:105},];

let top = tc.bollinger(prices.map(p=>p.price), 3, 2, true);
let bottom = tc.bollinger(prices.map(p=>p.price), 3, 2, false);
					
Try it!