Momentum Composite

Momentum Composite is an indicator drawn in its own pane.

core language

momentum-composite.abx
1indicator "Momentum Composite"
2pane: new
3
4input trix_length = 18
5
6trix_line = trix(close, trix_length)
7volume_flow = volume_osc(5, 20)
8mfi_line = mfi(14)
9export composite = (trix_line * 100 + volume_flow / 10 + (mfi_line - 50) / 50) / 3
10export bullish = composite > 0 and composite > composite[1]
11
12plot composite as composite_line, style: columns, color: if bullish then teal else gray
13hline 0, color: gray
What this script says

Momentum Composite is an indicator drawn in its own pane.

You can change one input: trix_length (default 18).

It calculates trix_line as the TRIX (source the close, length trix_length), volume_flow as the volume oscillator (fast 5, slow 20), mfi_line as the money flow index (length 14), composite as (100 × trix_line plus volume_flow divided by 10 plus (mfi_line minus 50) divided by 50) divided by 3 and bullish as whether composite is above 0 and composite is above the previous bar's composite. It shares composite and bullish with scripts that use it.

On the chart, it plots composite as composite_line and draws a horizontal line at 0.

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

Create my free account