title: Poloniex api sell/buy immediatelly
body: <p>how to buy or sell immediatelly with poloniex api . i am using  <a href="https://github.com/AdamCox9/nickelbot" rel="nofollow noreferrer">nickelbot</a>
  and its always put for order</p>
  
  <pre><code>function api_buy()
  {
      global $Adapters;
  
      $exchange = isset( $_GET['exchange'] ) ? $_GET['exchange'] : "error";
      if( $exchange == "error" ) return array( "error" =&gt; "exchange required" );
      $price = isset( $_GET['price'] ) ? $_GET['price'] : "error";
      if( $price == "error" ) return array( "error" =&gt; "price required" );
      $amount = isset( $_GET['amount'] ) ? $_GET['amount'] : "error";
      if( $amount == "error" ) return array( "error" =&gt; "amount required" );
      $market = isset( $_GET['market'] ) ? $_GET['market'] : "error";
      if( $market == "error" ) return array( "error" =&gt; "market required" );
  
      //let's not open up the trade api to the public:
  
  
      return array( get_class( $Adapters[$exchange] ) =&gt; $Adapters[$exchange]-&gt;buy( $market, $amount, $price ) );
  }
  </code></pre>