Binance is a cryptocurrency exchange website. This tag is for questions related to the Binance API and usage of Binance API wrappers. This tag is not specific to any programming language.
Questions tagged [binance]
1009 questions
-1
votes
1 answer
Keep Binance futures wss alive
I have this code :
startWss();
function startWss(){
let wsBinance = new WebSocket('wss://stream.binancefuture.com/stream?streams=btcusdt@bookTicker', {
apiKeyID: testApiKeys[0],
apiKeySecret: testApiSecrets[0]
});
if(wsBinance){
…

itneg
- 73
- 1
- 10
-1
votes
1 answer
Getting Binance Historical Data For Specific TimeZone
I found this python script on the web, it gets OHLCV historical data from Binance api by wanted dates, assets and time intervals. The script currently returns the data for UTC time.
I want to modify it so it will return the data (daily/hourly)…

Guy
- 15
- 1
- 2
-1
votes
1 answer
Binance: Partial Book Depth Streams
Please, you can sample code to JavaScript (jQuery, WebSocket) + PHP?
https://github.com/binance-exchange/binance-official-api-docs/blob/master/web-socket-streams.md
Open a stream to wss://stream.binance.com:9443/ws/bnbbtc@depth.
Buffer the events…

fajorog514
- 11
- 2
-1
votes
1 answer
binance eth-btc order 400 bad request
I have been having a weird error when trying to process an order with my web application I built in ASP.NET/C#. The interesting thing is the other calls work, like getting your account balance. So I found a website that goes through some things to…

ParkerBidigare
- 159
- 14
-2
votes
1 answer
How to wait until a delegate is called in an async method?
I have an async method inside BackgroundService where I need to wait until a specific condition is met within a delegate that can be called multiple times. Here's the code snippet:
private async Task BuyAndSetLimitSellOrder(string pair,…

exzzy
- 19
- 4
-2
votes
1 answer
issue with code could not run in Pine Script? “Undeclared identifier” error
Every time I tried to run the code I got this message.
10:32:09 PM Error at 4:37 Undeclared identifier 'input.'
10:32:09 PM Error at 4:32 The 'input' function does not have an argument with the name 'type'
10:32:09 PM Error at 6:5 Could not find…
-2
votes
1 answer
Is there a faster way to get price value from Binance
Currently I am trying to write an exchange bot to be used with Binance. Whenever I decide in code to make a sell or buy, the price value is almost always different, from the value, that I decide upon to make the exchange. Is there a faster way to…

nie
- 3
- 4
-2
votes
1 answer
I use websocket to fitch data from binance and it doesn't work but it was working before so I dont know what problem
this code:
SOCKET="wss://stream.binance.com:9443/ws/bitusdt@kline_15m"
def on_open(ws):
print(" opend connection ")
def on_close(ws):
print(" closed connection ")
def on_message(ws,message):
print(" receive message ")
…

Aous Salha
- 1
- 1
-2
votes
1 answer
Increase performace in a private trading terminal
I am in the process of building my own trading terminal with various functions for a school project where speed is important..
I have two functions that I would like to optimize. But don't know how to proceed
from here.
function1
const…

Snuskbetty
- 11
- 2
-2
votes
1 answer
How to use a percentage of your account balance per trade? Binance-python
As far as I am aware the only way to create a new futures order is with client.futures_create_order(). The issue is this requires you to give it the exact amount of contracts you would like to buy. I am using BUSD to make all my trades, so I am…

Edog
- 1
- 1
-2
votes
1 answer
How to count HL2 source in python Binance trading bot?
:))
I've made a crypto trading bot in python connected to my Binance account. My problem is to count HL2 source ((High+Low)/2). I want to make a sma(hl2, 17) but I can't figure out how to do it. If I use simply close (or open, low, high) it works…
-2
votes
1 answer
3 websockets not working (shiba, shushi, luna2)
I would like to retrieve the current price for these 3 cryptos below:
1000Shiba
Shushi
Luna2
I retrieve data for btc or eth but not these cryptos below:
Maybe I made a mistake?
new…

elodie
- 3
- 2
-2
votes
2 answers
Python / Binance API - How to scrape Binance Leaderboard futures position from API?
I would like to know how to scrape data (position, name of the trader, symbol,..)from the Binance leaderboard with Python and Binance API.
Thanks for your answers!
This is my actual code which doesn't work:
from binance.client import Client,…

Yredle
- 1
- 1
-2
votes
1 answer
Placing a buy order using binance api, error saying wrong symbol?
I have this code and i want to place a buy order using the binance spot api, but it doesn't like my symbol that i am using showing me the error:
{'code': -1102, 'msg': "Mandatory parameter 'symbol' was not sent, was empty/null, or…

Shiny
- 3
- 2
-2
votes
2 answers
Binance api php
I'm trying to integrate a binance api with php.
I want to spend my spot wallets and earnings.
I can't find the url I need for it and I can't get the endpoint either.
Additional question: For what do I need the timestamp?
$secret =…

LLoLoX
- 3
- 2