Backtesting Stock Trading Strategies in Python
Вставка
- Опубліковано 8 лис 2022
- In this video, we learn how to backtest and evaluate our stock trading strategies in Python.
DISCLAIMER: None of this is financial advice. I am not a financial professional and this is a tutorial about programming in Python. I am not responsible for any financial or investing decisions you make.
◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾
📚 Programming Books & Merch 📚
🐍 The Python Bible Book: www.neuralnine.com/books/
💻 The Algorithm Bible Book: www.neuralnine.com/books/
👕 Programming Merch: www.neuralnine.com/shop
🌐 Social Media & Contact 🌐
📱 Website: www.neuralnine.com/
📷 Instagram: / neuralnine
🐦 Twitter: / neuralnine
🤵 LinkedIn: / neuralnine
📁 GitHub: github.com/NeuralNine
🎙 Discord: / discord
🎵 Outro Music From: www.bensound.com/ - Наука та технологія
I have the best strategy..when your random friends start calling you "bro, should I buy Bitcoin now?"....that is the time to sell.....bloodbath like right now...you buy....don't need to see a single chart
you nailed it. and now its time to sell
worked well again in 2024
Awesome, been looking for something like this in python for a while. Thanks!🎉
i wrote few ones before, loved yours got few insights tnX man
Great video very insightful!
since i dev trading software, thx for this easy and good tool !
Wow thanks!
I feel like he is making money from both applying this to his portfolio and UA-cam, great videos keep it up
Great Video! Can you simultaneously do a backtesting on all 4 symbols
like for example EURUSD and SPUSD
so if I buy on SP500 on 2011-01-07 and sell on 2011-01- 10 then in the next buy this program will recheck the opportunity in EURUSD and SPUSD and automatically matches the buying signal and then buy that stock after 2011-01-10
in this way we can have a full return on investment based on different stocks
😀
I am actually getting different return values for same date range and stocks. Any particular reason you think ?
I am using data from yfinance as pd-datareader is not working for me. I don't think this is the issue as returns when holding are already same. I am confused and worried as this is finance related.
Seems like dataset issue, I used stooq data and it took 2 less trades, these 2 trades changed the return amount by a lot.
Great content, thanks for your work!
I am struggling with the size of the position for the backtesting. I am trying to risk 1% of the available cash per position so I enter the sl and size = 0.01. However, the risk is completely off and it only risk 0.014%
And in your code, you don't enter any size, do you know how much is risked per trade?
Would you maybe have a solution please?
Thanks for your help!
When I run your second example (towards end of video), I get the following: TypeError: Can't instantiate abstract class MyMACDStrategy with abstract method next
Got any solutions??
How can we load custom OHLC data in CSV file in backtesting.py , I'm failing to create a CSV file in a required format .
Can somebody help .
Thank You
What about multi time frames
I cant find that talib library. How to resolve it?
try this:
conda install -c conda-forge ta-lib
A series for Quants (newbies ).
too muchh import! dislike
this is python lul, go do it yourself in C ...
write all from scratch lol