How I deposited cash into Bitcoin into Binance with a cash video playback. Bitcoin went up $1000 over the last 24 hours!! Details of the ccxt Python package is below:
To enable API, you login to follow these instructions but understand working with unknown code from Binance crypto currency exchange. Realize that this is not an easy process like Coinbase. This is confirmation is not as slick as other brokers/exchanges I have worked with.
Sending order to Binance exchange with Python CCXT package
To enable API, you login to follow these instructions but understand working with unknown code from Binance crypto currency exchange. Realize that this is not an easy process like Coinbase. This is confirmation is not as slick as other brokers/exchanges I have worked with.
Do understand this account is unfunded so it does confirm to work when you enter the correct API and secret keys. If the secret or API keys were incorrect, you will get this exceptions:
File “/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/ccxt/binance.py”, line 834, in handle_errors raise ExchangeError(self.id + ‘: unknown error code: ‘ + body + ‘ ‘ + error) ccxt.base.errors.ExchangeError: binance: unknown error code: {“code”:-1022,”msg”:”Signature for this request is not valid.”} -1022
Here is an ongoing dialogue with my most helpful dialogue PRIVATE Telegram group:
for anyone with Binance API experience. I am using this example with binance for CCXT https://github.com/ccxt/ccxt/issues/2552
Some coding examples
It seems to login ok with the proper API keys. I test a fake one which resulted as an error as expected. When I try set up these coding parameters with:
symbol = ‘XZC/BNB’
#symbol = ‘BCH/BNB’
type = ‘limit’ # or ‘market’
side = ‘buy’ # or ‘buy’
amount = 1.0
price = 1.302 #0.060154 # or None
# extra params and overrides if needed
params = {
‘test’: True, # test if it’s valid, but don’t actually place it
}
order = exchange.create_order(symbol, ‘limit’, side, amount, price, params)
My test account has a Bitcoin balance of 0.00176200. Do I need to choose another pair with a lower value? Do I need to only use a crypto currency pair with BTC not BNB?
Thanks
also, i tried this code:
symbol = ‘XLM/BTC’
#symbol = ‘XZC/BNB’
#symbol = ‘BCH/BNB’
type = ‘limit’ # or ‘market’
side = ‘buy’ # or ‘buy’
amount = 1.0
#price = 1.302 #0.060154 # or None
price =0.00003550
but now get response of: ccxt.base.errors.InvalidOrder: binance {“code”:-1013,”msg”:”Filter failure: MIN_NOTIONAL”}
any pointers?
—–
MIN_NOTIONAL hints at your account not having enough capital/margin for the transaction. Have you verified this?
I’d suggest you try a transaction with an amount of 0.01 or something like that ← tried this but it did not correct the problem
For the currency question based on the pair:
Yes, in this case you need BNB in order to convert it to XZC. So you would first have to convert your BTC to BNB using the BNB/BTC pair.
…Yes, it sounds like you’re hitting a minimum order size restriction. Don’t forget that order sizes are denominated in the base currency of the pair (XLM in this case). One XLM is only worth 27c, so try increasing the order size to 10, or 50 or something like that.
It looks the like the minimum order size on Binance is 0.002 BTC, so try an order size greater than 55 or 60.
Source code updates compared to a few weeks
I also got this CCXT exception:
ccxt.base.errors.ExchangeNotAvailable: binance POST https://www.binance.com/api/v1/order 400 Bad Request {“code”:-1104,”msg”:”Not all sent parameters were read; read ‘8’ parameter(s) but was sent ‘9’.”}
But here is the latest source code sample:
import ccxt
exchange = ccxt.binance({
‘apiKey’: , ## these appear to work with valid keys
‘secret’: ,
‘enableRateLimit’: True,
})
symbol = ‘XLM/BTC’
#symbol = ‘XZC/BNB’
#symbol = ‘BCH/BNB’
typ = ‘limit’ # or ‘market’
side = ‘buy’ # or ‘buy’
amount = 55 #1.0 tried 0.1 but not balid
#price = 1.302 #0.060154 # or None
price =0.00003550
# extra params and overrides if needed
#removed because of this exception
#ccxt.base.errors.ExchangeNotAvailable: binance POST https://www.binance.com/api/v1/order 400 Bad Request {“code”:-1104,”msg”:”Not all sent parameters were read; read ‘8’ parameter(s) but was sent ‘9’.”}
# File “testBinanceOrder.py”, line 26, in <module>
# order = exchange.create_order(symbol, ‘limit’, side, amount, price, params)
# NameError: name ‘params’ is not defined
params = {
‘test’: True # test if it’s valid, but don’t actually place it
}
order = exchange.create_order(symbol, typ, side, amount, price, params)
print(order)
note the new exception of Not all sent parameters were read; read ‘8’ parameter(s) but was sent ‘9’.”
i am sending a total of 9 of but what am I supposed to eliminate? i tired the extra params but that did not help
I finally got something working with this https://github.com/ccxt/ccxt/issues/298
Lessons learned about CCXT Python package for 3 largest crypto exchanges Bitmex Binance OKex
Please be advised
Using CCXT with a recent script I sourced to download generically from various exchanges is powerful. I have thought come across some severe limitations in the process.
Binance appears to be the most reliable since you have the widest selection of timeframes you can use. Also, you can download up to 1000 rows into a comma separated value file as well.
Both Bitmex and OKEx offer some form downloading limit of 500 which really messes up my analytical Python script. When downloading, you can only seem to have a limit of 400 to just under 500. This seems to work only work for lower time frames like 1 or 5 minutes. As the timeframe selection is very limited compared to Binance.
I am unsure of other crypto currency exchanges what limitations offer but I will stick with Binance for now as the only exchange of interest. It seems that the others offer much lower daily volume which means slower fills due to lower liquidity. Also the other exchanges have weird download exceptions which also means the charting will not work as well.
Further note about Bitfinix
I just execute 5 request no different than Binance, Bitfinex starts thinking it is being attacked where it responds:
Double your trading opportunity just from 1 correction !
I have corrected this big as hinted in this Youtube content listed below. . Please find I am now able to double my opportunity of trades just from this simple correction. This goes in hand with my evolving Automated Head and Shoulder indicator.
This has a huge benefit if you are into building scanners for crypto currency. Also, remember I did not fund any of these exchanges but always remember to be on guard with your data with exchanges you may not trust. This will help in my automated head and shoulders demo I will have tomorrow night. Get details below.
I would like to do algo trading in india for nse exchange using zerodha kite connect api, is it possible to do using jstock, as i see only analysis is done but to buy or sell
in an automated way for nse exchanges is it possible or can you recommend some opensource software for this algo trading, i am a good programmer can do coding in
Automated head and shoulders webinar on tomorrow night
Details here
Hi there,
You are invited to a Zoom webinar.
When: May 23, 2018 7:00 AM Eastern Time (US and Canada)
Topic: Automated head and shoulders webinar demo
Please click the link below to join the webinar:
https://zoom.us/j/255491924
Or iPhone one-tap :
US: +16465588656,,255491924# or +16699006833,,255491924#
Or Telephone:
Dial(for higher quality, dial a number based on your current location):
US: +1 646 558 8656 or +1 669 900 6833
Webinar ID: 255 491 924
International numbers available: https://zoom.us/u/fnY7djwr
Demo to download hundreds of crypto currency pairs via CCXT Python package from Binance Bitmex OKEx exchanges
The advantages
This has a huge benefit if you are into building scanners. Also, remember I did not fund any of these exchanges but always remember to be on guard with your data with exchanges you may not trust.
I would like to do algo trading in india for nse exchange using zerodha kite connect api, is it possible to do using jstock, as i see only analysis is done but to buy or sell
in an automated way for nse exchanges is it possible or can you recommend some opensource software for this algo trading, i am a good programmer can do coding in
any language.
Thanks,
Shailes
Hi,
A friend refer me to your site.
I’m on the way researching some way could we adapt in binary options trading with consistant result. Just ask if something of your works could help me with that?
I’m reading from you now.
Thanks Anh Vu
I want to mention – that i for sure like your “style” of email communication. I’m not rich with eloquent english, and in simple words – not formal (straight, strict), cosy (comfy), unusual in a good way for me. As the result – i am not just reading all content of your emails, i also answer or even go to the survey page ))
And i hope that your are real, not some advanced AI/ML tech, which were made at Quantlabs )))
I cant see the results, at least the new one – latest is in youtube format , dated 12 apr )
I have a pattern kind of like head and shoulders but not commonly known which I use to trade by hand. I have tried to automate it using Gekko and tradingview, and Gekko kept bugging out, and it works on tradingview but I use a chrome plugin called autoview to automate it and that bugs out as bad as gekko. It just randomly doesn’t trade sometimes or just messes up a lot. Could you possibly do a video on how to automate our own pattern using ccxt?
Bryan , let me tell a few words about my aims at the moment.
Specializing in IT security with 5+ years in web development experience, having a strong computer background i’ve been recently asked by my boss to dig into trading strategies implementations and backtesting ( the man who worked on that – left our company).
I can refuse him with no consequences on salary , etc… and we all do what we want to do, so i have and interest for trading and markets, got little basic self education in this area, improved finance and economy english words knowledge. I was fine with switching to trading strategy analysis… cause its also includes programming.
We have a little fund, and we rely on trend following in common. So the legacy i got from the man who worked and was kinda experienced in the field are Wealth-Lab and few strategies.
CSI UA is for futures historical data, and as i know yahoo is for stocks. Daily trading – meaning that we rely on the data for the day, not intraday…
Our trader guy is follow this strategies and manually make all trades. Portfolio – is futures and CFD’s .
So i started to go deeper only few weeks ago, looked at wealth lab scripts which is in C# which i consider good language, and my fav is Python )
And these scripts appears to be a mess… it’s really f-ud up for me as a programmer)
So me research into this area showed that first of all – the Wealth Lab “for loop” approach while testing strategy is have far more cons than pros. Event-driven model is far more real, and convenient.
made by Andreas Clenow, later he became my “mentor” in this area, i like his approach, found his articles or posts in a lots of places, he is likes or loves coding, RightEdge uses C#, but he also improves himself at Python and lots of programming stuff.
I also discovered https://www.quantconnect.com/ , quantopian – more as a knowledge base platforms, than actual trading or backtesting.
Took a look at software analogues of WealthLab (which for me was a bit of fail) , i stopped at RightEdge which is relatively cheap, and has a real full blown C# support (i think they us GUI parts from Visual Studio), the other choice i may ask for could be OpenQuant 2014, but it’s 10 times more expensive ) about 4K $ per year… I think for starting and for moving from shitty WealthLab – RightEdge is right )
Then the common strategy principles are pretty simple – few price channel indicators, and ATR. So as i understood thats called volatility breakout, or pricechannel breakout strategies.
It was added with some additional logic by the guy before, and cause of his shitty code i hardly grasp it yet…
That`s called systematic trading ? for sure not algotrading….
Getting deeper into topic i met few researches, one was huge – that statistically tech analysis tools (trend following ) even with proper backtesting, etc in our times… have no evidence as profitable (and yes i know thats a strategy for at least 3 years to wait ).
Compared to this recent strategies which are based on tech analysis plus AI/ML (based on some fundamental data and tech data as i recall) were statistically significant.
summary of all long text:
now i have just basic understanding of implementing trading strategy and backtesting it, appeared there are much much more specifics are need to be done (like proper risk management), and i moving that way slowly, but deeply )
In the nearest future i think we should implement automatic algotrading (at least on some part of equity and instruments), and then for sure i see positive side to use AI/ML and fundamental data in complex approach…
Now i have a lot of beginners questions… as for python, statistics, probability theory, patterns – i would like to join your lecture/lesson – depends on a local time. I will check!
Well, much obliged for reading this far )))
anyway will be in touch, its morning already here )))
Yuri
——
NOTE I now post myTRADING ALERTS into my personal FACEBOOK ACCOUNT and TWITTER. Don't worry as I don't post stupid cat videos or what I eat!
Easy Python script to download crypto currency market data with CCXT package
Here is a FREE fast tutorial
This is a quick and dirty script to show you how to download crypto currency market data from Binance and Bittrex! This works with no fund nor registration on the exchange!
Which Bitcoin crypto currency bot project? Gekko vs ccxt vs Tribeca vs Blackbird
This is so confusing but I lay it on the line with this query
We met sometime in the distant past, and we’re LinkedIn. Anyways, I was learning about crypto trading bots on YouTube and came across your videos. I was excited to see you’ve been checking out ccxt and gekko. I’m looking to experiment with arbitrage using automated software. I need to learn a lot… about a lot. First, I want to pick a tool and start looking at data. Where are you at with these and which would you recommend. I don’t know either JavaScript or Python so with would be fun to pick up.
The update is I am looking at CCXT Python package as well. This will be my next step once I get through my historical back test with my current strategy, This is where I will test how it forecast the correct instruments for max potential return. This will be long and involved process but I will reveal the results once I complete this testing process!
Thanks Bryan
NOTE I now post myTRADING ALERTS into my personal FACEBOOK ACCOUNT and TWITTER. Don't worry as I don't post stupid cat videos or what I eat!