Building a Trading Robot in Python | Pt. 2

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

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

  • @LessTrustMoreTruth
    @LessTrustMoreTruth 2 года назад +7

    One of the most valuable things for me atm is just the organization you've put into this project. You have everything very clearly organized and well thought out and I think that's super underrated in today's "move fast and break things" attention-grabbing world. Awesome work dude! Well done!

  • @stephonhenry-rerrie3997
    @stephonhenry-rerrie3997 4 года назад +12

    i really appreciate how much time you put into these. they might go over time sometimes but it's been good going through the code with you.

    • @SigmaCoding
      @SigmaCoding  4 года назад

      Well thank you for the support!

  • @ishpen282
    @ishpen282 4 года назад +13

    Only a man of quality uses a Darth Sidious background... claps to you

    • @SigmaCoding
      @SigmaCoding  4 года назад +1

      FINALLY, somebody brought it up! I've been waiting for so long!

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

      Bro I was thinking the same thing as soon as I saw he had palpatine as a background I was like my type of guy 🙌🏼🤣🤣 a fire Sith Lord background at that!

  • @eliasabsawy7347
    @eliasabsawy7347 4 года назад +6

    You're amazing man, there are no words to describe how thankful I am to find your videos.
    Thank you for the time you put into them

  • @danielfutterweit4182
    @danielfutterweit4182 4 года назад +6

    Remember the API has “Market Hours” that returns normal days, holidays, weekends, and half days trading hours. Unfortunately, the response structure varies for the different cases but can be parsed for the information.

  • @bradleyfallon6847
    @bradleyfallon6847 3 года назад +2

    Thanks for making this and walking through all the code. That is really cool.

  • @frankckf76
    @frankckf76 3 года назад

    Thank you so much for this video. It's great that you are going through step-by-step and explaining the details of the steps. Great for beginners like myself who has a very basic knowledge of Python and no clue how to go about setting up a trading bot without any external clients like Quantconnect. Although it is easier to just download the package, I typed every step myself as stated in the video to learn more and to better understand how the bot works. Good job!

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

    You are correct when you said "game theory." Algo's for long-short strategy, short only, long only and / or covered calls. Identifying those variables in the different algorithms and meshing them on a cohesion basis. Meshing all indicators and alerts ⚠️. It can be done, are you anywhere close at all?

  • @catty4449
    @catty4449 3 года назад +1

    40k of the viewers just used your github code :( . I am gonna watch the whole playlist :D.

  • @juanjosejaramillo4443
    @juanjosejaramillo4443 4 года назад

    Thanks from Colombia!! You have been really helpful for me with this series!!

  • @kamino6382
    @kamino6382 4 года назад +3

    You're the best thank you so much for this series!

  • @thewhiterabbit661
    @thewhiterabbit661 3 года назад +1

    A couple questions, how do you familiarize yourself with all the datetime functions to create this? it looks extra complicated to just see if market is open or not. I guess i am just new to programming but also how are the times 12 and 22 understood as standard time? I want to know how to set the time properly if i need to do so in the future.

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

    I tried entering "from td.utils import millliseconds_since_epoch" in VS Code to import the utilities module, but it isn't working. Any suggestions?

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

    Since Schwab bought TD Ameritrade after this series was put out, do you have a fix or recommendation for a similar API? TD won't let me sign up for their old API in favor of Schwab's. Apologies if this was already explained somewhere and I missed it.

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

    I know this is an old video, but do you know if there are any updates to this with Schwab?

  • @2minutecoder
    @2minutecoder Год назад

    Im unable to run the setup file. Are there changes in the packages i should be aware of? I've even tried using PyPi

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

    so does this run as a web server to communicate with the TD Ameritrade API?

  • @manuelmbscorreia
    @manuelmbscorreia 3 года назад +1

    Hi! Have you found a solution for the py code to understand if we are on a weekend or holiday? Or it would probably digress a bit from the main topic?

  • @sdriding
    @sdriding 4 года назад

    I believe Epcot is part of Disney world, whereas Epoch is... epoch.
    Appreciate the vids and your repo!

  • @David-jf2bb
    @David-jf2bb Год назад

    Im in the Uk and can't access a TD Ameritrade account. What alternative can I use?

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

    In my country, we can’t use td Ameritrade unfortunately, how would you go about incorporating the API for another company like Interactive Brokers for example?

  • @SpecswithAubrey
    @SpecswithAubrey 2 года назад

    which version of VS are you using ..The 2022 one is complicated

  • @TheNewsOfFunny
    @TheNewsOfFunny 4 года назад

    BY ALL MEANS , THANK YOU FOR MAKING THIS VIDEO

  • @charaznable4568
    @charaznable4568 3 года назад +1

    would anyone happen to know why "from td.client" is not working for me. i installed the td ameritrade python API library. It's telling me import "td.client" could not be resolved. It says the same thing for "td.utils" I would greatly appreciate any help

    • @cliffynator
      @cliffynator 3 года назад

      Make sure the environment is using the correct versions of pandas & numpy from the requires.txt file. Specifically pandas has to be 1.0.5

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

    Will this work with the new Schwab since they bought out TDAmeritrade?

  • @quilot100
    @quilot100 4 года назад +1

    Cool stuff!

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

    can you do price action trading bot, but don't use any price lagging indicators ?

  • @Countcho
    @Countcho 2 года назад

    Is it possible to create this bot on my iPad Pro?

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

    can i do it in for Binance

  • @snafu4714
    @snafu4714 4 года назад +1

    Hi sorry I'm an idiot and have no idea how ot run the pip setup, I've run the command in the command line and get a 1000 errors, I've run it in VS code with the completed code and get the same errors as the command line, the error tends to happen in the 'preparing wheel medata' section and everything just fails.

    • @SigmaCoding
      @SigmaCoding  4 года назад +1

      No worries, I'm sure we can figure it out. If you're in Visual Studio Code, it's super simple to install package. If you want to do a "developmental install" like I do in the video. Then all you need to do is open, in Visual Studio Code, the folder where the "setup.py" file is. Once it's opened, then simply run the following line in your terminal.
      pip install -e .
      Let me know if that works for you.

  • @obtronik
    @obtronik 4 года назад +1

    Hi everyone! I'm having a major issue with the setup.py, I can't manage to run it... I've updated my python and each time I run in the directory: "pip install -e ." to install the requirements I get: "ERROR: Package 'python-trading-robot' requires a different Python: 3.7.6 not in '>=3.8'". (I'm running python 3.8.2 64bits) What must I do? I really can't get around the problem... Please help me, I really want to learn about this project!

    • @SigmaCoding
      @SigmaCoding  4 года назад

      That's odd, it's saying it needs you to have python 3.7?

  • @Captaan_Ahab
    @Captaan_Ahab 4 года назад +1

    Ok. I’ve been watching your vids on and off. Great content! Excellent instructions! I have a little programming background/experience - python, java, etc. should I start with your TDA API setup series then proceed to this series?

    • @SigmaCoding
      @SigmaCoding  4 года назад +2

      I mean it won't hurt because it'll help give some more clarity to how I use it in this series. However, technically speaking you don't need to because a lot of the functionality here is stuff I've written specifically for this library. Anything I'm doing with the TD API is behind the scenes and isn't necessary when using the library.

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

    Hı. I got errors when ı trıed to import TDClient from tdçclients and mıllıseconds_since_epoch from td.utils. How can i fix it?

  • @oscarmartinezbeltran
    @oscarmartinezbeltran 4 года назад

    Your tutorials are great!!! Thank you!!!

  • @csgonoob3955
    @csgonoob3955 3 года назад

    again can i do this to any platform and i dont have knowledge about python but its amazing that the robot gets information from API and i cant even imagine how it does that.

  • @illmaticvol5120
    @illmaticvol5120 4 года назад

    quick question if anyone can answer:
    Is there a library that has preset trading strategies or indicators anywhere on the net? or is this just something that all algo-traders have to build out themselves?

  • @mkaberli
    @mkaberli 4 года назад

    Is there anyway you can make the code that you’re typing visually larger. I travel a lot and I watch videos on my iPad. Consequently, the screen is much smaller and I have a very difficult time seeing what your typing. Besides, as far as I can tell, there’s nothing but a bunch of unused white screen to the right of your code anyway?

  • @arno2531
    @arno2531 3 года назад

    i cant download td-ameritrade, pandas and numpy with the setup.py?

  • @chicoez4669
    @chicoez4669 3 года назад

    does this bot apply to crypto aswell?

  • @alemazzuca
    @alemazzuca 4 года назад

    is it necessary to define the type of object every time you write it? that's new in python.

  • @beltanelimoreservations302
    @beltanelimoreservations302 4 года назад

    Thank you for sharing how to do this! I did want to ask if I want to trade futures on TD with the robot is it the same but with the futures ticker and what about the time? I currently trade futures on TD. Thanks again for your time.

  • @Mathematics_Discuss
    @Mathematics_Discuss 2 года назад

    What's TDA API pls, am a beginner.

  • @aycak7401
    @aycak7401 4 года назад

    Great video, thank you so much! I was thinking for pre_market, right now should not be equal to market_start_time and for post_market, not equal to market_end_time. What do you think?

  • @misabdiel93
    @misabdiel93 4 года назад +1

    Ok so I just realized that its not using MetaTrader 4 as a client. (I dont know why I was assuming it would I just did.) and I want to know if its compatible with MT4 or if there are any emendations we could do to make it use MT4.

    • @SigmaCoding
      @SigmaCoding  4 года назад

      This library isn't compatible with the Client you mentioned.

    • @misabdiel93
      @misabdiel93 4 года назад

      @@SigmaCoding Ok thanks alot. The sad part is I specifically searched for MT4 coding bot python. and this showed up. I was so excited. I got a bunch of amateurs in finance and coding together to work on this. Only to realize that its not in MT4. Theoretically speaking though. It is possible to take out the TD api and switch it with a MT4 api? as long as the all the connections calling for TD api are fullfilled in the new MT4 api? I am currently looking at your TD api to see everything that includes so I can include it in the new one. MT4 is also a trading market. Only it uses foreign exhange,

  • @allankanaiya3775
    @allankanaiya3775 4 года назад +1

    My td.client doesnt have TDClient inside of it, and i cant pip install td.utlis doesn't work

    • @allankanaiya3775
      @allankanaiya3775 4 года назад

      td.utils

    • @notsobob
      @notsobob 4 года назад +2

      @@allankanaiya3775 have you tried "pip install tdutils" ? or "pip3 install tdutils" ?

  • @윤진건-m1g
    @윤진건-m1g 4 года назад +1

    THANK YOU VERY MUCH IT'S REALLY INTERESTING

  • @sarath_sajan
    @sarath_sajan 3 года назад

    _Is it possible to learn this power?_

  • @ishpen282
    @ishpen282 4 года назад +1

    Hi everyone! I was wondering, for the td.client, what do I need to pip install? Thanks!

    • @SigmaCoding
      @SigmaCoding  4 года назад

      If you pip install the trading robot library, it will install the TD library for you as well. It's in the setup.py file, so just run the pip install on the trading robot library.

    • @ishpen282
      @ishpen282 4 года назад +1

      @@SigmaCoding thank you! Question: does this also work on pycharm?

    • @SigmaCoding
      @SigmaCoding  4 года назад

      @@ishpen282 It should, but just be aware that PyCharm sets up the workspace environment a little differently than VS Code. People seem to run into issues when they try to run locally installed packages on PyCharm.

  • @subinlee4249
    @subinlee4249 4 года назад +3

    Hello!! I just wonder with some timestamps that you created!
    I thought Stock Market in US following this schedule.
    4:00 am to 9:30 am = pre market time
    9:30 am to 4:00 pm = market time
    4:00 pm to 8:00 pm = post market time
    And i guess you setted time for pre market and post market less than those time. Maybe i have misunderstanding but could you give me reasons? ps, your lecture is just awesome!

    • @SigmaCoding
      @SigmaCoding  4 года назад +1

      So the timestamps you're seeing are in UTC time because I can't assume everyone would be in PST time. The best work around is to put it in UTC time. Does that answer your question?

    • @spenceroulman
      @spenceroulman 4 года назад

      @@SigmaCoding Great material here!!! I had the same question as Subin. I understood Subin's question as: should the pre_market be 8:00(UTC) to 13:30(UTC) which would be 4:00(EST) to 9:30(EST)? Then the same for post market at 20:00(UTC) to 24:00(UTC) which would be 16:00(EST) to 20:00(EST). This would be different for OTC and foreign markets.

    • @larkittobe
      @larkittobe 4 года назад

      I know you can’t assume that everyone will be in the same zone, but you don’t have to assume the users time zone for the US stock market because it’s in EST. So would it not just be easier to call the api from TD to check?

    • @sanjeevpanicker9813
      @sanjeevpanicker9813 3 года назад +3

      It would change depending on daylight savings time. 9.30AM Eastern = 2.30PM UTC or 1.30PM UTC so either 13:30 UTC or 14:30 UTC pre-market end / regular-market start depending on EST/EDT. Gets complicated fast :)

    • @ltsloan406
      @ltsloan406 3 года назад

      @@sanjeevpanicker9813 Thanks, Sanjeev. You've answered the question of why the UTC times in this video weren't matching up for me. Daylight savings is in effect now.

  • @syedfaraz5528
    @syedfaraz5528 3 года назад

    what does "td.client" mean?

  • @0xlaptopsticker29
    @0xlaptopsticker29 4 года назад +2

    could you do this on a jupyter notebook?

    • @SigmaCoding
      @SigmaCoding  4 года назад +1

      I mean you could run the robot using a Jupyter Notebook, but I wouldn't want to develop this library using a Jupyter Notebook. It would be unnecessarily difficult compared to Visual Studio Code.

  • @joseraimundo3387
    @joseraimundo3387 4 года назад +1

    Can I use it for other broker? Or only TDAmeritrade?

    • @SigmaCoding
      @SigmaCoding  4 года назад

      Right now, only TD Ameritrade, but there are plans to integrate Interactive Brokers at some point.

  • @nickbajaj2440
    @nickbajaj2440 2 года назад

    I keep getting "ERROR: Package 'python-trading-robot' requires a different Python: 3.7.6 not in '>=3.8'" anyone know how to fix this?

  • @ronit.dhingra_
    @ronit.dhingra_ 4 года назад

    How would I get the utilities submodule from TD Ameritrade? I'm getting an error saying that this module can not be found.

    • @SigmaCoding
      @SigmaCoding  4 года назад

      If you're using the package hosted on PyPi, then run the following:
      pip install --upgrade python-trading-robot

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

    PLEASE DEAR ALEX HOW CAN I WRITE THE CODE SOO THE BOT CAN PLACE A BUY AND SELL TRADE AT THE SAME TIME WITH A 4 PIPS STOP LOSS IN PYTHON TNX UU IN ADVANCE

  • @neehar001
    @neehar001 4 года назад +1

    Could you go in dark mode in your editor in your tutorials? White background makes it difficult to see the text in your code editor

  • @MrJonathanRB
    @MrJonathanRB 4 года назад

    How was you profit after using it for 5 months?

  • @gustellezgiron
    @gustellezgiron 4 года назад +1

    Thanks for the video! When importing td.utils I get the message: cannot import name 'milliseconds_since_epoch' from 'td.utils'. I tried unsuccessfully to pip install it. Any ideas to make it work?

    • @nycb303
      @nycb303 4 года назад +6

      for recent python versions you need these 2 lines instead (see github file)
      from td.utils import TDUtilities
      milliseconds_since_epoch = TDUtilities().milliseconds_since_epoch

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

    How to install td.client???

  • @Theraverguy
    @Theraverguy 4 года назад

    thank you 🙏🏼

  • @nah8986
    @nah8986 4 года назад

    ImportError: cannot import name 'milliseconds_since_epoch' from 'td.utils'

  • @alizar8309
    @alizar8309 3 года назад

    Love you :)

  • @gunpoopoom2072
    @gunpoopoom2072 4 года назад

    thank you

  • @dominickmuniz
    @dominickmuniz 4 года назад

    🙌🏼🙌🏼

  • @keathya
    @keathya 4 года назад

    Where is part 2?

  • @SohrabBaqtiari
    @SohrabBaqtiari 2 года назад

    This Video and ALL of the CONTENTS ARE OUT OF DATE AND CAN NOT WORK CORRECTLY.

  • @i3_i9
    @i3_i9 4 года назад +1

    Can this work in roblox?

  • @certified_nawf
    @certified_nawf 3 года назад

    i think i might be the only one failing to actually follow