币安量化交易
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

52 lines
1.7 KiB

using Binance.Net.Clients;
using Binance.Net.Objects;
using Binance.TradeRobot.Model.Base;
using CryptoExchange.Net.Authentication;
using Newtonsoft.Json;
using SDKAdapter.APIClient;
using System;
namespace SDKTestConsole
{
internal class Program
{
private static System.Threading.Timer timer;
static void Main(string[] args)
{
var apiKey = "RsQ5RuhYbNRXCTGAQXhwb5Dt3jgPnwKXfR1OXz0qWmf3IsAC7zPQd14WGIr18rDA";
var secret = "yxW4PPb65rVpdo7fMt2mZcbNOtjOe3J4fMSRVtX5YJfj7kRzHW3dY6xfoW4jje1I";
var client = BaseAPIClient.Create(Enums.Exchange.Binance, 0, apiKey, secret);
//逐仓杠杆账户资产
var marginList = client.GetIsolatedMarginAccountAssets();
var s = JsonConvert.SerializeObject(marginList);
var spotClientOption = new BinanceApiClientOptions()
{
BaseAddress = "https://api.binance.com",
ApiCredentials = new ApiCredentials(apiKey, secret)
};
var usdFuturesClientOption = new BinanceApiClientOptions()
{
BaseAddress = "https://fapi.binance.com",
ApiCredentials = new ApiCredentials(apiKey, secret)
};
var binanceClient = new BinanceClient(new BinanceClientOptions()
{
UsdFuturesApiOptions = usdFuturesClientOption,
SpotApiOptions = spotClientOption
});
var binanceSocketClient = new BinanceSocketClient();
var r = client.GetIsolatedMarginAccountAssets();
//25.07786941
var i = client.IsolatedMarginRepay("GMTUSDT", 0.00009176M);
Console.ReadKey();
}
}
}