I reply to all queries on the forums and via email, once per day, Monday to Friday (not weekends).

If you are new here, please see some information on how to ask for support. Thank you!

Reply To: latest price info?

dashed-slug.net Forums Exchange extension support latest price info? Reply To: latest price info?

#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