Mean Reversion Trading Strategy Using Python

แชร์
ฝัง
  • เผยแพร่เมื่อ 5 ต.ค. 2024
  • #Programming #Python
    Mean Reversion Trading Strategy Using Python:
    In this video you will learn how to create a simple mean reversion trading strategy for an asset using the python programming language. According to Investopedia, mean reversion, or reversion to the mean, is a theory used in finance (rooted in a concept well known as regression towards the mean) that suggests that asset price volatility and historical returns eventually will revert to the long-run mean or average level of the entire dataset.
    Disclaimer: The material in this video is purely for educational purposes and should not be taken as professional investment advice. Invest at your own discretion.
    ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
    ⭐Please Subscribe !⭐
    ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
    ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
    🐦🔥🐤 Support The Channel🐤🔥🐦
    ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
    ⭐Get the code and data sets or just support the channel by becoming a supporter on Patreon:
    ► / computerscience
    ⭐Website:
    ►everythingcompu...
    ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
    📚Helpful Python Programming Books📚
    ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
    ► Hands-Machine-Learning-Scikit-Learn-TensorFlow:
    amzn.to/2AD1axD
    ► Learning Python:
    amzn.to/3dQGrEB
    ►Head First Python:
    amzn.to/3fUxDiO
    ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
    📚Helpful Financial Books📚
    ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
    🌟Stock Market Investing Books:
    ✔️The Bogleheads' Guide to Investing
    amzn.to/3s0icxA
    ✔️The Intelligent Investor
    amzn.to/34Mj7t1
    ✔️A Random Walk Down Wall Street
    amzn.to/3Bv0ghW
    🌟Money Mindset Books
    ✔️Rich Dad Poor Dad:
    amzn.to/3rZW6eE
    ✔️Get Good With Money: Ten Simple Steps To Becoming Financially Whole:
    amzn.to/3I1UXc1
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 29

  • @TheVd101
    @TheVd101 6 หลายเดือนก่อน +3

    Nice video, but your strategy has look ahead bias as you use the entire dataset to construct your percentiles. This means that the percentile values take into account future price data that would not have been known at the time. One solution to try would be to calculate percentiles based on a rolling window of the past X days.

  • @pat2715
    @pat2715 6 หลายเดือนก่อน

    genuinely the most helpful thing I've seen as a beginner

  • @izem9652
    @izem9652 2 ปีที่แล้ว +1

    Man that was exactly what I was looking for, what a timing thanks

  • @pragneshmistry6845
    @pragneshmistry6845 ปีที่แล้ว

    Great video on Mean Reversion Strategy using Python! I followed along and implemented the same entry and exit signals in the Vectorbt Python library. Surprisingly, the buy and hold results aligned with what you showed in the video, but the strategy returns differed. I’m curious to know what could be causing this discrepancy. Looking forward to your insights!”

  • @navketan1965
    @navketan1965 2 ปีที่แล้ว

    Sir, My strategy is based on end of day closing prices of forex(multiple pairs daily). Standing Orders are entered with the daily trend & placed at distance of 70% of daily ATR(distance D), away from closing price with take profit of 50% & stop loss of 50%(of distance D)--win or lose, no manual interference. Next day new orders are entered based on end of day closing prices. All previous day's unfilled orders are cancelled(but no manual interference with executed but open orders).Based on option probability theory/ Brownian motion, the SYSTEM should make money, if trader SITS & does not fool around using his brain. Your wisdom & thank you

    • @craftyle
      @craftyle ปีที่แล้ว

      How does it worked the last months?

  • @FireFly969
    @FireFly969 2 ปีที่แล้ว +1

    this stratey looks interesting, its just need more great ideas of entires and exit, and maybe some other conditions

  • @marcogelsomini7655
    @marcogelsomini7655 2 ปีที่แล้ว

    nice and simple approach with percentiles. good work!

  • @RenatoSmileS
    @RenatoSmileS 2 ปีที่แล้ว

    Very interesting video! Thank you so much!! 😃👍

  • @notrentner1010
    @notrentner1010 2 ปีที่แล้ว

    genuinely curios as to why you're not using yahoo api, would make the first 5 min of the video superfluous.

  • @shadowangel8005
    @shadowangel8005 10 หลายเดือนก่อน +1

    hey, do you have a link to the google colab for this strategy ?

  • @razaahmedkhan9825
    @razaahmedkhan9825 2 ปีที่แล้ว

    Thanks for the video sir 👍

  • @ProfitScalpKing1
    @ProfitScalpKing1 2 ปีที่แล้ว

    This is amazing bruh, thanks so much

  • @rajeshmanjrekar3614
    @rajeshmanjrekar3614 2 ปีที่แล้ว +4

    i have been dissapointed with your videos time and again, i want to subscribe to your chanel but the final report NEVER matches the video results. This has happened to me in several of your videos. Surprisingly when i ommitted the line df["Positions"] = df["Positions"].ffill, i got the required result.....shocking !!!!

    • @endeavorsu7174
      @endeavorsu7174 ปีที่แล้ว

      yeah, the ffill step is definitely problematic

  • @sebastianrodriguez672
    @sebastianrodriguez672 7 หลายเดือนก่อน

    Good video but the sma is not calculated correctly. You consider the close price of the same day but you actually don't have it until the sesión ends, so yo need to consider the days before

  • @xaviercanedos
    @xaviercanedos 2 ปีที่แล้ว

    Awesome video

  • @andydracula1987
    @andydracula1987 2 ปีที่แล้ว

    I've got one question after watched this video. How can I get the data of day 10 for calculating the percentile when I'm in day 1?

  • @ashwinkothari9646
    @ashwinkothari9646 ปีที่แล้ว

    does this strategy assume shorting is done as well?

  • @sherlockhobbes423
    @sherlockhobbes423 ปีที่แล้ว

    This is fantastic

  • @jeongyoo8985
    @jeongyoo8985 2 ปีที่แล้ว

    so do you actually trade and make money using these types of algorithms? Not trying to criticize but genuinely curious...

  • @aaronsarinana1654
    @aaronsarinana1654 2 ปีที่แล้ว

    Great video! Thanks!

  • @jinyonglim
    @jinyonglim 2 ปีที่แล้ว

    Thanks

  • @adityagarg6734
    @adityagarg6734 2 ปีที่แล้ว +2

    First comment 🥇

  • @maxiperelli8570
    @maxiperelli8570 2 ปีที่แล้ว

    Where can I go to learn python trading ?

  • @dcchase8225
    @dcchase8225 2 ปีที่แล้ว

    Thanx bro

  • @endeavorsu7174
    @endeavorsu7174 ปีที่แล้ว

    I don't think the df["Positions"] = df["Positions"].ffill is a right step.

  • @armanyaseen213
    @armanyaseen213 2 ปีที่แล้ว

    Can we get the python file?