build a gridbot using real-time market data over websockets
hackingthemarkets / gridbot-websockets Goto Github PK
View Code? Open in Web Editor NEWbuild a gridbot using real-time market data over websockets
build a gridbot using real-time market data over websockets
when i execute show me:
`submitting market limit buy order at -1.99992679
Traceback (most recent call last):
File "/home/filho/.local/lib/python3.10/site-packages/ccxt/base/exchange.py", line 633, in fetch
response.raise_for_status()
File "/usr/lib/python3/dist-packages/requests/models.py", line 943, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://api.binance.com/api/v3/order
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/filho/btc/gridbot-websockets/gridbot.py", line 18, in
order = exchange.create_limit_buy_order(config.SYMBOL, config.POSITION_SIZE, price)
File "/home/filho/.local/lib/python3.10/site-packages/ccxt/base/exchange.py", line 2864, in create_limit_buy_order
return self.create_order(symbol, 'limit', 'buy', amount, price, params)
File "/home/filho/.local/lib/python3.10/site-packages/ccxt/binance.py", line 2855, in create_order
response = getattr(self, method)(self.extend(request, params))
File "/home/filho/.local/lib/python3.10/site-packages/ccxt/base/exchange.py", line 497, in inner
return entry(_self, **inner_kwargs)
File "/home/filho/.local/lib/python3.10/site-packages/ccxt/binance.py", line 5318, in request
response = self.fetch2(path, api, method, params, headers, body, config, context)
File "/home/filho/.local/lib/python3.10/site-packages/ccxt/base/exchange.py", line 541, in fetch2
return self.fetch(request['url'], request['method'], request['headers'], request['body'])
File "/home/filho/.local/lib/python3.10/site-packages/ccxt/base/exchange.py", line 649, in fetch
skip_further_error_handling = self.handle_errors(http_status_code, http_status_text, url, method, headers, http_response, json_response, request_headers, request_body)
File "/home/filho/.local/lib/python3.10/site-packages/ccxt/binance.py", line 5296, in handle_errors
self.throw_exactly_matched_exception(self.exceptions['exact'], error, feedback)
File "/home/filho/.local/lib/python3.10/site-packages/ccxt/base/exchange.py", line 2724, in throw_exactly_matched_exception
raise exactstring
ccxt.base.errors.BadRequest: binance {"code":-1100,"msg":"Illegal characters found in parameter 'price'; legal range is '^([0-9]{1,20})(\.[0-9]{1,20})?$'."}
`
the quantity is represented by the "POSITION_SIZE" config entry?
I can't identify the reason for the error.
Can you help me?
I use binance for testing. (yes I already changed it to ccxt.binance )
As can be seen here :
https://pastebin.com/kb4T4YaR
When running with BitGet the script fails on line 50 and 75 because it fails to return the order object.
Also brought it up with BitGet's team themselves since it looks like a proper call and your code looks right but if you see something that is off, let me know, if you have an update!
sometimes I am getting this error while I tries to update realtine candle:
this gridbot.js line 147 is this:
candleSeries.update(currentBar);
lightweight-charts.standalone.production.js:7 Uncaught Error: Cannot update oldest data, last time=1648128180, new time=1648128120
at t.hM (lightweight-charts.standalone.production.js:7:142348)
at t.dM (lightweight-charts.standalone.production.js:7:155747)
at i.t.update (lightweight-charts.standalone.production.js:7:145777)
at WebSocket.socket.onmessage (gridbot.js:147:26)
t.hM @ lightweight-charts.standalone.production.js:7
t.dM @ lightweight-charts.standalone.production.js:7
t.update @ lightweight-charts.standalone.production.js:7
socket.onmessage @ gridbot.js:147
Just to let you know that when using the Binance exchange I get the following error:
ccxt.base.errors.InvalidOrder: binance {"code":-1013,"msg":"Filter failure: MIN_NOTIONAL"}
I am stuck even at the authentication step. I follow as per their documentation here https://docs.kucoin.com/#authentication but still get :
ccxt.base.errors.AuthenticationError: kucoin Invalid KC-API-SIGN
or PASSPHRASE ERROR .
This is despite passing the exact credentials i have. Is there some API end points ( v1 vs V2 ) that need to be changed ?
Or its suppose to be a ccxt.pro feature and hence not available.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.