How can I fetch the GDAX 24 hours percentage for each products?
Should I request current price and current-24hours price and process the difference ? Or is there a better way ?
How can I fetch the GDAX 24 hours percentage for each products?
Should I request current price and current-24hours price and process the difference ? Or is there a better way ?
This is how I do it...
$stats = fetchFromGDAX("/products/$product-USD/stats");
$x = round((($stats['last']-$stats['open'])/$stats['open'])*100,3);
( fetchFromGDAX()
is my function to handle the API call )
This returns something like... -3.394%