如何使用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 ) );
}
答案 0 :(得分:1)
你是什么意思吗?
Websocket未实现发送买入或卖出订单,因此您必须使用API请求。
您可以使用
交易API方法: 买入和卖出(所需的POST参数是“currencyPair”,“rate”和“amount”)
答案 1 :(得分:0)
您可以选择将“immediateOrCancel”设置为1.可以部分或完全填写立即或取消订单,但订单中任何无法立即填写的部分将被取消而不是留在订单簿上。