dashed-slug.net › Forums › Exchange extension support › latest price info? › Reply To: latest price info?
October 5, 2018 at 2:50 pm
#4715
alexg
Keymaster
Thank you for sharing your code. This is indeed how you would use the exchange’s PHP API to pull the minimum bid and maximum ask prices for a market. You can also have access to the latest price exchanged with $market_summary->last_price
.
Once quick comment, you are checking for if ($ask == " ") {
. This might work, but to be safe, I would write if ( ! $ask ) {
. You are not interested in whether $ask
is empty but whether it is truthy or falsy. (See http://php.net/manual/en/language.types.boolean.php)
kind regards