Backtesting Stock Trading Strategies in Python

Поделиться
HTML-код
  • Опубликовано: 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

  • @Jxmiecole
    @Jxmiecole Год назад +1

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

  • @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

  • @PandorasBox2
    @PandorasBox2 5 месяцев назад

    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 !

  • @icode7334
    @icode7334 Год назад +4

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

  • @PivotPatTrades
    @PivotPatTrades Год назад

    Wow thanks!

  • @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

  • @animal9470
    @animal9470 Месяц назад

    What about multi time frames

  • @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

  • @codingworld-programmerslif430
    @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