Hey QC community,
We are excited to announce the launch of cryptocurreny backtesting and live trading on QuantConnect! We’ve partnered with GDAX to support their cryptocurrency exchange. Using your GDAX account, your algorithms can now trade BTC, LTC and ETH currency pairs. Huge thanks to our community members who helped make Lean ready for crypto. In this post, I’ll demonstrate backtesting a cryptocurrency trading algorithm using python and describe how you can get started live trading cryptocurrencies with GDAX.
Attached is a simple backtest that demonstrates subscribing to BTCUSD hourly data and placing an BTCUSD market order. Initially, QuantConnect is offering a limited set of GDAX quote data for BTCUSD for backtesting, however, users can expect our crypto data library to grow soon. Clone the backtest below to start building your crypto trading algorithms.
In order to get your algorithm live trading, sign up for a GDAX account here: https://www.gdax.com/ . To live trade, you’ll need an api key, api secret and api passcode. To get this information, login to your GDAX account and click API from the menu in the top right corner. Create a new API key that has permissions to ‘view’ and ‘trade’ and be sure to record the api key, api secret and api passcode. You now have all the information needed to launch your live crypto-trading algorithm! Simply click ‘Go Live’ from your algorithm and follow the wizard. Be sure to select Gdax as your brokerage.
Prescott
What is the GDAX fee model assumption in backtesting and live paper trading? Is it 0.25% for market orders? Are they different in live vs backtesting?
Jonathan Andre
+1 on the eventual adding of Bitfinex.
Liquidgenius
+1 on adding Binance.com
Sean O'Gorman
I've only spent minimal time playing with QC (I live traded with Quantopian, then discovered crypto after Robinhood integration was killed off), but I'd become a paying customer if Binance was added.
Rasheduzzaman hridoy
Another crypto exchange would be great!
Ted Smith
During live trading on GDAX my algo will execute both buy and sell orders. Yet, eventually, I will get this error in the log:
Unable to submit order with id -10 that has zero quantity.
and this log will repeat on every trade attempt until i stop the live trading. Yet, both the QC platform and GDAX show I'm still holding a long position. Does anyone know why it's showing zero quantity? Does liquidate() automatically update my portfolio with zero quantity even if it hasn't actually sold my long position on the exchange? I ask this question because it doesn't make sense to me why it would be submitting zero quantity in the liquidate() command even after the QC dashboard shows I'm holding a position and this is also confirmed in GDAX. At this point, I'm just grasping at straws, but I'm assuming SetHoldings() and Liquidate() both update the portfolio to it's respective quantity regardless of if the trade was actually executed. Is this the case?
I've seen various posts in the QC community to address latency issues, but is there a general concensous on which method works best?
Jared Broad
Ted Smith discussed in this thread -
The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.
Ted Smith
Would this:
SetHoldings(Symbol, 1);
verus:
SetHoldings(Symbol, 1.0);
be the cause of the log error:
Unable to submit order with id -10 that has zero quantity.
Amit kaushik
Is there any progress on adding another exchange? When do you think it will be ready?
Samuel Cutler
Hi everyone Im very new to coding, but been in the trading game awhile, I am trying to deploy an algo live on GDAX but the only error im getting is a failure to get cash balance for GDAX brokerage, does anyone have any adivce for me?
Ben Newsom
COBINHOOD, take a look for a possible broker, low volume which is actually good for trade execution, ZERO fees with an extremely similar API, Please Take A Look
Ak129301
Jared Broad any plans to add kraken for shorting?
Ethan Scott
Sorry, a noob here at coding.
Could someone explain this code to me
Filip La Gre
Can be in perl?:)
Donkey Trader
Would be nice to see Bitfinex, Binance, Kraken or other crypto exchanges to QuantConnect
Gdax unfortunately has also several country restrictions.
Any plans?
Jared Broad
Lots of plans Donkey! There are several open-source projects in the works now =) Brokerages are really hard but viliwonka is making some great progress. His team is working on Kraken and Binance. Bitfinex has stagnated after their USDT concerns. The branch could use some work.
The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.
Warren Harding
+1 for Binance. They trade a fair bit of volume compared to the other exchanges and they have lots of altcoins. Data for backtesting is crucial. Their Kline API call isn't going to get the job done so someone will likely have to cut a deal with them to get their historical data. Complete order book histories would be very nice....
Tim Dierckxsens
+1 binance, bitfinex and huobi
Jonathan Andre
+1 Binance, Bitfinex and Huobi. Maybe as a stretch goal some consideration can be given to Bitmex. It is the largest exchange by volume, has the highest available leverage and supports websocket (for live pricing).
Arvind Sharma
Yeah true !!
Andrew Hart
The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.
To unlock posting to the community forums please complete at least 30% of Boot Camp.
You can continue your Boot Camp training progress from the terminal. We hope to see you in the community soon!