When i do CEX market order by ccxt, lets say 15 ETH for market price, it will buy ETH for total price of 15 USD.
@janeCMD thx for reporting this, we will take a look into it and will fix this asap!
@janeCMD can you please post your code with verbose output of it?
Not sure what you mean by verbose output, but this is what i do:
if($my_order["co_type"]=="buy"){
$res=$exchange->createMarketBuyOrder ($my_order["co_pair"], $my_order["co_amount"]);
}else if($my_order["co_type"]=="sell"){
$res=$exchange->createMarketSellOrder ($my_order["co_pair"], $my_order["co_amount"]);
}
@janeCMD before doing that add:
$exchange->verbose = true;
Then rerun your code and copy-paste the output here, plz. Thx!
Will do this later today or tomorow. I have another issue with CEX, should i post separate issue (fetch_ohlcv gives error: unjson not found) ?
@janeCMD
should i post separate issue
Nope, thx, I already see the reason there, will fix that as well!
@janeCMD the fetchOHLCV for CEX is fixed in 1.10.102. Would be thankful if you report whether it works for you or not (it should, we have tried it locally).
@kroitor Tryed version 1.10.110, now it doesnt show error, but OHLC array returned is empty (works with others i use). PHP code used:
$exchange = '\\ccxt\\cex';
$exchange = new $exchange ();
if ($exchange->hasFetchOHLCV){
$ohlc = $exchange->fetch_ohlcv ($_GET["pair"], '1h');
}
print_r($ohlc);
@janeCMD can you please post verbose output of it?
$exchange = '\\ccxt\\cex';
$exchange = new $exchange (array ('vebose' => true));
if ($exchange->hasFetchOHLCV){
$ohlc = $exchange->fetch_ohlcv ($_GET["pair"], '1m');
}
print_r($ohlc);
I've just ran this script and it worked for me:
<?php
include_once ('./ccxt.php');
$exchange = '\\ccxt\\cex';
$exchange = new $exchange ();
if ($exchange->hasFetchOHLCV){
print_r ($exchange->timeframes);
// cex supports 1m timeframes only
$ohlc = $exchange->fetch_ohlcv ('BTC/USD', '1m');
print_r($ohlc);
}
?>
Does it work for you as well? If so, you should show your verbose output or tell what's inside your $_GET['pair']...
mbp:ccxt igorkroitor$ node examples/js/symbols cex
Instantiating cex exchange (printSymbols @ symbols.js:24)
cex has 21 symbols: BCH/BTC, BCH/EUR, BCH/GBP, BCH/USD, BTC/EUR, BTC/GBP, BTC/RUB, BTC/USD, DASH/BTC, DASH/EUR, DASH/GBP, DASH/USD, ETH/BTC, ETH/EUR, ETH/GBP, ETH/USD, GHS/BTC, ZEC/BTC, ZEC/EUR, ZEC/GBP, ZEC/USD (printSymbols @ symbols.js:37)
limits | precision | maker | taker | id | symbol | base | quote | info
--------------------------------------------------------------------------------------------------------
[object Object] | [object Object] | 0 | 0.002 | BCH/BTC | BCH/BTC | BCH | BTC | [object Object]
[object Object] | [object Object] | 0 | 0.002 | BCH/EUR | BCH/EUR | BCH | EUR | [object Object]
[object Object] | [object Object] | 0 | 0.002 | BCH/GBP | BCH/GBP | BCH | GBP | [object Object]
[object Object] | [object Object] | 0 | 0.002 | BCH/USD | BCH/USD | BCH | USD | [object Object]
[object Object] | [object Object] | 0 | 0.002 | BTC/EUR | BTC/EUR | BTC | EUR | [object Object]
[object Object] | [object Object] | 0 | 0.002 | BTC/GBP | BTC/GBP | BTC | GBP | [object Object]
[object Object] | [object Object] | 0 | 0.002 | BTC/RUB | BTC/RUB | BTC | RUB | [object Object]
[object Object] | [object Object] | 0 | 0.002 | BTC/USD | BTC/USD | BTC | USD | [object Object]
[object Object] | [object Object] | 0 | 0.002 | DASH/BTC | DASH/BTC | DASH | BTC | [object Object]
[object Object] | [object Object] | 0 | 0.002 | DASH/EUR | DASH/EUR | DASH | EUR | [object Object]
[object Object] | [object Object] | 0 | 0.002 | DASH/GBP | DASH/GBP | DASH | GBP | [object Object]
[object Object] | [object Object] | 0 | 0.002 | DASH/USD | DASH/USD | DASH | USD | [object Object]
[object Object] | [object Object] | 0 | 0.002 | ETH/BTC | ETH/BTC | ETH | BTC | [object Object]
[object Object] | [object Object] | 0 | 0.002 | ETH/EUR | ETH/EUR | ETH | EUR | [object Object]
[object Object] | [object Object] | 0 | 0.002 | ETH/GBP | ETH/GBP | ETH | GBP | [object Object]
[object Object] | [object Object] | 0 | 0.002 | ETH/USD | ETH/USD | ETH | USD | [object Object]
[object Object] | [object Object] | 0 | 0.002 | GHS/BTC | GHS/BTC | GHS | BTC | [object Object]
[object Object] | [object Object] | 0 | 0.002 | ZEC/BTC | ZEC/BTC | ZEC | BTC | [object Object]
[object Object] | [object Object] | 0 | 0.002 | ZEC/EUR | ZEC/EUR | ZEC | EUR | [object Object]
[object Object] | [object Object] | 0 | 0.002 | ZEC/GBP | ZEC/GBP | ZEC | GBP | [object Object]
[object Object] | [object Object] | 0 | 0.002 | ZEC/USD | ZEC/USD | ZEC | USD | [object Object]
You should pass the symbol to fetchOHLCV...
Thank you for help Igor, 1m is working, now i found out. I was testing with almost all other just not 1m, pair was ETH/USD... not too great of an OHLC api, but i will have to live with it...
@janeCMD you can build (calculate/integrate) higher timeframes from 1m timeframe, btw. But this is beyond ccxt (for now), you will have to aggregate them in userland code, until we have these methods inside the library. Alternatively, you can use a statistical library to do it for you, there's plenty of them on GitHub. Let us know whether you succeeded to make an order and if it doesn't work for you, please, don't forget to paste full verbose output. Thx for your feedback!
@janeCMD do you have any follow-up on CEX orders? If it works for you, I'd close this issue. Let us know if you still have difficulties with it. Thx!
Didnt get to it yesterday, just testing now. Issue appears to be still present, behaves same as before. Verbose output is giving me this (Version i double checked, but new version i downloaded still list old version).
Request: Array ( [0] => GET [1] => https://cex.io/api/currency_limits/ [2] => Array ( [User-Agent] => ccxt/1.9.282 (+https://github.com/ccxt-dev/ccxt) PHP/5.5.38-1~dotdeb+7.1 ) [3] => ) Request: Array ( [0] => POST [1] => https://cex.io/api/place_order/ETH/USD/ [2] => Array ( [0] => Content-Type: application/x-www-form-urlencoded [User-Agent] => ccxt/1.9.282 (+https://github.com/ccxt-dev/ccxt) PHP/5.5.38-1~dotdeb+7.1 ) [3] => key=mzUsoSIXldBo1tZ4lHTp0BOyAHY&signature=F0C2EB3EE2C06B33B3D8F0A12B193AE74AAC40E9CBA3FAD9201E920E98A7495F&nonce=1510815685004&type=buy&amount=0.1&order_type=market ) {"lastrun":"Last RUN 23 seconds AGO","debug":"Arrayn(n [info] => Arrayn (n [error] => There was an error while placing your order: Invalid amountn [safe] => 1n )nn [id] => n)n----","orders":[{"459":{"type":"buy","price":"0","pair":"ETH/USD","amount":"0.1","rule":"immo market ","exchange_id":"","msg":"ERROR on ADDING ORDER"}}]}
Additionally, as you can see from verbose debug info, there is additional call to currency_limits (load_markets). This behavior has been causing me lot of problems and i am still not clear how to resolve. load_markets is called internally almost all the times and is causing me to get DDOs protection errors. I have cache for these kind of calls, but these are internal calls by ccxt. Would it be possible to add way to override this function without need to make separate subclasses for each exchange ? What i could do now is to rewrite it in /php/base/Exchange.php to work with my cache system, but obviously, this is not the best approach.
@janeCMD
Additionally, as you can see from verbose debug info, there is additional call to currency_limits (load_markets). This behavior has been causing me lot of problems and i am still not clear how to resolve. load_markets is called internally almost all the times and is causing me to get DDOs protection errors. I have cache for these kind of calls, but these are internal calls by ccxt. Would it be possible to add way to override this function without need to make separate subclasses for each exchange ? What i could do now is to rewrite it in /php/base/Exchange.php to work with my cache system, but obviously, this is not the best approach.
The load_markets
call is done only once per exchange, if this is not the case, there must be a bug with it somewhere, but the markets are cached by ccxt internally upon your first call to any unified method, like create_order
. The load_markets
will not be called on subsequent calls to create_order
, only upon the first one. That info is needed in order to do the conversions. Alternatively, you can preload them manually by calling load_markets
before calling create_order
. This whole topic is explained in the Manual, here: https://github.com/ccxt/ccxt/wiki/Manual#loading-markets (I highly recommend reading the entire Manual, there's a lot of very useful info there). So, I guess, CCXT already covers all parts of your question (you can do whatever you like with the markets any way you want it). Let us know if it works differently for you.
As for the bug on open orders, I'll test extensively, thanks for the output! Will get back to you on this.
You're right, 'set_markets' is exactly what i was looking for. Thank you for great support
Still one note regarding marketOrders. Some exchanges do not support it, but i need to make market orders anyway. Made the function for it, would it make sense to add this kind of logic into ccxt itself ?
function estimateMarketPrice($ob,$ordertype,$volume){
$c_orders=$ob['bids'];
if($ordertype=='buy'){
$c_orders=$ob['asks'];
}
$totalvol=0;
$est=0;
foreach($c_orders as $order){
$est=$order[0];
$totalvol+=$order[1];
if($totalvol > $volume * 1.5)
break;
}
return $est;
}
function doMarketOrder($exchange,$my_order){
$nomarket_orders=array('bittrex','cex');
$res="";
if(in_array($my_order["co_exchange"],$nomarket_orders)){
$ob = $exchange->fetchOrderBook($my_order["co_pair"]);
$est=estimateMarketPrice($ob,$my_order["co_type"],$my_order["co_amount"]);
if($my_order["co_type"]=="buy"){
$res=$exchange->createLimitBuyOrder ($my_order["co_pair"], $my_order["co_amount"],$est);
}else if($my_order["co_type"]=="sell"){
$res=$exchange->createLimitSellOrder ($my_order["co_pair"], $my_order["co_amount"],$est);
}
$res["exec_price"]=$est;
}else{
if($my_order["co_type"]=="buy"){
$res=$exchange->createMarketBuyOrder ($my_order["co_pair"], $my_order["co_amount"]);
}else if($my_order["co_type"]=="sell"){
$res=$exchange->createMarketSellOrder ($my_order["co_pair"], $my_order["co_amount"]);
}
}
return $res;
}
@janeCMD not really, because it's very usage-specific, for example the estimate * 1.5, and it does not take fees into consideration, it should be much more complicated than that, and it actually depends on many factors not accounted for in the above code, so, I'd say, we would keep that in userland for now, because various users need it working in different ways.
Just want to get back to OHLC. The problem is, this call in ccxt returns OHLC data from day before. Best alternative to current OHLC on CEX is this api: https://cex.io/api/price_stats/BTC/USD. This call allows to get start/close, maybe also approximate high/low closely to real values if enough precision is used. So... you should probably set CEX to not offer OHLC, or get OHLC method i described, or get it from 3rd party, like https://www.cryptocompare.com/api/ and there should be other
@janeCMD I will look into it, a simple time conversion may be missing somewhere. Will let you know about my findings.
@kroitor I have the same problem with market buy orders on CEX, see this example:
const orderResponse = await cex.createMarketBuyOrder('ETH/BTC', 0.011111);
I understand, like the other exchanges, that I want to buy 0.011111 ETH with a market order, right, but this is what I get:
> cex POST https://cex.io/api/place_order/ETH/BTC/
Request:
{ 'User-Agent': 'ccxt/1.9.192 (+https://github.com/ccxt-dev/ccxt) Node.js/8.9.0 (JavaScript)',
'Content-Type': 'application/x-www-form-urlencoded' } key=x&signature=x&nonce=1511853166&type=buy&amount=0.011111&order_type=market
cex POST https://cex.io/api/place_order/ETH/BTC/
Response:
{"id":"5086305365","message":"Your order has been completed. Bought 0.22983200 ETH for 0.01111096 BTC","symbol1Amount":"229832","symbol2Amount":"1111096","time":1511853166339,"type":"buy"}
I bought ETH for a BTC value of 0.011111....
Checking the code seems that is a problem with cex mixing the size and the amount, because sell market orders works as expected (really sells the size of ETH), anyway I think ccxt should workaround (if possible) to be able to use cex markets orders in a standardized way.
Thanks
Thanks for the detailed feedback @jgordor ! I'm working on this, will upload the fix, hopefully, very soon. Will update you here when this is resolved, of course.
Ok, this issue is now fixed.
Unfortunately, CEX.io requires the amount of quote currency to spend for market buy orders. That is true for market buy only, for market sell the amount designates how much base currency (crypto) to sell.
So, to place a market-buy order @ CEX.io you will have to call the createOrder (symbol, 'market', 'buy', amount, price)
with both amount and price submitted, for ccxt to be able to calculate proper order cost. Otherwise it will throw an exception. We believe, this is now anyway better than buying a wrong amount silently, like it did before.
Let us know if you still have difficulties with it after updating to 1.10.239+. Thank you!
Thanks @kroitor I will test and report to you if I have any problems
Hey, just saw this thread and encountered the same problem. If CEX.IO requires me to specify the price, how is that a market order then?
@eranartzi
how is that a market order then?
By pure logic. That price is not sent towards the exchange and it is used to calculate the order cost (amount * price), that is the amount you want to spend with a market order. That resulting amount-to-spend is the value that gets sent towards the exchange. So, you can pick any price you like to match the total cost with your desired amount. Think of order cost (amount to spend) as something fixed, and think of amount and price as non-fixed values that you can adjust.
Example: you want to buy as much BTC as possible for a cost of $100 – you pick an amount of 1 and a price of $100, or an amount of 5 and a price of $20... The exchange will give you as much BTC as it can for your total cost of $100 anyway for the best market price available.
Alternatively, we could make some exchanges treat amount
as cost
with certain order types and sides, but that would really introduce much more confusion than asking for an additional multiplier (price) for market buys with some exchanges. You would end up suddenly buying strange amounts of tokens if you wouldn't know the specifics of each particular exchange.
Thanks @kroitor, appreciate the answer.
Though in my case I'd like to buy a fixed amount and I am more flexible on cost. I guess there's no way for me to do that?
@eranartzi with that exchange, I'm afraid, the exchange itself imposes the fixed nature of the cost (amount to spend) on you.
Unable to use createMarketBuyOrder() function to place marketBuy order. I understand it can be done by createOrder (symbol, 'market', 'buy', amount, price)
But ccxt should unify function usage. coinex and huobipro also has this issue but I can multiply price with amount and place marketBuy order in those exchanges.
Please have this feature to set options['createMarketBuyOrderRequiresPrice'] = false
@kroitor gotcha, thanks!
By the way, great python lib!
@azharuniverse we're working hard to add a unified base method for it asap, expecting to see it in one of the coming releases.
Hello!
Is there something new with this problem?
I've sold on CEX market order with no problem but when I'm trying to buy market it says: "Invalid amount"
I tried with price and without and also made the .options['createMarketBuyOrderRequiresPrice'] = False
This is the order i sent:
order_1 = e.createOrder(symbol=['BTC/GBP'],
type='market',
side='buy',
amount=0.002,
price=2900.5)
The error Iv'e got:
Traceback (most recent call last):
File "<input>", line 5, in <module>
File "C:\Users\LENOVO\AppData\Local\Programs\Python\Python36\lib\site-packages\ccxt\cex.py", line 336, in create_order
response = self.privatePostPlaceOrderPair(self.extend(request, params))
File "C:\Users\LENOVO\AppData\Local\Programs\Python\Python36\lib\site-packages\ccxt\cex.py", line 499, in request
raise ExchangeError(self.id + ' ' + self.json(response))
ccxt.base.errors.ExchangeError: cex {"error":"There was an error while placing your order: Invalid amount","safe":true}
This is the order i sent:
order_1 = e.createOrder(symbol=['BTC/GBP'], type='market', side='buy', amount=0.002, price=2900.5)
This isn't a correct way to send the order, the symbol is not a list, actually...
We need you to paste some short snippet of code (5-20 lines) to reproduce it and also paste your verbose request/response without your keys, try following these guides as precisely as you possibly can:
# how you init the exchange...
e = ccxt.cex ({ ... }) # what's here (hide your keys)
print(ccxt.__version__) # what's the number
e.load_markets() # preload them just in case
e.verbose = True # set verbose mode on
order_1 = e.create_order('BTC/GBP', 'market', 'buy', 0.002, 2900.5)
print(order_1)
# ...
Sorry for the late response...
I'm using ccxt 1.18.11 in python 3.6 on CEX exchange.
The code for initiating the exchange object:
def initialize_exchange(exchange_id = 'cex', enableRateLimit = True):
## intiate the api class to send to the function
exchange_class = getattr(ccxt, exchange_id)
api_key = cexKey1['api_key']
api_secret = cexKey1['api_secret']
exchange = exchange_class({
'apiKey': api_key,
'secret': api_secret,
'uid': '',
'timeout': 30000,
'enableRateLimit': enableRateLimit,
})
return exchange
This is the code I executed:
e = initialize_exchange()
e.verbose = True
order_1 = e.createOrder(symbol='BTC/EUR',
type='market',
side='buy',
amount=0.002,
price=1)
The request and response:
Request:
POST https://cex.io/api/place_order/BTC/EUR/ {'Content-Type': 'application/x-www-form-urlencoded', 'User-Agent': 'python-requests/2.18.4', 'Accept-Encoding': 'gzip, deflate'} key=&signature=&nonce=1544551761766&type=buy&amount=0.002&order_type=market
Response:`
POST https://cex.io/api/place_order/BTC/EUR/ 200 {'Date': 'Tue, 11 Dec 2018 18:09:21 GMT', 'Content-Type': 'text/json', 'Transfer-Encoding': 'chunked', 'Connection': 'keep-alive', 'Set-Cookie': '__cfduid=db61998cb4fbd094c2fdf9ad98cf364ad1544551761; expires=Wed, 11-Dec-19 18:09:21 GMT; path=/; domain=.cex.io; HttpOnly', 'Content-Security-Policy-Report-Only': "default-src 'self';connect-src 'self' https://maps.googleapis.com https://cex.io wss://ws.cex.io/ws;frame-src 'self' * ext.cex.io;font-src 'self' data: 'unsafe-inline' https://fonts.googleapis.com https://fonts.gstatic.com;img-src 'self' data:;style-src 'self' 'unsafe-inline' https://*.googleapis.com https://code.jquery.com;script-src 'self' 'unsafe-inline' 'unsafe-eval';report-uri https://cex.io/cspr;", 'X-Frame-Options': 'DENY', 'Vary': 'Accept-Encoding', 'Expect-CT': 'max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"', 'Server': 'cloudflare', 'CF-RAY': '4879e6de0f8364ed-FRA'} {"error":"There was an error while placing your order: Invalid amount","safe":true}
`
I dont understand what is wrong...
thanks!
@ASAllon you have to account for all limits specific to that particular trading symbol, that is explained here:
First of, you have to understand the terms very precisely:
base
is the currency you're buying or selling (BTC
in your case)quote
is the currency you're buying or selling for (EUR
in your case)amount
– is the amount you're buying or selling, the amount is always in terms of base currency (0.002 BTC
)price
– is the price of 1 unit (or lot) of amount, the price is always in terms of quote currency (1 EUR
)cost
– is amount * price
, and it is always in terms of quote currency (also in EUR
)For market buys CEX requires the user to specify the total cost of the order, instead of the amount, therefore the user is asked for price
(that equals 1 in your case) to calculate the cost = amount * price
. That value is being sent out to CEX in your order as you can see from your verbose request/response. However, if you look carefully into the limits of the BTC/EUR
market for CEX, you will notice the following:
mbp:python igorkroitor$ python3
Python 3.6.2 (v3.6.2:5fd33b5926, Jul 16 2017, 20:11:06)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import ccxt
>>> from pprint import pprint
>>> exchange = ccxt.cex({'enableRateLimit': True})
>>> markets = exchange.load_markets()
>>> pprint(markets['BTC/EUR'])
{'base': 'BTC',
'fee_loaded': False,
'id': 'BTC/EUR',
'info': {'maxLotSize': 30,
'maxPrice': '35000',
'minLotSize': 0.002,
'minLotSizeS2': 20,
'minPrice': '1500',
'symbol1': 'BTC',
'symbol2': 'EUR'},
'limits': {'amount': {'max': 30, 'min': 0.002},
'cost': {'max': None, 'min': 20}, # ←------------------ min cost is 20
'price': {'max': 35000.0, 'min': 1500.0}},
'maker': 0.0016,
'percentage': True,
'precision': {'amount': 3, 'price': 0},
'quote': 'EUR',
'symbol': 'BTC/EUR',
'taker': 0.0025}
>>>
In your case, the values are:
In other words, the key to working efficiently with the exchange is to pay extreme attention to quite a lot of details. Let me know if that does not answer your question.
Thank for the detailed response!
I will try to implement those checks before sending the order hope it will work.
Great lib and very helpful community!
I tried again with cost greater than 20 EUR and still is say there is invalid amount.
code:
order_1 = e.createOrder(symbol='BTC/EUR',
type='market',
side='buy',
amount=0.0066,
price=3050)
Request: POST https://cex.io/api/place_order/BTC/EUR/ {'Content-Type': 'application/x-www-form-urlencoded', 'User-Agent': 'python-requests/2.18.4', 'Accept-Encoding': 'gzip, deflate'} key=&signature=&nonce=**&type=buy&amount=0.0066&order_type=market
Response: POST https://cex.io/api/place_order/BTC/EUR/ 200 {'Date': 'Tue, 11 Dec 2018 20:44:55 GMT', 'Content-Type': 'text/json', 'Transfer-Encoding': 'chunked', 'Connection': 'keep-alive', 'Set-Cookie': '__cfduid=*; expires=Wed, 11-Dec-19 20:44:53 GMT; path=/; domain=.cex.io; HttpOnly', 'Content-Security-Policy-Report-Only': "default-src 'self';connect-src 'self' https://maps.googleapis.com https://cex.io wss://ws.cex.io/ws;frame-src 'self' * ext.cex.io;font-src 'self' data: 'unsafe-inline' https://fonts.googleapis.com https://fonts.gstatic.com;img-src 'self' data:;style-src 'self' 'unsafe-inline' https://.googleapis.com https://code.jquery.com;script-src 'self' 'unsafe-inline' 'unsafe-eval';report-uri https://cex.io/cspr;", 'X-Frame-Options': 'DENY', 'Vary': 'Accept-Encoding', 'Expect-CT': 'max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"', 'Server': 'cloudflare', 'CF-RAY': '487acab11be264e7-FRA'} {"error":"There was an error while placing your order: Invalid amount","safe":true}
What is wrong now?
What is wrong now?
For some reason, it didn't get multiplied by the price and in the request it is still ...&amount=0.0066&...
where it should have been ...&amount=20.13&...
(0.0066 * 3050)
Are you sure that you're using version 1.18.11 ? I suggest that we verify the runtime version by running the following in your environment:
import ccxt
print(ccxt.__version__)
Unfortunately, pip doesn't always show the actual version, if you have multiple versions of python or something like that... If it shows 1.18+ in the runtime, then I will have to debug it further. What's your number?
I had executed and got:
print(ccxt.__version__)
1.18.11
@ASAllon did you execute it in the same environment that you're using for calling the create_order
?
Here's what I see with current version:
mbp:ccxt igorkroitor$ python examples/py/cli.py cex create_order BTC/EUR market buy 0.0066 3050 --verbose
('\nRequest:', 'POST', 'https://cex.io/api/place_order/BTC/EUR/', {'Content-Type': 'application/x-www-form-urlencoded', 'Accept-Encoding': 'gzip, deflate', 'User-Agent': 'python-requests/2.18.4'}, 'nonce=1544562371252&amount=20.13&order_type=market&key=EK6TaiS68n4rhfu4hEhb1Enkws&signature=50A91D8F135C51F3F3BD2AF4ED77A4979CC39DDE5C6AC140D81933D39411D5CE&type=buy')
'nonce=1544562371252&amount=20.13&order_type=market
↑ amount is 20.13 with this code:
import ccxt
from pprint import pprint
pprint('CCXT VERSION:', ccxt.__version__)
exchange = ccxt.cex({
'enableRateLimit': True, # required by the Manual
'apiKey': 'YOUR_API_KEY', # ←----------------------- put your credentials here
'secret': 'YOUR_SECRET',
})
exchange.load_markets()
exchange.verbose = True
order = exchange.create_order('BTC/EUR', 'market', 'buy', 0.0066, 3050)
pprint(order)
Is it still trying to send 0.0066 in the amount that way?
I had upgrades to version 1.18.21 and did the code as you said and it worked!
Thank you very much!!
again thank for all!!
keep the great work!
Most helpful comment
Thank for the detailed response!
I will try to implement those checks before sending the order hope it will work.
Great lib and very helpful community!