X-Ray Flow Bands

X-Ray Flow Bands is an indicator drawn over the price chart.

renko, heikin ashi, x-ray

x-ray-flow-bands.abx
1indicator "X-Ray Flow Bands"
2bars: xray(20)
3
4input band_length = 30
5
6center = hma(close, band_length)
7width = stdev(close, band_length) * 2
8up_band = center + width
9down_band = center - width
10
11channel upper: up_band, lower: down_band, fill: linear_gradient(start: green.fade(80), end: red.fade(80))
12plot center, color: white, width: 2
13mark triangle_up, at: below, when: crosses_above(close, down_band), color: green, size: tiny
14mark triangle_down, at: above, when: crosses_below(close, up_band), color: red, size: tiny
What this script says

X-Ray Flow Bands is an indicator drawn over the price chart.

You can change one input: band_length (default 30).

It calculates center as the HMA of the close over band_length bars, width as 2 × the standard deviation of the close over band_length bars, up_band as center plus width and down_band as center minus width.

On the chart, it draws a channel, plots center, marks triangle up below the bar when the close crosses above down_band and marks triangle down above the bar when the close crosses below up_band.

Try this in the Terminal. AlgoBars is free: $0 a month, no card needed.

Create my free account