Basic strategy backtesting in python with backtrader

preview_player
Показать описание
We use the backtrader library to do a basic backtest for the crossover of the price with the 50 day moving average for BTC-USD.

⭐ Code:
Рекомендации по теме
Комментарии
Автор

2023 and this tutorial is still great. Thanks.

AngadveerSinghOfficial
Автор

hi. I've been able to pull data with various frequencies directly from Yahoo Finance (1h, 15m etc.), but not directly within backtrader (bt.feeds). Would you happen to know how to do it from backtrader?

LukasTradingJourney
Автор

I keep getting the error: FileNotFoundError: [Errno 2] No such file or directory: 'BTC-USD'
i believe this is due to backtrader not being able to get the yahoofinancedata, but i do not know how to fix it. Also, when I try to use my own pandas dataframe for the data I get: AttributeError: 'str' object has no attribute 'to_pydatetime.' Edit: I figured it out, check my reply

neilkush
Автор

I like al your videos chad.. can also demonstrate backtesting video for intraday trading

iamprashantjain
Автор

Do you have any tutorial for intra day testing?

vt
Автор

Does this work with intraday data and day-trading, meaning that all positions must be closed by the end of trading day (about 4 pm)?

Sam-tgii
Автор

I see a equity curve change on mine but i don't see buy/sell signals or any plots on the Positive/Negative trades section. Why?

LFTRSV
Автор

Is there any way that I can output the graphs onto an html page?

SaeedAidaro
Автор

Matplotlib is aroun v 3.50 is that a problem with backtrader? or still need matplotlib v 3.2.2?

kicc
Автор

how to do this with smc concept
i want to use programming with smc
not with indicators

shoppingaddiction-tsgk
Автор

Thanks Chad, a clean, simple example well explained. One question, with bt.feeds.YahooFinanceData, how can I turn it into a pandas DataFrame?

frankmills
Автор

Excellent tutorial Chad! But I wanted to ask... The new zipline trader Vs Backtrader and why. I'm stuck please tell me which one to go for.

Anyone.c
Автор

You mention your course at the end of the video but I'm not seeing a link in the description..?

LFTRSV
Автор

Great video! I cannot plot. I get the error message "IPython is not defined" in Jupyterlab. Knows someone how to solve this issue? thanks

patite
Автор

hi, tnx for move, but i'm Error : [Errno 2] No such file or directory: 'BTC-USD' ?

PooriaRezapoor
Автор

It's not clear where you sell a position.

dennisrusde
Автор

I think there is a problem with yahoo data. I couldn't run it now.

indiaonellp