Hello,
I just released a brand new video in my free algorithmic trading course in which I show how you can use Python and QuantConnect to develop trading algorithms. In my newest video lesson, you can learn everything you need to know about developing crypto trading bots inside of QuantConnect. If you haven't already, make sure to check it out.
You can copy the code from that video using the “Clone Algorithm” button on the backtest below.
If you're new to QuantConnect or my video series, I recommend starting from the beginning.
Don't hesitate to ask questions or leave a comment.
Cheers,
Louis
AlMoJo
Hi
Thanks for the initiative.
Please do you know if shorting on futures can be done with QC on Bitfinex ?
Cheers!
Varad Kabade
Hi Ya1,
QuantConnect/Lean does not support crypto-currency futures with Bitfinex or any other crypto-currency brokerage yet. Please check out the supported security types on the docs.
Best,
Varad Kabade
Andreas Dekrout
Hi Louis!
As always your video is helpful and to the point.
I did some minor tweaks on the code, swapped daily resolution for hourly (to speed things up) and used wilr instead of the rsi (just for fun).
I then let it run live on a small sub account of mine on bitfinex. Not for profit, but to see if it would work and place orders as expected and to see if bitfinex and qc work together.
After one night, it placed market buy orders for three crypto-usd pairs.
And one market sell order.
Here it get´s weird, or I don´t get it, anyway, it seems that the algorithm is not getting the “holdings” from the exchange, but rather calculating them from what orders it thinks were executed. within one night it is off significantly from the balances on the exchange.
Andreas Dekrout
edit / update:
it seems as there are some things to consider when live trading on crypto exchanges (in this case bitfinex).
The algorithm from above now shows a negative btc balance while ignoring an existing xmr balance. Something that is simply impossible on a spot trading account.
Maybe somebody has experience with live instances on bitfinex and would like to give advice?
qc live instance:
bitfinex:
Varad Kabade
Hi Andreas Dekrout,
For issues regarding live trading, please get in touch with support@quantconnect.com.
Best,
Varad Kabade
AlMoJo
Hi
I changed my username since last time (Ya1). Please do you know if QC allows trading crypto CFD on OANDA or FXCM like any other CFD on these mainstream forex exchanges?
Thanks
Marcel Friz
Hi,
is there a easy possibility for this algorithm to plot the RSI Indicator for all symbols in one chart?
Thanks and best regards
Marcel
Marcel Friz
Hi again :)
Attached you find my backtest for now.
So how can I can I plot the rsi, rsiema, band1 and band2 for the 3 tickers in one chart?
The second question may be a bit easier, but how can I log the self.pairs values, which should contain the 3 tickers?
Thanks for your help everyone :)
Best regards
Marcel
Andreas Dekrout
Hi Marcel,
concerning the plotting you might want to loop over the symbols in onData just like in Louis code above (for pair in self.pairs: ….). The same goes for Logging those values.But practically you will very soon run into the 400 max datapoints limit for plotting and/or the max 10 series per backtest limit. Also there are limits on logging, depending on your subscription.best regards,Andreas.
Marcel Friz
Hi Andreas, Thanks for your feedback. Since I'm still relatively at the beginning, I wanted to check with the graphics whether I got the correct values that I would like to have. I can now draw the graphic, thanks for your help! Unfortunately I can only display it individually, do you have an idea how to put everything into one graphic for the 3 coins BTC, LTC and ETH? I deliberately only selected 3 coins, here I should be able to work with them without the limitations, if necessary I'll only use 2 or 1 coin :) Thanks! best regards Marcel
Varad Kabade
Hi AlMoJo,
We do not support crypto cfds.
Best,
Varad Kabade
Andreas Dekrout
Hi Marcel!
When Plotting the first argument is the chart you are plotting to, the second argument the name of the series and the third argument is the value to plot.
In your case I would suggest using something like
Marcel Friz
Hi Andreas,
Thanks, that really helped me!
Marcel
Francesco Baldisserri
Hi,
Do you know if there is any plan to add more crypto pairs to CoinBase? Currently only 9 pairs are supported.
Thanks
Andreas Dekrout
Hi Francesco!For a full list of pairs available on coinbase you might want to take a look at the discussion at:
and the full list of supported pairs for gdax (aka coinbase) in the csv posted in that discussion (seems, I cant post the link to the csv here).Anyways, there should be 101 pairs available to trade via qc.
Francesco Baldisserri
Thanks a lot Andreas!
I was not aware of this post and I kept referring to the documentation. Glad I asked!
Santa24
Some caveats for live trading:
Brian Colliflower
On an algorithm like this would there be away to set a moving stop lose incase of market crash such as
then update the stop loss if price is increasing such as
would you have to hold an array of invested symbols with stoploss and current price or is there a built in function to do this? I was thinking in the crypto space putting a stop loss at 5% might catch some of the volatility that comes with crypto.
also at what resolution is this running? I notice we are not setting one.
Varad Kabade
Hi Brian Colliflower,
We can store the stop-loss tickets in a dictionary keyed by the Symbol object. We recommend going through the following bootcamp lesson for more information. Please note that if we do not specify the resolution it is set to the default which is Minute.
Best,
Varad Kabade
.ekz.
Santa24 : thanks for sharing the code on custom liquidation. I've just run into this rounding error in my live algo.
I tried the code you shared above, and in my backtests, it's not quite working as expected – it leaves tiny amounts in my cashbook (eg like 0.00001), which messes up my logic (my algo still sees that we are ‘invested’ so it doesn't take any new positions).
I resolved it by removing any checks for lot size and notional amount.
Did you run into any similar issues? Where this custom liquidation doesn't completely empty the account of the specified symbol?
Louis
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!