mirror of
https://github.com/discountry/ritmex-bot.git
synced 2026-09-11 01:08:07 +00:00
commit
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
- [Binance Set Futures Leverage](./examples/php/)
|
||||
|
||||
|
||||
```php
|
||||
<?php
|
||||
|
||||
include './ccxt.php';
|
||||
|
||||
// https://github.com/ccxt/ccxt/wiki/Manual#instantiation
|
||||
|
||||
date_default_timezone_set('UTC');
|
||||
|
||||
$exchange_id = 'binance';
|
||||
$exchange_class = "\\ccxt\\$exchange_id";
|
||||
$exchange = new $exchange_class(array(
|
||||
'apiKey' => 'YOUR_API_KEY',
|
||||
'secret' => 'YOUR_SECRET',
|
||||
'options' => array(
|
||||
'defaultType' => 'future'
|
||||
),
|
||||
));
|
||||
|
||||
$exchange->load_markets(); // https://github.com/ccxt/ccxt/wiki/Manual#loading-markets
|
||||
|
||||
// $exchange->verbose = true; // verbose mode on, uncomment for debugging
|
||||
|
||||
$symbol = 'BTC/USDT';
|
||||
|
||||
$market = $exchange->market($symbol);
|
||||
|
||||
// https://github.com/ccxt/ccxt/wiki/Manual#passing-parameters-to-api-methods
|
||||
$params = array(
|
||||
'symbol' => $market['id'], // convert a unified CCXT symbol to an exchange-specific market id
|
||||
'leverage' => 10,
|
||||
);
|
||||
|
||||
// https://github.com/ccxt/ccxt/wiki/Manual#implicit-api-methods
|
||||
$response = $exchange->fapiPrivate_post_leverage($params);
|
||||
|
||||
print_r ($response);
|
||||
```
|
||||
Reference in New Issue
Block a user