Algorithmic Trading with Python and Backtrader (Part 2)

  Рет қаралды 64,452

Part Time Larry

Part Time Larry

Күн бұрын

Пікірлер: 42
@parttimelarry
@parttimelarry 4 жыл бұрын
Like the video? Support my content by signing up for Interactive Brokers using the link below: www.interactivebrokers.com/mkt/?src=ptlPY1&url=%2Fen%2Findex.php%3Ff%3D1338
@iam.introspect8456
@iam.introspect8456 4 жыл бұрын
Dude these videos are gold. So well explained and im learning a ton by following along. I did want to point out a small bug in the strategy example from the Backtrader quick-start guide. When the strategy initially checks the first days close, and then the previous two days, for the first three iterations its actually making reference to the last two days of year 2000 and comparing them to the the first day of year 2000. So to fix that i added one more if statement before checking the close values: if (len(self) >= 3): This will make sure that the strategy starts on the third trading day and makes reference to the first two days of the year, rather than the last days of the year!
@cjhnsn20
@cjhnsn20 4 жыл бұрын
These are such excellent tutorials. Thank you!!
@DeepFrydTurd
@DeepFrydTurd 10 ай бұрын
Larry again my man your awesome !!
@hanaanrosenthal
@hanaanrosenthal 3 жыл бұрын
Larry, you are a pleasure to learn from - thank you
@PianoMan333
@PianoMan333 5 жыл бұрын
Great series, please keep it up and go more in depth!
@LilleyAdam
@LilleyAdam 2 жыл бұрын
Hi PT Larry. In your code, you used the backtrader data feed, even though you have the dataset in your current directory. Did you still need to create the class using the backtrader.feeds? Isn't that what the program uses to find the dataset?
@henryvanvuuren2792
@henryvanvuuren2792 3 жыл бұрын
Hi Larry. Run into a wall here. I imported a csv file downloaded from binance, with Generic csv. But after added strategies, nothing changed on Broker side. Pls can you help on what could be mising. It show the but and sell, lines, but cash values doesnt change accordingly.
@LilleyAdam
@LilleyAdam 2 жыл бұрын
what extension have you installed that shows up all the available objects and classes?
@s.r2350
@s.r2350 2 жыл бұрын
great vids. keep it up
@andrewwilson4167
@andrewwilson4167 3 жыл бұрын
Hi all. at 4 minutes I received invalid syntax error on cerebro.adddata(data). Any help would be appreciated. Thanks
@Leo-cw6dr
@Leo-cw6dr 4 жыл бұрын
Nice tutorials! Thank you!
@twtw785
@twtw785 3 жыл бұрын
I got lost from the strategy part. How did you connect the overall code to the strategy (separate file)? thanks
@oliverpolden
@oliverpolden 4 жыл бұрын
I know you didn't write that TestStrategy code but isn't dataclose[0] the first element and not the current so that example is wrong?
@LilleyAdam
@LilleyAdam 2 жыл бұрын
[0] is the current element according to the backtrader documents. [-1] is the first historical element.
@oliverpolden
@oliverpolden 2 жыл бұрын
@@LilleyAdam thank you for your reply. Yes you’re right about the documentation. I guess I need to do some experimenting to verify that behaviour because although it says it follows Python conventions for iterables, I can’t actually find anything in Python that says this is convention. That said, I am fairly new to Python so I’m not familiar with these conventions.
@elcoquirivera4503
@elcoquirivera4503 2 жыл бұрын
I’m trying to wrap my head around why I would use this library. Why not just build an algorithm from scratch using a notebook ?
@parttimelarry
@parttimelarry 2 жыл бұрын
Made a whole video on frameworks recently. A couple benefits are that it can live trade your brokerage account eg. IBKR using the same Strategy class used for backtesting. Going from a notebook to actually managing Interactive Brokers connections, account balances, live order management etc takes quite some time. Also many people enjoy open source projects since there are edge cases and bugs that only surface when thousands of people have traded many different scenarios in a live environment. Also following shared design patterns is good since you can speak a common language with other developers. You can definitely do anything from scratch, but some people appreciate the the structure.
@elcoquirivera4503
@elcoquirivera4503 2 жыл бұрын
@@parttimelarryI just watched the video and it makes sense. I was thinking of building an algorithm that would pick the optimal strategy but then I would have to pass the values back to back trader. I just decided to pursue this project so I’m working on the flow.
@cryptopinas6616
@cryptopinas6616 3 жыл бұрын
You are a legend.. Thanks.
@alexaddison1783
@alexaddison1783 4 жыл бұрын
If this channel wasn't here there would literally be nothing on youtube for backtrader (nothing good anyways)
@SamarthPusalkar
@SamarthPusalkar 4 жыл бұрын
Can we test intraday strategies with backtrader?
@meetshah4800
@meetshah4800 2 жыл бұрын
What if I need Indian Indices(Bank nifty) 1min time frame Backtesting???
@meetshah4800
@meetshah4800 2 жыл бұрын
Default parameters can be changed??
@florianhillen7404
@florianhillen7404 4 жыл бұрын
Very nice. Test bevore you risk your hard earned money!
@polanamis
@polanamis 4 жыл бұрын
Great video! What IDE are you using by the way, and how are you getting those suggestions for your backtrader code as you type it?
@hirengandhi4026
@hirengandhi4026 4 жыл бұрын
I am guessing thats Visual Studio Code
@Eigus-BikeCo
@Eigus-BikeCo 3 жыл бұрын
Kite is a nice coding assistant for that
@codemedio6418
@codemedio6418 3 жыл бұрын
is this teach us step by step coding?
@phaneendhraajaythota1025
@phaneendhraajaythota1025 4 жыл бұрын
I get this below error when I try to feed data using pandas.. could you help me with this? Traceback (most recent call last): File "pandas_data.py", line 59, in cerebro.plot(style='bar') File "/home/ajay/.local/lib/python3.6/site-packages/backtrader/cerebro.py", line 996, in plot plotter.show() File "/home/ajay/.local/lib/python3.6/site-packages/backtrader/plot/plot.py", line 814, in show self.mpyplot.show() AttributeError: 'Plot_OldSync' object has no attribute 'mpyplot'
@KundanKumar-nv6yu
@KundanKumar-nv6yu 4 жыл бұрын
Can we backtest on 15 mins data as well for intraday strategies?
@NoWayThisIsReaI
@NoWayThisIsReaI 4 жыл бұрын
The Yahoo feed only has Daily data, you need to get your own data or integrate with a provider to do that and there are documentation examples on how to do that on the backtrader website.
@wilhelmwilhelm1251
@wilhelmwilhelm1251 4 жыл бұрын
I always get the following error :/ AttributeError: 'str' object has no attribute 'to_pydatetime'
@vladedoske529
@vladedoske529 4 жыл бұрын
try to download csv file directly from yahoo finance
@ИгорьАфанасьев-ы4с
@ИгорьАфанасьев-ы4с 4 жыл бұрын
Thank you!! Very good content! I am a beginner algorithmic trader. You help a lot. There are a few questions. Can you please answer them how will the time? 1) dt = dt or self.datas[0].datetime.date(0) How to read this code? and what is dt? 2) self.log('Close, %.2f' % self.dataclose[0]) What does it mean %.2f and % self.dataclose[0]? I would be grateful for the answer
@anouararaamouch6603
@anouararaamouch6603 4 жыл бұрын
1) equivalen to: if dt is None: dt = self.datas[0].datetime.date(0) 2) I would say check out "string and float formatters format" on G
@shindersamra4020
@shindersamra4020 3 жыл бұрын
Bravo, bravo .
@hanaanrosenthal
@hanaanrosenthal 3 жыл бұрын
Great stuff thank u
@mank511
@mank511 4 жыл бұрын
Hello sir I m from India and new to coding but ur videos helping me a lot plz upload a video for login using python and also auto buy and sell using ZERODHA platform an Indian broker having API and also plz share the code ..thank u plz help
Algorithmic Trading with Python and Backtrader (Part 3)
12:01
Part Time Larry
Рет қаралды 49 М.
Interactive Brokers API, TradingView Charts in Python
47:52
Part Time Larry
Рет қаралды 84 М.
Quando eu quero Sushi (sem desperdiçar) 🍣
00:26
Los Wagners
Рет қаралды 15 МЛН
Algorithmic Trading with Python and Backtrader (Part 1)
6:02
Part Time Larry
Рет қаралды 118 М.
Finding Breakout Candidates with Python and Pandas
29:33
Part Time Larry
Рет қаралды 71 М.
Backtesting.py - Full course in python
1:09:34
Chad Thackray
Рет қаралды 205 М.
How to MASTER Data Structures & Algorithms FAST in 2023
10:21
Internet Made Coder
Рет қаралды 213 М.
Backtrader Live Forex Trading with Interactive Brokers (Part 1)
29:35
Part Time Larry
Рет қаралды 29 М.
VectorBT: Hyperfast Quantitative Analysis vs. Backtrader
27:50
Part Time Larry
Рет қаралды 39 М.
Python Logging: How to Write Logs Like a Pro!
11:02
ArjanCodes
Рет қаралды 186 М.
How Senior Programmers ACTUALLY Write Code
13:37
Thriving Technologist
Рет қаралды 1,6 МЛН
Interactive Brokers Web API [Part 1] - Docker Tutorial
28:54
Part Time Larry
Рет қаралды 12 М.