如何使用 poloniex api 立即购买或出售。我正在使用 nickelbot ,它总是下订单
function api_buy()
{
global $Adapters;
$exchange = isset( $_GET['exchange'] ) ? $_GET['exchange'] : "error";
if( $exchange == "error" ) return array( "error" => "exchange required" );
$price = isset( $_GET['price'] ) ? $_GET['price'] : "error";
if( $price == "error" ) return array( "error" => "price required" );
$amount = isset( $_GET['amount'] ) ? $_GET['amount'] : "error";
if( $amount == "error" ) return array( "error" => "amount required" );
$market = isset( $_GET['market'] ) ? $_GET['market'] : "error";
if( $market == "error" ) return array( "error" => "market required" );
//let's not open up the trade api to the public:
return array( get_class( $Adapters[$exchange] ) => $Adapters[$exchange]->buy( $market, $amount, $price ) );
}