user115388: I am trying to match the binance's daily price change. I know it does provide 24h price change in percentage but the value I calculate is off no matter what.
So I am asking binance API to give me candle data for 1 day/week/month respectively.
I have these values I am using: current price (P), open price (OP), close price (CP).
I tried these but the values do not match what binance is showing for the daily change so I know all other calculations are also wrong:
priceChangeInPercentage = 100*(P - OP)/P

How does binance calculate this value?

user86302: You need to change the denominator to Open Price (OP) because the 24hpercentage will be calculated on basis of OP not on the last traded price (P).
priceChangeInPercentage = 100*(P - OP)/OP


115388: <p>I am trying to match the binance's daily price change. I know it does provide 24h price change in percentage but the value I calculate is off no matter what.</p>
<p>So I am asking binance API to give me candle data for 1 day/week/month respectively.</p>
<p>I have these values I am using: current price (P), open price (OP), close price (CP).</p>
<p>I tried these but the values do not match what binance is showing for the daily change so I know all other calculations are also wrong:</p>
<pre><code>priceChangeInPercentage = 100*(P - OP)/P
</code></pre>
<p>How does binance calculate this value?</p>
 86302: <p>You need to change the denominator to Open Price (OP) because the 24hpercentage will be calculated on basis of OP not on the last traded price (P).</p>
<pre><code>priceChangeInPercentage = 100*(P - OP)/OP
</code></pre>
