Closed TarrahArshad closed 4 years ago
BinanceSocketClientOptions
uses the new using Binance.Net.Objects.Spot
. Check in your code
using Binance.Net.Objects.Spot
i added but stile error
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using Binance.Net; using Binance.Net.Objects; using CryptoExchange.Net.Authentication; using CryptoExchange.Net.Logging;
using System.IO; using Telerik.WinControls.UI; using BinanceBOT.Model; using System.Linq;
using Binance.Net.Objects.Spot; using Binance.Net.Objects.Futures;
namespace BinanceBot.Wizo { public partial class frmFutures : Telerik.WinControls.UI.RadForm { public frmFutures() { InitializeComponent(); }
private async void frmFutures_Load(object sender, EventArgs e)
{
try
{
new BinanceBOT.Connector.BinanceApi(AppSettings.GetApiKey(), AppSettings.GetSecretKey());
// var successFuture = socketClientF.GetFuturesAccountBalance();
BinanceFuturesSocketClient Ws = new BinanceFuturesSocketClient();
BinanceFuturesClient Client = new BinanceFuturesClient(new BinanceFuturesClientOptions("https://testnet.binancefuture.com")
{
LogVerbosity = LogVerbosity.Debug,
LogWriters = new List<TextWriter> { Console.Out }
});
Client.SetApiCredentials(AppSettings.GetApiKey(), AppSettings.GetSecretKey());
Ws.SetApiCredentials(AppSettings.GetApiKey(), AppSettings.GetSecretKey());
var listenKey = await Client.StartUserStreamAsync().ConfigureAwait(false);
var bf = Client.GetFuturesAccountBalance();
// lblFutureBalance.Text = string.Format("Future Balance ${0} - BND{1}", bf.Data.ToList()[0].Balance, bf.Data.ToList()[1].Balance);
// label1.Text = Client.GetFuturesAccountBalance().Data;
var Account = await Ws.SubscribeToUserDataUpdatesAsync(listenKey.Data,
Balance =>
{
// label1.Text = Balance.WalletBalance.ToString();
},
Position =>
{
grvPosition.DataSource = Position;
},
Order =>
{
grvPosition.DataSource = Order;
},
ListenKeyExpired =>
{
}).ConfigureAwait(false);
}
catch (Exception ex)
{
// txtLogs.Text += $"\n ${ex.Message}";
}
}
}
}
you use testnet
for the client, and mainnet
for sockets. Use one thing
you use
testnet
for the client, andmainnet
for sockets. Use one thing
its correct ?
BinanceFuturesSocketClient Ws = new BinanceFuturesSocketClient(new BinanceFuturesSocketClientOptions("https://testnet.binancefuture.com") {
LogVerbosity = LogVerbosity.Debug,
LogWriters = new List<TextWriter> { Console.Out }
});
public BinanceFuturesSocketClient Ws = new BinanceFuturesSocketClient(new BinanceFuturesSocketClientOptions("wss://stream.binancefuture.com/ws/")
{
BaseAddress = "wss://stream.binancefuture.com/ws/",
BaseSocketCombinedAddress = "wss://stream.binancefuture.com/",
LogVerbosity = LogVerbosity.Debug,
LogWriters = new List<TextWriter> { Console.Out },
});
good now work fine and i recive positions and order and balance realtime one question when i recieve balance poistion and order is changed or no everytime i recive ?
You always get the balance first , then the position and orders. At Binance, this is done perfectly, unlike other exchanges. Based on my experience.
You always get the balance first , then the position and orders. At Binance, this is done perfectly, unlike other exchanges. Based on my experience.
great thank u i going to complete my project binance future UI is slow and i will implement myself platform for fast and easy trade stop losee take profite close or join to pump
hi i need know how to get realtime Trades , OrderBook , Depth , Chart , Market Price and price of all coin available in binance future in same time , and other data Funding/8h 24h changes , 24h high and 24h low and 25h volume and for calculator its have api we call or need we implement myself if yes where is formula for calc PNL ROE
i need balance and position and order websocket subscription and price also