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/
  • Наука та технологія

КОМЕНТАРІ • 22

  • @ViralKiller
    @ViralKiller Рік тому +14

    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

    • @onzah3515
      @onzah3515 3 місяці тому

      you nailed it. and now its time to sell

    • @leander79416
      @leander79416 Місяць тому

      worked well again in 2024

  • @Jxmiecole
    @Jxmiecole Рік тому +1

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

  • @PandorasBox2
    @PandorasBox2 4 місяці тому

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

  • @danielngandu8656
    @danielngandu8656 5 місяців тому

    Great video very insightful!

  • @vuvu7005
    @vuvu7005 Рік тому +1

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

  • @PivotPatTrades
    @PivotPatTrades Рік тому

    Wow thanks!

  • @icode7334
    @icode7334 Рік тому +4

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

  • @hourglass9
    @hourglass9 Рік тому

    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
    😀

  • @shubhampatel6908
    @shubhampatel6908 Рік тому

    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.

  • @raphaelarguello5020
    @raphaelarguello5020 2 місяці тому

    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!

  • @ccmichaelson
    @ccmichaelson Рік тому +2

    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

    • @Flamefire77
      @Flamefire77 11 місяців тому

      Got any solutions??

  • @A_R_X
    @A_R_X 3 місяці тому

    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

  • @animal9470
    @animal9470 Місяць тому

    What about multi time frames

  • @codingworld-programmerslif430

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

    • @daniel_bohbot
      @daniel_bohbot Рік тому +1

      try this:
      conda install -c conda-forge ta-lib

  • @satyamARAS
    @satyamARAS Рік тому

    A series for Quants (newbies ).

  • @tcgvsocg1458
    @tcgvsocg1458 Рік тому +2

    too muchh import! dislike

    • @vuvu7005
      @vuvu7005 Рік тому +2

      this is python lul, go do it yourself in C ...

    • @shubhampatel6908
      @shubhampatel6908 Рік тому

      write all from scratch lol