Multi-Timeframe Trend Table
Multi-Timeframe Trend Table is an indicator drawn over the price chart.
other bar sizestables and dashboards
1
indicator "Multi-Timeframe Trend Table"2
pane: price3
4
h1 = bars(bars: 1h)5
h4 = bars(bars: 4h)6
d1 = bars(bars: 1d)7
8
h1_up = h1.close > ema(h1.close, 50)9
h4_up = h4.close > ema(h4.close, 50)10
d1_up = d1.close > ema(d1.close, 50)11
score = (if h1_up then 1 else 0) + (if h4_up then 1 else 0) + (if d1_up then 1 else 0)12
13
table position: bottom_right, rows: [["1h", if h1_up then "up" else "down"], ["4h", if h4_up then "up" else "down"], ["1d", if d1_up then "up" else "down"], ["Score", "{score}/3"]]14
bar_color if score == 3 then green else if score == 0 then red else grayWhat this script says
Multi-Timeframe Trend Table is an indicator drawn over the price chart.
It calculates h1 as 1-hour bars, h4 as 4-hour bars, d1 as daily bars, h1_up as whether h1.close is above the 50-bar EMA of h1.close, h4_up as whether h4.close is above the 50-bar EMA of h4.close, d1_up as whether d1.close is above the 50-bar EMA of d1.close and score as 1 when h1_up, otherwise 0 plus 1 when h4_up, otherwise 0 plus 1 when d1_up, otherwise 0.
On the chart, it shows a table and colors the bars.