ccxt | PHP cryptocurrency trading API with support | Cryptocurrency library
kandi X-RAY | ccxt Summary
kandi X-RAY | ccxt Summary
A JavaScript / Python / PHP library for cryptocurrency trading and e-commerce with support for many bitcoin/ether/altcoin exchange markets and merchant APIs. The CCXT library is used to connect and trade with cryptocurrency exchanges and payment processing services worldwide. It provides quick access to market data for storage, analysis, visualization, indicator development, algorithmic trading, strategy backtesting, bot programming, and related software engineering. It is intended to be used by coders, developers, technically-skilled traders, data-scientists and financial analysts for building trading algorithms.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Inf - inflate an output buffer .
- lint - disable - next - line
- Deflated state .
- Fetch remote resource
- Flattens a block of text into a string .
- Fills into the window with a random token .
- Translate a string into an earlier block
- Recursively format a value into a string .
- Encode a string into an array of characters
- Determines the longest pattern of a string .
ccxt Key Features
ccxt Examples and Code Snippets
'use strict';
const ccxt = require ('ccxt');
(async () => {
try{
const exchange = new ccxt.one({ enableRateLimit: true })
const tickers = await exchange.fetchTickers()
const obj = { tickers }
"use strict";
const ccxt = require ('ccxt')
const exchange = new ccxt.bitfinex ({
'apiKey': 'YOUR_API_KEY', // ←---- change your credentials
'secret': 'YOUR_SECRET',
});
(async () => {
await exchange.loadMarkets ()
co
Community Discussions
Trending Discussions on ccxt
QUESTION
As I call the fetch_balance method from kucoinfutures in ccxt, it only returns BTC, not any other assets. Shouldn't there be other assets like USDT or ETH too?
Here's the python code:
...ANSWER
Answered 2022-Mar-16 at 09:57It seems like fetchBalance only returns one currency at a time. To get USDT as the asset to be returned, you must pass the param currency via params currently using the exchange-specific currency id.
QUESTION
I am new to Firebase Cloud Functions and have been struggling with adding private npm packages to make my functions work. I understand Firebase will treat them all as public unless specified and will install with npm / yarn what I have in package.json.
The only way for me to tell Firebase that it's a private repository on Github is to add a
.npmrc (containing) - The key I am using is a Personal Access Token from Github-Developers that has all the need it permissions
...ANSWER
Answered 2021-Nov-01 at 08:22After the rest of the day searching for the answer it was the most simple but not the wisest solution that worked:
Completely ignored the .npmrc file and in package.json under dependencies just added the personal access token like so: @github.com
QUESTION
I have a text table that I am displaying using less -S -R
.
I would like that 3rd and 4th line of the output (the last 2 blue lines) to be a sticky header, so that it would work similar to the header here. Is it possible to do this with less?
Without using less, it's just a table of text (with special characters for the colours). You can copy this text into a my_file.txt
file and run cat my_file.txt | less -S -R
if you would like to test it out
ANSWER
Answered 2022-Mar-01 at 13:46A --header
option was recently added in less 600 (released on 2022-01-07) for that:
QUESTION
import ccxt
import pprint
with open("D:/api.txt") as f:
lines = f.readlines()
api_key = lines[0].strip()
secret = lines[1].strip()
binance = ccxt.binance({
'apiKey' : api_key,
'secret' : secret,
'enableRateLimit': True,
'options': {
'defaultType': 'future'
}
})
markets = binance.fetch_tickers()
print(markets.keys())
order = binance.create_limit_buy_order(
symbol = 'ENSUSDT',
amount = 1,
price = 19.5,
)
pprint.pprint(order)
...ANSWER
Answered 2022-Feb-16 at 09:39The closest you could do would be to multiply the contractSize
by the price
and the amount
you want to spend
QUESTION
I am new to NestJS and I did not find any clear instruction to do what I need to.
I wanted to build my backend using NestJS which I have never used before but only heard good things about. So the backend server I am going to build will be using a 3rd party module called ccxt from npmjs. In a normal node app, I would just create a random class for example CryptoManager, import the ccxt module and write some functions that are running on set intervals or whatever. Then I would create a controller class that instantiates an object of that CryptoManager class and from there on I can return it's responses.
But how am I supposed to do this with NestJS? What do I have to do, in order to have a custom class that is running background tasks available in other nest controllers / services and so on?
This class is just supposed to execute 3rd party (ccxt) module functions and store results in a database.But I want to be able to execute this classes methods from all points in the nestjs app (from all modules).
I hope my question is clear, if not please let me know.
...ANSWER
Answered 2021-Oct-03 at 23:07You'll need a combination of Modules and Providers to do this the "nest way", and then you can use dependency injection throughout your app.
Generally speaking, the way that you'd approach adding 3rd party libraries is the following:
- Create a module to wrap your library, like "CryptoManagerModule".
- Create a custom provider that provides the CCXT library, and add this to your
providers
array. - Create a service, "CryptoManagerService", and inject CCXT into the constructor.
- Export the "CryptoManagerService" from your module, so that you can inject it into the rest of your app.
- (Optionally) mark your module as "global", so that you only need to configure the module once in the AppModule to make it available to all other modules.
Inside crypto-manager.module.ts
QUESTION
The python example below from ccxt will fetch historical price quotes.
https://github.com/ccxt/ccxt/blob/master/examples/py/binance-fetch-ohlcv-to-csv.py
The code does not show how to set the time zone. How can I set the fetched price quote timestamp to Asian HK/Singapore time zone?
I am using python 3.9
...ANSWER
Answered 2021-Dec-27 at 11:54I think you can just pass datetime string with timezone like 2017-08-17T00:00:00+08:00
into scrape_candles_to_csv
function from your example ([Asian HK/Singapore has UTC+8 timezone)
Method exchange.parse8601
correctly handled strings with timezone
QUESTION
Is there any way I can use ccxt
to extract the price of a crypto currency at a given time in the past?
Example: get price of BTC on binance at time 2018-01-24 11:20:01
ANSWER
Answered 2021-Dec-12 at 04:18You can do that with CCXT's unified fetchOHLCV
method:
- https://docs.ccxt.com/en/latest/manual.html#ohlcv-candlestick-charts
- https://docs.ccxt.com/en/latest/manual.html#ohlcv-structure
We highly recommend reading the entire CCXT Manual from top to bottom, it will really save your time:
Also, check out the examples here:
QUESTION
I am using ccxt to connect to ByBit and create orders.
...ANSWER
Answered 2021-Nov-16 at 10:35Add reduce_only
to params
to exit out of a futures order
QUESTION
I am using ccxt to connect biance to fetch market, then raise error
...ANSWER
Answered 2021-Oct-28 at 06:37I have no idea what VPN this is, but it looks like that it is messing with the traffic.
This behavior is for example typical when using a company VPN, which also means to use the companies filtering when accessing the internet. Often Deep Packet Inspection is implemented here to control and limit access, and this can result in deliberately breaking outgoing connections.
QUESTION
ANSWER
Answered 2021-Oct-22 at 16:49- Tested in
python 3.8.12
,pandas 1.3.3
,matplotlib 3.4.3
- Works without any issues, however,
'Binance'
is small compared to'FTX'
, which can be resolved withax.set_yscale('log')
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install ccxt
ccxt in NPM (JavaScript / Node v7.6+)
ccxt in PyPI (Python 3.5.3+)
ccxt in Packagist/Composer (PHP 5.4+)
js/ in JavaScript
python/ in Python (generated from JS)
php/ in PHP (generated from JS)
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page