That's what I thought at first but it turned out to be that it's not. Changing the time frame does not change the percentage.
It does. I would suggest you use data that's directly from an exchange and not tradingview's as there's a small margin of error. I regret using their graph to explain to you.
Example
1. 4H BTC/USDT chart on Binance

Opening price - 40,507.56
Closing price - 41,646.10
Percentage change within one candlestick in that time frame = (Closing price - Opening price) x 100/(Opening price)
(41,646.10 - 40,507.56) x 100/(40,507.56) = 2.810685215% as seen in the picture
If you change the timeframe to 1 hr, the opening and closing prices of the candle stick will also change, consequently affecting the percentage price change in that specific candle.
2. I did some small research and apparently trading view shows the 24 hours change
Change of what? The percentage? If so then what's the difference between this and the above time frame candle change (#1) you mentioned?
[/quote]
Difference
1. Calculations are made from within the closing and opening price of the same candle
2. Calculations are made from the opening price at 00:00 UTC to the whatever time you are currently looking at the chart.