Introduction to BACKTRADER [Backtesting Trading Strategies Library for Python]

  Рет қаралды 59,028

Algovibes

Algovibes

Күн бұрын

Пікірлер: 147
@Algovibes
@Algovibes 2 жыл бұрын
Hi everyone, If you are interested how to build a more sophisticated Trading Strategy implementing a SMA/BB/RSI Trading Strategy with Buy Limit orders and a holding perios, check out my newest video here: kzbin.info/www/bejne/b4PJd36MZciSq5o
@hannes6116
@hannes6116 2 жыл бұрын
Sehr cool. Wollte es mir schon ansehen. Umso cooler, dass Du es hier vorstellst
@Algovibes
@Algovibes 2 жыл бұрын
Nice, danke für deinen Kommentar :-)
@JohnnyQuestFishing
@JohnnyQuestFishing 9 ай бұрын
Thank you so much for this video. It really gets me started quickly on Backtrader. I have a couple of strategies I wanted to plug in, but did not want to put them in the cloud because I am going to sell them later. Again, thanks for the Backtrader intro.
@Algovibes
@Algovibes 8 ай бұрын
Very welcome mate, thanks for dropping a comment!
@sandunga666
@sandunga666 2 жыл бұрын
This was amazing, thanks for share and explain it. I was getting crazy thinking in my backtests developments and this tool make it simple. Thank you again! Greatings from Argentina!
@Algovibes
@Algovibes 2 жыл бұрын
Thanks for watching man and best regards to Argentina 🇦🇷
@davidbristoll195
@davidbristoll195 Жыл бұрын
Thanks for creating this video. It's been a really helpful intro and has got me into a position where I can understand the code and even create and test some of my own basic strategies.
@ajayramprasad6457
@ajayramprasad6457 2 жыл бұрын
Good video. I have been trying to use backtrader. This video cleared few of my questions. I am waiting to see to test your strategies with this library especially STOCH, MACD, RSI
@Algovibes
@Algovibes 2 жыл бұрын
Thanks man, happy to read. Also thanks a lot for the suggestion!
@sweealamak628
@sweealamak628 2 жыл бұрын
That's the great thing about Python. There are so many libraries out there that make our lives easier. 👍
@Algovibes
@Algovibes 2 жыл бұрын
Agreed. Preferring doing it from scratch tho :-)
@sweealamak628
@sweealamak628 2 жыл бұрын
@@Algovibes 😅 makes you a better programmer that way.
@amitbuch
@amitbuch 2 жыл бұрын
Very precise and targetted introduction of the main features with good examples that once can immediately implement. Thanks. I enjoyed your style of nerration, length of content and depth of coverage,
@Algovibes
@Algovibes 2 жыл бұрын
Thanks a lot Amit for your feedback. Very happy that you enjoyed it!
@ふらちゃん-y6i
@ふらちゃん-y6i 2 жыл бұрын
Hello Algovibes! Thank you so much for providing a backtester solution (that I was asking for in one of my comment to your previous video)! In the meantime, I didn't give up and made a event-driven itertuple iteration back testing code that is working mostly fine. Still very interesting to see how you are doing it and learning everytime a lot from your videos!
@Algovibes
@Algovibes 2 жыл бұрын
Awesome man. Thanks a lot for your kind words.
@chigstardan7285
@chigstardan7285 2 жыл бұрын
I'm so happy you made this video! Can't wait to see a more advanced tutorial for this, Maybe a macd stoch rsi strategy?
@Algovibes
@Algovibes 2 жыл бұрын
Happy you like it! Thanks for the suggestion :-)
@BOSprodz
@BOSprodz 2 жыл бұрын
Can't wait to watch! Best channel ever
@Algovibes
@Algovibes 2 жыл бұрын
Thanks buddy ❤️
@rajeevmenon1975
@rajeevmenon1975 2 жыл бұрын
Happy to see you with BackTrader. Cool stuff as always. Pray to God that you are always healthy & peaceful to release such great contents. Would be great if I can know your name so as to address you correctly
@Algovibes
@Algovibes 2 жыл бұрын
Thanks buddy for your kind words :-)
@pranjalchaubey
@pranjalchaubey 2 жыл бұрын
Please looking forward to more videos on Backtrader, specifically some price pattern strategy where distance between consecutive candles is not fixed. For example, "going long only at the second inverted hammer formed after a bullish EMA cross"
@kondor7
@kondor7 2 жыл бұрын
I discovered Backtrader recently , would be happy to have more videos about it with some logics
@Algovibes
@Algovibes 2 жыл бұрын
Thanks for your feedback!
@EpicChivers
@EpicChivers 2 жыл бұрын
Love the videos, very informative and structured in a way that makes the process easy to follow. I see your focus to date has been primarily in the technical indicator side of things, but I'd be super interested to see your views on value investing automation.
@Algovibes
@Algovibes 2 жыл бұрын
Thank you my man. Appreciate your feedback! Do you have something specific regarding value investing in mind?
@EpicChivers
@EpicChivers 2 жыл бұрын
@@Algovibes I'd be interested in seeing something that automates the security analysis of companies. This would provide you with a pool of stock picks which you could then go on to invest in via one of the strategies you have previously outlined, or to create an automated value-based portfolio.
@pietraderdetective8953
@pietraderdetective8953 2 жыл бұрын
Yes please! automation based on value investing criterions would be super interesting! Maybe start with the most commonly used value investing criteria? That in my opinion would be one of these: PER, EV/EBITDA, PBV Then compare between the valuation ratios vs the industry's average --> the output from this: we get which stocks are undervalued compared to its industry. Last step would be to backtest if we buy undervalued stocks and see what's the returns for this value investing strategy.
@olivierdefosse5956
@olivierdefosse5956 2 жыл бұрын
Hooooo God Alfovibes, I even get up at night to listen to your divine light, enlightening us all with your investigations and your divine reflections Keep showing us the way We beg you! :-)
@Algovibes
@Algovibes 2 жыл бұрын
😀 Thanks for your support man!
@stalepalemale
@stalepalemale 2 жыл бұрын
Very good video, would love to see some more in depth stuff
@Algovibes
@Algovibes 2 жыл бұрын
Thx a lot Gary!
@moondevonyt
@moondevonyt 2 жыл бұрын
so happy i found this video. i was thinking of making something similar. maybe i will to cover a few things missed
@moondevonyt
@moondevonyt 2 жыл бұрын
ill try to add some custom strategies too, i think that will be useful
@Algovibes
@Algovibes 2 жыл бұрын
Sure man, good luck! 🍀
@print3d344
@print3d344 2 жыл бұрын
So excited video thankful for you buddy
@Algovibes
@Algovibes 2 жыл бұрын
Thanks a ton for your support :-)
@blakeramsey3373
@blakeramsey3373 7 ай бұрын
Very well made and explained
@Algovibes
@Algovibes 7 ай бұрын
thank you mate, appreciate your comment
@damianwysokinski3285
@damianwysokinski3285 2 жыл бұрын
Is it possible to plot the trading graph on frontend like Angular or Reacts? I mean if the backtrader can return needed data and for exaple use Plotly to plot it from angular?
@aymn-.-3398
@aymn-.-3398 2 жыл бұрын
thats what i was wondering , let me know if you find out.
@damianwysokinski3285
@damianwysokinski3285 2 жыл бұрын
@@aymn-.-3398 okay
@vinnyvidivici5930
@vinnyvidivici5930 2 жыл бұрын
what screen is that at :38 in the video? i'm trying to import backtest into python and i don't know what screen that is that you're using. thank you
@bhoyt4530
@bhoyt4530 Жыл бұрын
Do you have any videos explaining how to take this one more step to set a broker for live trading? Mostly interested in connecting to Binance.
@Algovibes
@Algovibes Жыл бұрын
Yessir!
@alihobballah
@alihobballah Жыл бұрын
having spent one month on zipline, i decided to use another friendly backtesting library.. what would be yoru second pick after Zipline? Something with a big community and lots of documentation .. Zipline is just to hard to use .. with gratitude
@Algovibes
@Algovibes Жыл бұрын
Sorry for my late reply ali. My preferred way of Backtesting is doing it from scratch :-)
@lambolin600
@lambolin600 2 жыл бұрын
is it possible to test multiple symbols plus multiple timeframes? like every time any of the 500 stocks out of the sp500 rsi(Daily) went < 30, we want to open one(only one until the next stocks rsi turns < 30) trade on the m15 timeframe if the sma50(m15) crosses the sma200(m15)?
@Algovibes
@Algovibes 2 жыл бұрын
Thanks for watching man! Sure, that's possible. I wouldn't do it with BT tho if I wanted to do that.
@luketyler1875
@luketyler1875 2 жыл бұрын
Hi, awesome tutorial big fan of the videos. I'd really like to see you use backtesting your previous stochastic, RSI and MACD strategy
@Algovibes
@Algovibes 2 жыл бұрын
Thanks a lot Luke, great to read!
@ryantao6015
@ryantao6015 2 жыл бұрын
I use VSCode and just followed the quickstart; however, the third step doesn't work and gives multiple file errors. What did I do wrong?
@Algovibes
@Algovibes 2 жыл бұрын
Can you elaborate?
@AlexanderLetetski
@AlexanderLetetski Жыл бұрын
which browser yure using? in your point of view this one is best pip lib? thanks
@Bobbycarrot83
@Bobbycarrot83 9 ай бұрын
Super video! Quick question though, my cerebro plot doesnt show and I have the exact same code with %matplotlib inline. Could you help? =)
@Algovibes
@Algovibes 9 ай бұрын
Thx mate. I had to downgrade matplotlib as far as I remember. Maybe you give that a shot. cheers!
@PavelSumik
@PavelSumik 2 жыл бұрын
perfect video as always, thank you much
@Algovibes
@Algovibes 2 жыл бұрын
Thanks a lot Pavel. Appreciate your support.
@JomanSofly
@JomanSofly 2 жыл бұрын
Can i ask how to use cerebro.plot in pycharm ? it seems to only work on Jupyter notebook ??
@Algovibes
@Algovibes 2 жыл бұрын
Should be working similarly but with an external plot (window with the plot popping up)
@SmithVestors
@SmithVestors 2 жыл бұрын
Great video! Thanks for sharing
@Algovibes
@Algovibes 2 жыл бұрын
Thanks for watching man :-)
@mastercrypto9587
@mastercrypto9587 2 жыл бұрын
hi. you are amazing. could you please write a code for kucoin with websocket and RSI STOCH and MACD? i could not implement kucoin websocket to dataframe. i am very new in python thanks bro
@calvinglover752
@calvinglover752 2 жыл бұрын
My code executes without error but won't stop running. I have to kill it with taskmaster(windows). Any ideas?
@Algovibes
@Algovibes 2 жыл бұрын
Which IDE/environment are you using?
@its_code
@its_code 2 жыл бұрын
Amazing 😍 bro. Really amazing 😍😄😃. Love 💕 from Pakistan ❤️❤️
@Algovibes
@Algovibes 2 жыл бұрын
Love to 🇵🇰 ❤️ Thanks for your support!
@its_code
@its_code 2 жыл бұрын
@@Algovibes ❤️😍😘🤩💕💕😊 thanks 👍💕
@thomas2004ch
@thomas2004ch Жыл бұрын
What Python version is supported?
@ahmetbinatlioglu8848
@ahmetbinatlioglu8848 2 жыл бұрын
Love your work bro
@Algovibes
@Algovibes 2 жыл бұрын
❤️ thanks
@sheps5656
@sheps5656 2 жыл бұрын
I'd like to see you add a Forex currency pair or two into the tests to round out markets the strategies are tested on. Crypto, stock, currencies. EURUSD makes sense.
@Algovibes
@Algovibes 2 жыл бұрын
Thanks a lot for your suggestion!
@daniele9986
@daniele9986 2 жыл бұрын
Great content thanks!!! It would be great if you could backtest your STOCH MACD RSI strategy with Cryptos (BTC and ETH) which I believe is one of the best you have published. Thanks again for sharing.
@Algovibes
@Algovibes 2 жыл бұрын
Thanks for your comment man. That would be indeed interesting to check out! Noted it.
@carlocarnevali7790
@carlocarnevali7790 2 жыл бұрын
@@Algovibes I'm following! It'd be very useful
@noiseforthealgorithm4668
@noiseforthealgorithm4668 8 ай бұрын
i'm completely new to algo trading and coding. Can you test an intraday strategy on Backtrader?
@Algovibes
@Algovibes 8 ай бұрын
Hi mate, already did on one of my videos. Be sure to check out the ones in the Python for Finance playlist. Cheers!
@noiseforthealgorithm4668
@noiseforthealgorithm4668 8 ай бұрын
@@Algovibes ok thanks!
@yigityilmaz2786
@yigityilmaz2786 2 жыл бұрын
My kernel dies every time at cerebro.plot(). Our codes are totaly the same. I'm using Jupyter Notebook on macbook pro'17. I would really appreciate if you can help/ direct me with the solution. Thanks for the video!
@Algovibes
@Algovibes 2 жыл бұрын
Hi Yigit, did you add the matplotlib inline line as I mentioned in the beginning?
@yigityilmaz2786
@yigityilmaz2786 2 жыл бұрын
@@Algovibes yes I did. Our codes are totally the same. Do u know any possible solutions or causes to this issue? Thanks for your reply
@sokolnushi2149
@sokolnushi2149 Жыл бұрын
Can the same be done in VSCODE
@Algovibes
@Algovibes Жыл бұрын
Sure!
@linas1211
@linas1211 Жыл бұрын
does this library work for 3min timeframe or 1h timeframe?
@Algovibes
@Algovibes Жыл бұрын
Yes, it should
@markfreeman3287
@markfreeman3287 2 жыл бұрын
Is it possible to get intraday data and test this back testing on it?
@Algovibes
@Algovibes 2 жыл бұрын
Sure, also possible. You could e.g. use the Binance API or just take the 1m interval from yfinance. Binance API -> Just check out some videos in my cryptobot playlist
@antonioluchinger8115
@antonioluchinger8115 2 жыл бұрын
Hello, i would like to contact for a privatd coding service if is posible. Thanks
@marcogelsomini7655
@marcogelsomini7655 2 жыл бұрын
series on BT would be appreciated!
@Algovibes
@Algovibes 2 жыл бұрын
Cannot promise a series but quite sure I am gonna cover on of "my" previous strategies.
@castleko3764
@castleko3764 2 жыл бұрын
Any chance you can make a video with a different api besides Binance it’s banned in my country
@Algovibes
@Algovibes 2 жыл бұрын
Hi Daniel, I roughly covered Kucoin here: kzbin.info/www/bejne/ZoKuiaalabV8mZY
@castleko3764
@castleko3764 2 жыл бұрын
@@Algovibes thanks man!!! Love ya vids
@franky12
@franky12 2 жыл бұрын
What would you prefer, *Backtrader* or *Backtrading.py* library?
@Algovibes
@Algovibes 2 жыл бұрын
Depends on the purpose. Backtrading surely for quickly backtesting stuff. Backtrader probably for more extensive stuff.
@theWSt
@theWSt 2 жыл бұрын
Can Backtrader also be used for live trading or only backtesting?
@Algovibes
@Algovibes 2 жыл бұрын
Regarding the docs also for live trading but I do not have any experience with that!
@krishnathakur7982
@krishnathakur7982 2 жыл бұрын
Hi Algovibe, can you do some option buying strategy with backtrader. If you can do then it will be very helpful. Thanks bro for such kind of awesome content.
@Algovibes
@Algovibes 2 жыл бұрын
Thanks buddy for watching my stuff. It is not on my list for the next videos but I noted your suggestion.
@samueltamayogaviria3377
@samueltamayogaviria3377 2 жыл бұрын
Hello bro! nice to see that you are using Backtrader. Could you make a strategy from scratch? thanks!
@Algovibes
@Algovibes 2 жыл бұрын
Hi :-) Sure, do you have something specific in mind?
@ManojAP
@ManojAP Жыл бұрын
thank you.
@Algovibes
@Algovibes Жыл бұрын
Welcome mate. Thanks a lot for watching! :-)
@Gavinnnnnnnnnnnnnnn
@Gavinnnnnnnnnnnnnnn 2 жыл бұрын
you should use geometric mean for the return
@Algovibes
@Algovibes 2 жыл бұрын
This is a Backtrader Introduction. I don't even use any returns here. Can you elaborate? Thx in advance!
@ahmetsuatyildiz4836
@ahmetsuatyildiz4836 2 жыл бұрын
Is optimization possible?
@Algovibes
@Algovibes 2 жыл бұрын
Yea, pretty sure it is. The author is actually covering some optimization topics in the docs.
@itayhilel2168
@itayhilel2168 2 жыл бұрын
Nice!! Can we level up and do some flush loans? Or is that a big ask?
@Algovibes
@Algovibes 2 жыл бұрын
Thanks man. There is nothing like a big ask ;-) I am always thankful for suggestions. But in this specific case I don't have enough exposure to make a resourceful video on that (yet).
@Abrahamis
@Abrahamis 2 жыл бұрын
Awesome Video, as always! Have you every tried vectorbt?
@Algovibes
@Algovibes 2 жыл бұрын
Thanks buddy. Nope, had a look but didn't dive deeper yet. Should probably give it a shot. Will do a vid on it if I like it, thx for the suggestion!
@Abrahamis
@Abrahamis 2 жыл бұрын
@@Algovibes I came to it after watching a vid from Larry kzbin.info/www/bejne/b6PTfq2knMSUrZI. Currently stuck with cascaded trades though 🤪
@mr.gk5
@mr.gk5 2 жыл бұрын
@@Algovibes Please do a vectorbt in depth tutorial. Vectorbt is like way more cooler
@suchan7889
@suchan7889 2 жыл бұрын
Your tutorial is good. Can you do a similar video using Vector BT ? thanks a lot.
@Algovibes
@Algovibes 2 жыл бұрын
Thanks mate, vectorBT is on my list, yes. Not quite sure when I will cover it tho.
@salemabualem
@salemabualem 2 жыл бұрын
Can I have the code you used in this video ?
@Algovibes
@Algovibes 2 жыл бұрын
It's basically copy pasted from the Backtrader documentation. For getting my Notebooks you are invited to join as a member: kzbin.infojoin
@mohammednasser6948
@mohammednasser6948 2 жыл бұрын
Great content what about live trading with backtrader?
@Algovibes
@Algovibes 2 жыл бұрын
Thanks a lot :-)
@hackingtamila8594
@hackingtamila8594 2 жыл бұрын
How can i get the codes
@Algovibes
@Algovibes 2 жыл бұрын
kzbin.infojoin
@Algovibes
@Algovibes 2 жыл бұрын
The vast majority of this code can just be found in the docs. Anyhow: Happy to welcome you as a member!
@aarondelarosa3146
@aarondelarosa3146 9 ай бұрын
It's incomplete. Where's the last plot?
@WinWiiiiin120
@WinWiiiiin120 2 жыл бұрын
Why is cerebro.plot() not working for me ?
@niikurasu2855
@niikurasu2855 2 жыл бұрын
forgot matplotlib inline?
@WinWiiiiin120
@WinWiiiiin120 2 жыл бұрын
@@niikurasu2855 I’ve done it
@eastwesttrading269
@eastwesttrading269 2 жыл бұрын
I got this "ImportError: cannot import name 'warnings' from 'matplotlib.dates' (C:\Users\anaconda3\lib\site-packages\matplotlib\dates.py)"
@Algovibes
@Algovibes 2 жыл бұрын
Backtrader can be a bit petulant sometimes 😛 The Matplotlib error is dependent on your version as far as I remember.
@thepuma8558
@thepuma8558 2 жыл бұрын
i had same issue and just pip install matplotlib==3.0.0 and it all worked
@viniciuscaetano7267
@viniciuscaetano7267 2 жыл бұрын
top!!!
@Algovibes
@Algovibes 2 жыл бұрын
Thx for your comment :-)
@chapmansbg
@chapmansbg 2 жыл бұрын
man that is some sluggish backwards code.
@Algovibes
@Algovibes 2 жыл бұрын
What exactly are you referring to? 😄
@chapmansbg
@chapmansbg 2 жыл бұрын
@@Algovibes probably a bit strongly worded but I would tidy up some of those if else statements and use np.where, it is a lot faster and it is very tidy and requires fewer lines of code. I have been building software that works dynamically with 250 pairs so I was basing my view on that. for example this one line of code hammers through hundreds of pairs in a fraction of a second. np.where(mean.mean() > tempdf5.loc[0,[s for s in symlist]].values, 1, 0) this is an example of what I would do.
@rafalsza
@rafalsza 2 жыл бұрын
vectorbt is better then backtrader
@Algovibes
@Algovibes 2 жыл бұрын
Thanks for the suggestion! Will have a look.
@STANDBYME.
@STANDBYME. Жыл бұрын
ERROR: Could not build wheels for ta-lib, which is required to install pyproject-toml based projects can you solve this
@Algovibes
@Algovibes Жыл бұрын
I am not using ta-lib in this video. Can you double check? thx!
@STANDBYME.
@STANDBYME. Жыл бұрын
@@Algovibes but do you know I can solve this issue
Simple Backtest with Tradingview/Pine script
13:24
Dennis Ivy
Рет қаралды 282 М.
IL'HAN - Qalqam | Official Music Video
03:17
Ilhan Ihsanov
Рет қаралды 700 М.
Cheerleader Transformation That Left Everyone Speechless! #shorts
00:27
Fabiosa Best Lifehacks
Рет қаралды 16 МЛН
VIRTUAL Virtuals Protocol Indicators Flash MAJOR Market Signal
20:03
C-Zar Gets Crypto
Рет қаралды 628
How To Backtest A Trading Strategy in Python
21:00
CodeTrading
Рет қаралды 63 М.
ChatGPT o1: Turtle Strategy in Python Makes 319%
19:17
Algo-trading with Saleh
Рет қаралды 117 М.
Algorithmic Trading with Python and Backtrader (Part 2)
9:50
Part Time Larry
Рет қаралды 64 М.
How to Code a Trading Bot in Python - Beginners Guide
23:33
TradeOptionsWithMe
Рет қаралды 814 М.
IL'HAN - Qalqam | Official Music Video
03:17
Ilhan Ihsanov
Рет қаралды 700 М.