Building a LIVE Algorithmic Trading Bot with Python, Lumibot and Alpaca: A Step by Step Guide

Поделиться
HTML-код
  • Опубликовано: 25 дек 2024

Комментарии • 65

  • @pinecedar180
    @pinecedar180 10 месяцев назад +3

    ok.. I think this is the starting video. I suggest numbering them and tell people in every video that this is a series.

    • @MattMacarty
      @MattMacarty  10 месяцев назад

      Thanks. I think I talk about the order to watch these in at the beginning.

  • @gaurav2979
    @gaurav2979 8 месяцев назад

    Thanks for sharing Man, keep up the good work

    • @MattMacarty
      @MattMacarty  7 месяцев назад

      Thanks. Glad it helped

  • @rabidlenny7221
    @rabidlenny7221 7 дней назад

    0:57 okay so what program am I looking at right now?
    I’m really confused. It be very helpful if you had a video on just how to get to this point

    • @MattMacarty
      @MattMacarty  7 дней назад +1

      That is output from Quantstats. Here's the quantstats stand alone: ruclips.net/video/fT-3V8t01DE/видео.html

    • @MattMacarty
      @MattMacarty  7 дней назад +1

      Oops, I think that was the wrong link: ruclips.net/video/VzE2nV39cQg/видео.html

    • @rabidlenny7221
      @rabidlenny7221 7 дней назад

      @@MattMacarty thanks Matt! I will check it out in a few!

  • @bigtexnick2188
    @bigtexnick2188 4 месяца назад

    Great vid, Matt. Question from a non-coder: are you not able to do all of this configuring of your trading strategy logic inside of Alpaca itself?

    • @MattMacarty
      @MattMacarty  3 месяца назад

      There are limitations to what you can set up in terms of automation directly on Alpaca. So it depends what you are trying to do.

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

    With your lumibot examples I'm getting "TypeError: 'Timestamp' object is not subscriptable". Any help appreciated.

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

      You can download the demo files here and compare your code: github.com/mjmacarty/algorithmic-trading

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

      @@MattMacarty the error is the same with your original code. By the way is Alpaca Pro needed for algo trading?

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

    Finally! i was able to get most of this code work! haha i got all the results you did except no web page opened.. Got this error: ValueError: Cannot set a DataFrame with multiple columns to the single column plotly_text_sells.. but soo much progress lol

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

      Nice. Most of the learning comes from debugging. You can always download my code from the github link in the video description, but it is much more instructive to try to replicate the code yourself.

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

      Same here bro

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

    Great tutorial Matt! worked for me…. almost - any ideas why it’s rounding decimals back to whole numbers for fractional trading?

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

      Not sure. You may not be able to trade fractional shares, or it could be a limitation of paper trading.

  • @b4f495
    @b4f495 9 месяцев назад

    if im buying and holidng why is the growth percentage different from the charts?

    • @MattMacarty
      @MattMacarty  9 месяцев назад

      Not sure what you mean by this. If you mean percent change in value that will be somewhat different than an annual growth rate.

    • @b4f495
      @b4f495 9 месяцев назад

      @@MattMacarty why is that since im just buying and holding? good video tho thanks!

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

    I'm getting an error which says there isn't enough data to create a tearsheet, but I am able to backtest and get that visualization comparing the BuyHold strategy with SPY. Any idea on how I can fix this?

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

      Hard to diagnose from here. You an download the code from Github and compare using the link in the description of the video.

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

    very cool!!

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

      have been watching your video and learnt a lot, altho I work as data operation/engineer, still learnt a lot Python3 with your video!

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

      Thanks. Glad it's helping

  • @violetlinlyx
    @violetlinlyx 6 месяцев назад

    Thank you for sharing Matt! I have one question - It's very cool to generate a Plotly interactive graph from Lumibot. I wanted to dig into the package and find the code that generated the graph but I couldn't find it. Do you know where in Lumibot embedded this function? It'll be so much easier to leverage it on other data visualization projects.

    • @MattMacarty
      @MattMacarty  6 месяцев назад

      Sorry. I haven't examined their code. Try holding control key and click on the lumibot class to open the underlying code.

    • @violetlinlyx
      @violetlinlyx 6 месяцев назад

      @@MattMacartyYea, that's what I did. I was guessing it's in lumibot.strategies but I only found matplotlib library but the graph is generated by plotly. Also, I didn't find where in lumibot is embedded QuantStats neither. Appreciate it if you could help provide some clues.

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

    tried your code it says No module named 'lumibot' but I installed it,,, could it be that the code never imported lumibot???

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

      Yes it sounds like the environment you are working in can't find lumibot. if you are using Anaconda make sure the environment is activated by running "activate" at the command line. If you are using an IDE make sure it is using Anaconda as the Python interpreter.

  • @CreeLegacy
    @CreeLegacy 10 месяцев назад

    Hey man! Thanks for the content! I've downloaded your code, set it up, got it up and running, when I run Buy_hold, it opens up my chrome properly and profives the graphs alright, but in my VS terminal I don't get what you call "higher statistics" any clue why?

    • @MattMacarty
      @MattMacarty  10 месяцев назад

      Not sure what is happening there. It's possible there was a revision to lumibot such that this functionality doesn't happen automatically.

  • @mdawg998
    @mdawg998 8 месяцев назад

    I'm new to coding. I straight up cannot figure out how to get Lumibot available for this program. I went to terminal. Did the pip install. Now what? I cannot find out to actually include it.

    • @MattMacarty
      @MattMacarty  8 месяцев назад

      You can follow the link in the description to get the code. You just need to import lumibot in your code

  • @chentomerify
    @chentomerify 8 месяцев назад

    hey matt!, loved the video! i have trouble installing pip lumibot. it says there is something wrong with the package itself(not pip). is it possible that lumibot isnt working with my python version (3.12.12)? thank you!

    • @MattMacarty
      @MattMacarty  8 месяцев назад +1

      My guess is it is one of the dependencies such as pandas that is causing the problem. You likely havea newer version of pandas than is supported by lumibot. You can try downgrading to something like 1.5 and see if that solves the probelm. ALso you can contact lumiwealth and they will get you going.

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

    Thank you for this video, will a gold tracking bot be in the pipeline for this video series?

  • @user62413
    @user62413 4 месяца назад

    How to find the rest of the series?

    • @MattMacarty
      @MattMacarty  4 месяца назад

      Here are my algo videos: ruclips.net/p/PLiPFKCVZWHKqtlvkq-V610SXMr2Ii9uAR

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

    Hi Matt, thanks for the great video! As someone with little to no programming experience, I am running into problem "ImportError: cannot import name 'ALPACA_CONFIG' from 'config'". I've tried to set up my API credentials into Jupyter txt and py files and cant seem to get it work. Any advice concerning this?

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

      The config.py file is a file I made containing my API keys. I did it that way to keep my credentials private. You can just directly use your API keys in place of ALPACA_CONFIG.API_KEY and ALPCA_CONFIG.SECRET_KEY. Also you can skip import config

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

      @@MattMacarty Now its working! Thanks for your response brother. Looking forward to your next videos.

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

    Can you do a video on different trading strategies?

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

    Thanks for the video.
    Any idea please to solve this error :
    note: This error originates from a subprocess, and is likely not a problem with pip.
    ERROR: Failed building wheel for multidict
    Successfully built aiohttp
    Failed to build multidict
    ERROR: Could not build wheels for multidict, which is required to install pyproject.toml-based projects

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

      This sounds like there are some version incompatibilities. Try upgrading Lumibot with pip.

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

      @@MattMacarty I really thought that I have used the "pip --upgrade ..." Anyway , I successfully installed the package , thank you very much

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

    Hello Matt, How can I download lumibot? I looked online and only see documents for download, if you could please include a link in the bio it would greatly be appreciated!

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

      from the command line run pip install lumibot

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

      @@MattMacarty sorry this is new to me, what does that mean?

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

      Could you make a video, I think I got there but wasn't sure which part to download

  • @jcruz6888
    @jcruz6888 10 месяцев назад

    After skipping to the end of the video, I found it hilarious that the bot essentially lost money. I likely missed a lot since I only watched the end. However, I’m curious - would you recommend this as a profitable hobby?
    I'm looking to spend 1 - 2 hours per day on it. I believe I already know enough web development to carry me through this API with JS & some other tools. However, I can't help but think that it's not worth my time as there's not that much discussion about the profits that people on my level may or may not get.

    • @MattMacarty
      @MattMacarty  10 месяцев назад

      So the video is just meant to show how to automate trading, not how to make money. Probably most people would not share their money minting strategy on RUclips. If they did, I would be pretty skeptical. I would focus on a particular security or maybe two if you want to pair trade. For example, I think BIDU does X every day. Can I develop a strategy to take advantage of X? If you have the time you should watch the whole video and others to see the mechanics and then investigate what could work. Alpaca is nice since you can easily test things without risking any money.

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

    Hi, I was following along with the video and when i run the script I am getting this error which then throws alot more other errors:
    "GOOG: No data found for this date range, symbol may be delisted"

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

      Hmmm, that's odd. My guess is there is something else going wrong there. You can try GOOGL if you want. You can also download my code from the github link in the desc.

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

      @@MattMacarty Thanks! I will compare my code with yours.

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

      I was missing alpaca-py.