Backtesting Stock Trading Strategies in Python

preview_player
Показать описание
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 📚

🌐 Social Media & Contact 🌐

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

I have the best strategy..when your random friends start calling you "bro, should I buy Bitcoin now?"....that is the time to like right now...you buy....don't need to see a single chart

ViralKiller
Автор

I feel like he is making money from both applying this to his portfolio and YouTube, great videos keep it up

icode
Автор

Awesome, been looking for something like this in python for a while. Thanks!🎉

Jxmiecole
Автор

Thanks for this content. Very nice. I'm not sure to understand, you say "the triangle pointing down is a buy", but if I deactivate the part of the strategy doing "sells" (meaning, I only should have buy trades) I have only triangles pointing up.. Are you sure about the orientation of the triangles ?? What did I miss

tortue
Автор

i wrote few ones before, loved yours got few insights tnX man

PandorasBox
Автор

Hey super helpful vid, about the commissions part you set 0.002 per trade but aren’t most brokers today commision free? Do you have to pay for each trade?

lellel
Автор

since i dev trading software, thx for this easy and good tool !

vuvu
Автор

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!

raphaelarguello
Автор

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

ccmichaelson
Автор

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

A_R_X
Автор

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.

shubhampatel
Автор

Is anyone else getting "'infer_datetime_format' is deprecated" warnings?

neuvocastezero
Автор

I cant find that talib library. How to resolve it?

codingworld-programmerslif
Автор

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

😀

hourglass