1. Go to this page and download the library: Download vdbelt/ftx-php library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
$ftx->subaccounts()->all()
$ftx->subaccounts()->create('nickname')
$ftx->subaccounts()->rename('old', 'new')
$ftx->subaccounts()->delete('nickname')
$ftx->subaccounts()->balances('nickname') // Get balances for a specific subaccount
$ftx->subaccounts()->transfer('BTC', 1, 'main', 'nickname') // Transfer funds between subaccounts
$ftx->markets()->all()
$ftx->markets()->get('BTC-PERP')
$ftx->markets()->orderbook('BTC-PERP', 100)
$ftx->markets()->trades('BTC-PERP', 100, new \DateTime('2020-03-01'), new \DateTime('2020-03-01 06:00:00'))
$ftx->markets()->candles('BTC-PERP', 15, 100)
$ftx->orders()->open();
$ftx->orders()->open('BTC-PERP');
// history
$ftx->orders()->history();
$ftx->orders()->history('BTC-PERP')
// Placing orders
// You can either pass the properties of your order directly:
$ftx->orders()->create(['market' => 'BTC-PERP', 'type' => 'market', 'size' => 1])->place();
// or use the fluent api to build up an order:
$ftx->orders()->create()->buy('BTC-PERP')->limit(1, 4000)->place();
// order status
$ftx->orders()->status(123456);
// cancel order
$ftx->orders()->cancel(123456);
// cancel all orders, including conditional orders
$ftx->orders()->cancelAll();
$ftx->orders()->cancelAll('BTC-PERP', $conditionalOrdersOnly = false, $limitOrdersOnly = true)
$ftx->conditionalOrders()->open();
$ftx->conditionalOrders()->open('BTC-PERP', 'take_profit');
//history
$ftx->conditionalOrders()->history();
$ftx->conditionalOrders()->history('BTC-PERP', null, null, 'buy', 'stop', 'market', 10);
// Placing orders
// You can either pass the properties of your order directly:
$ftx->conditionalOrders()->create(['market' => 'BTC-PERP', 'type' => 'takeProfit', 'triggerPrice' => 7000.99, 'size' => 1, 'side' => 'buy', 'reduceOnly' => true])->place();
// or use the fluent api to build up an order:
$ftx->conditionalOrders()->create()->stop($size = 1, $triggerPrice = 7000.99)->buy('BTC-PERP')->reduceOnly()->place();
// order status
$ftx->conditionalOrders()->status(123456);
// cancel order
$ftx->conditionalOrders()->cancel(123456);
// cancel all orders conditional orders
$ftx->conditionalOrders()->cancelAll();
$ftx->conditionalOrders()->cancelAll('BTC-PERP', $conditionalOrdersOnly = true, $limitOrdersOnly = true)