How To Build a Simple Cryptocurrency Live Trading Bot with Python using the Binance API Easily

Поділитися
Вставка
  • Опубліковано 11 гру 2024

КОМЕНТАРІ • 969

  • @Algovibes
    @Algovibes  3 роки тому +77

    PLEASE READ(January 2022)❗
    This video is picked up by the Algorithm again. Thanks for your interest and support.
    Secondly most of the viewers understood that this is a technical implementation of a simple strategy and NOT a recommendation to trade this strategy. For those who doesn't please keep that in mind :-)
    FAQs / Most common problems:
    1.
    SyntaxError: 'await' outside function
    I have provided a solution to solve this in this video:
    ua-cam.com/video/nQkaJ207xYI/v-deo.html
    2.
    The stream stops and something like "None in the columns" is popping up:
    ua-cam.com/video/OX5eDJDtqhc/v-deo.html
    Solved below the videos pinned comment (Reason behind that is, if you are not getting a ping from the server an empty data frame without columns is created).
    3.
    If you don't feel comfortable using the Binance Socket Manager or you are using Python 3.10. I recommend to use a Websocket stream. I have covered it among other newer videos in the crpytobot playlist here:
    ua-cam.com/video/8p240qonj0E/v-deo.html
    4.
    I have covered a lot of other concepts like cloud deployment, other trading approaches, not using SQL or using e.g. technical indicators. Please check out the cryptobot playlist here:
    ua-cam.com/play/PL9ATnizYJ7f8_opOpLnekEZNsNVUVbCZN.html
    There is more to come so if you are interested in that please considering leaving a sub.
    Thanks for watching and your support! Much appreciated ❤️

    • @rgreville
      @rgreville 3 роки тому

      Yep!!! Good work. Great content and well delivered.

    • @filipatanassov3387
      @filipatanassov3387 3 роки тому

      Thanks a lot!

    • @ggmtddbo
      @ggmtddbo 3 роки тому

      Thanks!!! How obtain with websockets in binance futures lowest timeframe ie..milliseconds is possible?

    • @guillanodorasamy6507
      @guillanodorasamy6507 3 роки тому +1

      Hi, Thanks for your videos (y)
      I ran the code on google collab but got this error:
      RuntimeError: asyncio.run() cannot be called from a running event loop
      Can you help please?

    • @casperrrr2284
      @casperrrr2284 3 роки тому +3

      this does not work for me: "asyncio.run() cannot be called from a running event loop"

  • @henrydikeman4223
    @henrydikeman4223 3 роки тому +209

    You can always tell who the true educators are and who the snake oil salesmen are from what they promise and what they teach. You’re a true educator, great choice of the simple trading strategy. Subscribed

    • @Algovibes
      @Algovibes  3 роки тому +12

      Thanks a lot for your kind words man, I appreciate it. This is super important to me!

    • @antman7673
      @antman7673 2 роки тому +2

      No 300% guaranteed daily return. This must be the snakes salesman.

  • @MaryBenedict1155
    @MaryBenedict1155 2 роки тому +91

    Nice to see how you openly ventilate the change in your opinion. In your next lunch video, take a look at the new utilities and the staking story. You can really earn a lot with trading on bitcoin. Especially if you are already planning to invest something in it for the long term. Thanks again for the update.

    • @donald.jacoby.94
      @donald.jacoby.94 2 роки тому +2

      Crypto trading is quite profitable I'll always pick Short term trading over Holding cause I have made a lot of profit from trading different profitable coins... it is not surprising as I also trade with Mr. Henrik Bower on a short term basis.....I advice you seek the help of an expert to avoid the trauma of too much losses

    • @JohnHealy7153
      @JohnHealy7153 2 роки тому

      @@donald.jacoby.94 Just recently acquired some bitcoin and I don't know how best to trade it or if I should hold, Please how do i get in touch with Mr. Henrik your trader?

    • @mustafatito650
      @mustafatito650 2 роки тому +1

      Henrik Bower's daily signal is top-rated and one of the best you could get when it comes to trading crypto...

    • @donald.jacoby.94
      @donald.jacoby.94 2 роки тому

      @@JohnHealy7153 You can reach him VIA

    • @donald.jacoby.94
      @donald.jacoby.94 2 роки тому

      *tele* *gram*

  • @milanmeyer2059
    @milanmeyer2059 3 роки тому +95

    This is pure Gold. I’m just getting into Python and strive to become a data scientist one day. This really helps and motivates a lot! Danke.

    • @Algovibes
      @Algovibes  3 роки тому +4

      Awesome to hear and also great career pick ;-)

    • @ololh4xx
      @ololh4xx 3 роки тому +4

      Starting out with cryptocurrencies when you want to become a data scientist is like starting out with IRL pyramid schemes when you want to become a legit business manager. Does not compute. Stop doing that, pick up a few books and do real data science exercises

    • @Algovibes
      @Algovibes  3 роки тому +7

      "real data science exercises"...come on. In books you will find standardized approaches such as cancer prediction, houseprices and so on which are helpful without a question but If he wants to apply Data Science stuff to cryptocurrency data..why not? It is just time series data which can nearly be found everywhere. BTW I applied some methods here on cryptos:
      ua-cam.com/video/oyL99oa6gf8/v-deo.html

    • @chijiokechidozie3602
      @chijiokechidozie3602 3 роки тому

      @@milanmeyer2059 I have a better way of doing same.

    • @pushkarkushwah7376
      @pushkarkushwah7376 3 роки тому +1

      German ❤️

  • @user-zo1np4lh5u
    @user-zo1np4lh5u 3 роки тому +54

    I love how clean your code is makes me feel ashamed of how lousy I've been writing mine xD Great work

    • @Algovibes
      @Algovibes  3 роки тому +4

      No need to be ashamed but an Eng. would probably strongly disagree with you as my code is not clean. I am presenting the code so that it is accessible independent from the skill level. I played around with showing object oriented code but I get the feeling people prefer the code in this way. Anyhow, thanks a lot for your kind words :-)

    • @alexandr8153
      @alexandr8153 3 роки тому

      @@Algovibes I'm sorry, how can I copy your script?
      Or following to your video instructions is onlyway?

  • @capture-everything54
    @capture-everything54 3 роки тому +2

    Has never done a video like this before at all in youtube. There has never been an account of how to write a bot and trade with real money on binance. thanks.

    • @Algovibes
      @Algovibes  3 роки тому +1

      I am sure there is! But anyhow I appreciate your comment :-) Thanks for watching mate.

  • @joelalarconbarrientos3843
    @joelalarconbarrientos3843 2 роки тому +12

    I'm introducing myself in python since two months ago and seeing things like this motivates me to keep learning. The best of all is that with your explanations I can figure out what is going on, but in a very basic way anyway.
    Thank you very much for sharing and teaching your knowledge with the web. Greetings from Chile!

    • @Algovibes
      @Algovibes  2 роки тому +2

      Hey Joel,
      that's awesome to read. Thanks a lot for your comment and I am sending you my best regards to Chile!

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

    After losing lot of amount on manual trading and thinking of going for bot trading, this one is really a great resource to begin with

  • @Oz_rhodes
    @Oz_rhodes 3 роки тому +25

    You provided a clear explanation of the code and aims and the script was great. Keep up the great work and thank you.

    • @Algovibes
      @Algovibes  3 роки тому

      Thank YOU for watching, the feedback and your kind words :-)

  • @clementfelley8170
    @clementfelley8170 3 роки тому +54

    Great content, thanks for sharing. An interesting exercise from a risk management perspective would be to take half profit at 0.15% and the other half at 0.3% so that the profit potential is slightly higher than the stop loss

    • @Algovibes
      @Algovibes  3 роки тому +13

      Thanks for your comment and also thanks for sharing your thoughts! Yes definitely, I am just taking some parameters here to show the base concept.

    • @yesihavereadit
      @yesihavereadit 3 роки тому

      And losses what about them?

    • @clementfelley8170
      @clementfelley8170 3 роки тому +3

      You keep the stop loss at -0.15%. If you reach the first target before the stop loss, you increase the stop loss to the entry price, so that at worst you locked in your 0.15% gain

  • @stefanfredin7120
    @stefanfredin7120 3 роки тому +12

    Not sure if I'll ever have the time to learn enough python to do something like this. But watching you TEACH was great! You are very instructive and have a calming way of teaching. I subbed for future me's sake!

    • @Algovibes
      @Algovibes  3 роки тому

      What an awesome comment. Thank you buddy.

  • @hoapham7389
    @hoapham7389 3 роки тому +1

    Why weren't you shown in the search when I was searching for these kinds of tutorial?! Only for half years later you appear by chance! better later than never! subscribed!

    • @Algovibes
      @Algovibes  3 роки тому +1

      Thank you so much for your sub man. That's a huge help for me!

  • @brazed420
    @brazed420 3 роки тому +126

    When Musk was tweeting about doge a few months ago we had a guy make a discord bot that would @ us every time he tweets

    • @Algovibes
      @Algovibes  3 роки тому +3

      That is awesome! 😄

    • @ua6919
      @ua6919 3 роки тому

      Link please 😃

    • @brazed420
      @brazed420 3 роки тому +1

      @@ua6919 Its been deleted/offline ever since he stopped being able to push doge up

    • @ua6919
      @ua6919 3 роки тому

      @@brazed420 oh np. Great idea anyway, thanks for sharing

    • @deej3916
      @deej3916 3 роки тому +1

      The fact that I just did the same makes me want to befriend you 🤣

  • @AhmedMohammed-zy3pf
    @AhmedMohammed-zy3pf 2 роки тому +2

    From a non coder this is simple and amazing thank you. Subscribed

    • @Algovibes
      @Algovibes  2 роки тому

      Thanks a lot for subscribing mate :-)

  • @martingiannechini1
    @martingiannechini1 3 роки тому +17

    Hi. Thanks for this video, it’s really interesting indeed. As you requested feedback, please keep providing real world examples like this but as you said maybe coding a bit more difficult (and probably reliable) trading strategies such as MACD crossover. I saw your video on macd but would be good to see one example using macd in real time to place trades. Loving your channel so far!

    • @Algovibes
      @Algovibes  3 роки тому +3

      Hi buddy, thanks a lot for your feedback.
      I already did that. Be invited to check out the cryptobot playlist.

    • @joshuasmith2450
      @joshuasmith2450 3 роки тому

      isn't MACD proven to be unusable nowadays? At least on the stock market I believe it is due to automated trading funds saturating.

  • @AhmedIkram
    @AhmedIkram 3 роки тому +1

    one of the best algo python youtube channel

    • @Algovibes
      @Algovibes  3 роки тому +1

      Thank you my friend. Your comment means a lot to me ❤️

  • @slaxblake
    @slaxblake 3 роки тому +17

    I try making it in binance but 2 things complicated the thing:
    1) binance fee (so when you buy 0.001, you instead get 0.000999, etc.)
    2) binance only allowing to buy/sell a round number (leaving some crypto behind when selling)

    • @averagegymenjoyer
      @averagegymenjoyer 3 роки тому +3

      well IF you have the funds you can enlarge your positions or you can washtrade up to VIP Tier 2 or 3

    • @Algovibes
      @Algovibes  3 роки тому +7

      First thing you need to do is to change the fee currency to BNB. It just doesn't make sense to not do so. It's cheaper.
      And you won't have that problem anymore.
      Regarding the second question: In this video I was working with quantities, so that shouldn't be an issue. Could you elaborate?

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

    This is what I have been looking for. Tired of 3rd party software! Thank you so much.

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

      Welcome buddy, be invited to check out my other stuff! Cheers :-)

  • @nolan2736
    @nolan2736 3 роки тому +29

    Hi, to make sure I understood, we have to run the 'data fetch' script in parallel of the stragety script ?

    • @gabrielsanches9296
      @gabrielsanches9296 3 роки тому +2

      Yeap

    • @Algovibes
      @Algovibes  3 роки тому +3

      Exactly. But btw if you don't feel comfortable with SQL I also build some examples without that. Be invited to check out the cryptobot playlist!

  • @ameenpondy
    @ameenpondy 2 роки тому +1

    Going to be 1 million views. Congratulations...
    I'm happy for you.. Keep going.. Cheers

    • @Algovibes
      @Algovibes  2 роки тому

      Thanks Ali for your support and positivity. Means a lot to me!

  • @sayemmohammad6450
    @sayemmohammad6450 3 роки тому +28

    Thank you very much man for saving my ass. I didn’t have any idea how to do my final project in one of my courses. Your videos helped me to land some! Thanks a ton!

    • @Algovibes
      @Algovibes  3 роки тому +1

      Awesome to hear! Thank you very much for your kind comment :-)

    • @syedadil7858
      @syedadil7858 3 роки тому

      College?

    • @sipanaskar14
      @sipanaskar14 3 роки тому

      @@Algovibes Hey, have you thought about applying some kind of maschine learning algorithm to the Trading information coming from Binance to maximize profit

  • @JoeSoap-z2k
    @JoeSoap-z2k Місяць тому +1

    You have a great teaching manner, details large and small are provided about every thing you demonstrate. It means we can follow your thought processes and implementation without too much head-scratching. and background reading. Keep up the good work, your style makes it a pleasure to improve my own skills.

    • @Algovibes
      @Algovibes  Місяць тому +1

      thank you mate, your comment means a lot to me! Great attitude

  • @kelliclark2737
    @kelliclark2737 2 роки тому +3

    This is fantastic!!! I’ve only done a small bit of coding and so am still quite new to it and you have spelled this out so perfectly and explained everything so well, it has fully engaged me and inspired me!! Thank you so much!! And for myself, I love the fact that it’s crypto!! :)

    • @Algovibes
      @Algovibes  2 роки тому +2

      Hi Kelli, appreciate both your positivity and your kind words. Be invited to check out the other videos in the cryptobot playlist:
      ua-cam.com/play/PL9ATnizYJ7f8_opOpLnekEZNsNVUVbCZN.html

  • @SouravTrading_Investing
    @SouravTrading_Investing 3 роки тому +1

    This video is very helpful for me. Cleared many of my doubts for live price trading through web socket data stream.
    Please make this kind of video. Love ❤ from 🇮🇳.

    • @Algovibes
      @Algovibes  3 роки тому

      Happy to hear that. Thanks for watching and your comment. Love and all best wishes back to India ❤️

  • @patrickwalsh1154
    @patrickwalsh1154 3 роки тому +9

    Hi Algovibes! I really enjoyed your video! I really liked how well you explain everything and make it easy to understand! I believe cryptocurrency is the future and am fascinated with algorithmic crypto trading! Please keep up the good work! I have watched a lot of videos on the subject using python and yours are the best I think! Would you consider making a trading bot video that uses other types of indicators such as MACD or CCI?

    • @Algovibes
      @Algovibes  3 роки тому +4

      Hi buddy, thank you very much for your kind comment :-)
      Yes, I will and I partly already have.
      Be invited to check this out:
      ua-cam.com/video/nQkaJ207xYI/v-deo.html

  • @BorsaTrader
    @BorsaTrader 3 роки тому +1

    Surely German engineer, cos there is no other can explain as this! I respect! (Sorry if you are Austrian) i respect the nation who servicing the quality to the world! Dicipline and all.

    • @Algovibes
      @Algovibes  3 роки тому

      Not an engineer :D Anyhow: Thanks a lot for your kind words mate.

  • @MRX_111
    @MRX_111 2 роки тому +5

    How to place a future prepetual order using python

  • @mohammedhijari7325
    @mohammedhijari7325 2 роки тому +1

    Hello litlle man, been looking for while for a good video about trading bots,and really the first time i understand how everything works. Keep up the good work

    • @Algovibes
      @Algovibes  2 роки тому

      Thanks a lot Mohammed!

  • @bruhhbruhh7717
    @bruhhbruhh7717 3 роки тому +4

    Hi, i have a lil problem with your while true on the storing data, when i execute the code, between each frame i have like -100ms and at 80~100 frames stored i have an error message "KeyError: "None of [Index(['s', 'E', 'p'], dtype='object')] are in the [columns]"

    • @Algovibes
      @Algovibes  3 роки тому +1

      Yep, please check this video to fix that:
      ua-cam.com/video/OX5eDJDtqhc/v-deo.html
      And also check my pinned comment.
      I would be grateful if you give me feedback if this is working out for you!

  • @hankobrat
    @hankobrat 3 роки тому +1

    First time I watch your videos. Love them. Subscribed.

    • @Algovibes
      @Algovibes  3 роки тому

      Thank you buddy ❤️

  • @yohannescahyadi7670
    @yohannescahyadi7670 3 роки тому +4

    Hi thank you for the awesome video! I want to ask something:
    when we run the print(msg) command ( @5:17), you explain that we only take the 's' (symbol), 'p' (price), and 'E'(time). Can you help explain what the other outputs are? ('t', 'q', 'b', 'a', 'T')

    • @Algovibes
      @Algovibes  3 роки тому +3

      Hi buddy, thanks a lot for your kind comment. Appreciate it :-)
      Your question is answered here:
      github.com/binance/binance-spot-api-docs/blob/master/web-socket-streams.md
      Just scroll down to Trade streams.

  • @javierortizmir7873
    @javierortizmir7873 2 роки тому +1

    I am already subscribed!!! long ago, your videos are amazing

    • @Algovibes
      @Algovibes  2 роки тому

      Awesome man, thanks a lot for your support!

  • @cuteypatootie
    @cuteypatootie 3 роки тому +17

    I love topics like this specifically - coding and crypto! And Python!

    • @Algovibes
      @Algovibes  3 роки тому

      Me too :D Awesome to share my interest with other people. Thanks for your feedback!

  • @avijain2807
    @avijain2807 3 роки тому +2

    That's way tooo much interesting keep making video on this topic please...

    • @Algovibes
      @Algovibes  3 роки тому +1

      Thanks for your feedback buddy :-)

  • @ludwigmatheus762
    @ludwigmatheus762 3 роки тому +3

    Hello professor, another question, can you download the information from binance in longer periods, for example every 1 min? what would be the change in the code? if it works, how can it be stoppep manually?
    And professor, reading one of the previous questions about the repetition of records that occurs in the "while" loop in the database, you said that we could use an "if", could you kindly write the syntax of this "if"? Thank you!

    • @Algovibes
      @Algovibes  3 роки тому +1

      Hi student :D
      Jokes aside.
      Yes you can do that with an API call. I have done that in my newest video. The stream is always grabbing realtime data.
      Instead of an if I would probably just set a waiting time of - say - one second in the while loop to avoid this "overflow".

  • @ngsa9677
    @ngsa9677 3 роки тому +1

    Binary Trading is very hard for me...too much sentiments to overcome.
    I have been searching for an ideal bot, especially one I can tinker with code.
    Great tutorial.
    Is it Interesting???
    I totally absorbed it. Great tutorial along with simple explanation.
    Now I can start coding my own bot. Thank you very much. Any improvements you make, I would like to follow.

    • @Algovibes
      @Algovibes  3 роки тому

      Thank you so much for your kind words. Really appreciate them!

  • @someone-eo1zf
    @someone-eo1zf 3 роки тому +30

    I have never coded or done something like this in my life but I've been playing with crypto and stocks for awhile now, how would one like me get into something such as this? Looks like it could be worth getting into

    • @EmannuelleAlpha
      @EmannuelleAlpha 3 роки тому +9

      Try to learn programming or even data science.. we (data scientist) deal a lot of stuffs with big data and how can we me make something that can help us on a daily basis, pulling an insight from a data, interpreting a model, and etc. You can learn Data Analytics using Python, or even something else like programming for data scientist or even machine learning.
      I hope it answers you.

    • @Algovibes
      @Algovibes  3 роки тому +7

      I have some resources on my channel like both the Python Introduction playlist and Python for Finance playlist and I am talking about how I personally learned Python here - maybe this is helping you:
      ua-cam.com/video/qCZiENV83rE/v-deo.html
      In general the most important thing is to get started in my experience 😛

    • @dcode863
      @dcode863 3 роки тому

      Lol then ur gonna have to start from scratch, learn python basics before doing something as in depth as this

  • @marcpuls4798
    @marcpuls4798 3 роки тому +1

    Thanks!

    • @Algovibes
      @Algovibes  3 роки тому

      Thank you and thanks a lot for using the Super Thanks feature. Very appreciative!

  • @Christian_Ky
    @Christian_Ky 3 роки тому +1

    @28:09 How much profit would it be + fees? 47732,94 to 47828,39
    = 0,19% profit + 0,001 Fees = 0,001 btc * 0,19 % = 0,00019 profit - 0,00000019 fee (0,001% from 0,00019 profit) = 0,00018981 btc profit? That makes sense?

    • @Algovibes
      @Algovibes  3 роки тому +1

      Fees are shown in BNB as you save some commission if you use BNB for commission. You will find the commission inside the buying and selling statement / print out.

  • @theWSt
    @theWSt 2 роки тому +3

    This topic is super intersting! I subscribed only because you're building a trading bot. ;-)
    But one question: Why do you store the live price data? I'm not a Python pro, but I would use some queue datastructure to have a buffer/cache of the let's say last 5 minutes (or longer, depending on the strategy). But storing price data in an SQLite database on harddisk doesn't make sense, not even for backtesting. Even for the latter one usually works with chart data (candles).

    • @Algovibes
      @Algovibes  2 роки тому

      Hey Wolfgang, thanks a lot for your comment. I use SQL as a storage for price data to avoid API calls getting historical data. You can store the prices in memory (e.g. in an array) but this would crash when taking e.g. 100s of cryptos (as I did in some follow up videos). If you have an efficient way to cashe web socket data my ears are widely open :-)

  • @juandiegorodriguez7583
    @juandiegorodriguez7583 2 роки тому +1

    11:00 I ran that code in my visual studio code and it works for 2 minutes and stop. You know why this happens?

  • @iambonmucho
    @iambonmucho 3 роки тому +47

    Imagine you forgot to stop the script executing and you become accidentally a millionaire overnight.

    • @Algovibes
      @Algovibes  3 роки тому +2

      :D :D

    • @seggy93stormpersonelchanne58
      @seggy93stormpersonelchanne58 3 роки тому

      Technical it isn't possible as this is not really much of real case. Especially the data gather is just for researches. If something like bitcoin just for investment or something like that, that is mostly not possible unless the data and thing can been seen and proved but because this is digital base, therefore no way those can earn money.
      However, using this cryptocurrency in another way like using that coin for your all personal information, all sources just like acting as your ID, bank account, insurances in one place, adding the real made machine for verification to do anything else. This is is the way they should go for the future. But not right away.
      Also there will be an unexpected idea happen overtime so for coming with new methods to prove legitimate and acceptable in a wide range that should be possible. As I can see those thing can use more than that. Not just some business trading or something like that, not the kind bitcoin we are looking for but with different motives.

  • @moade333
    @moade333 3 роки тому +1

    How the fuck this guy getting just 7000 subscribers???!!!!!.
    I already made bot works more or less like this, but database and analyzing data is something else.
    Good work mate 👌

    • @Algovibes
      @Algovibes  3 роки тому

      Hi buddy,
      I really appreciate your kind words :-) Thanks a lot for watching!

  • @ricardoandresleongomez5267
    @ricardoandresleongomez5267 3 роки тому +5

    Great work, easy to follow and easy to learn. I have a question. On the while loop when getting the information of the currency by second, after an n number of iteration the code starts showing an error --> {'e': 'error', 'm': 'queue overflow. message not filled'}. It stops getting information from the server, any idea of how to solve it or what would be the reason for the error?

    • @Algovibes
      @Algovibes  3 роки тому

      Reason for the error is a queue overflow. I solved it here:
      ua-cam.com/video/OX5eDJDtqhc/v-deo.html
      Would be awesome if you provide me a feedback if this approach is working out for you.

  • @franciscoronci
    @franciscoronci 3 роки тому +1

    I have a problem in minute 4:30 with de Awaits, Python tells me ""await" allowed only within async function Pylance" what can I do? Thank you!

    • @Algovibes
      @Algovibes  2 роки тому +1

      Was going into details on this error in this video:
      ua-cam.com/video/nQkaJ207xYI/v-deo.html
      I also recommend to check out the newer videos in the cryptobot playlist. Using an easier approach there!

    • @franciscoronci
      @franciscoronci 2 роки тому +1

      @@Algovibes thank you very much!

  • @RafeedChowdhury
    @RafeedChowdhury 3 роки тому +8

    Can we see the result of the strategy another time as bitcoin is in downtrend now. Of course continue with the crypto! I'm with you

    • @Algovibes
      @Algovibes  3 роки тому +1

      It actually was a bad time to trade on that day :-D Anyhow thank you very much for your feedback and your support!

  • @ZonDhay
    @ZonDhay 3 роки тому +2

    "await" allowed only within async function 4:38 ):

    • @Algovibes
      @Algovibes  3 роки тому +1

      Yep. It's because you are not using Jupyter.
      Please check out this one:
      ua-cam.com/video/nQkaJ207xYI/v-deo.html

  • @jabetancur12
    @jabetancur12 3 роки тому +3

    Thank you, great video!
    Do you know this error is showed?
    {‘e’: ‘error’, ‘m’: ‘Queue overflow. Message not filled’}

    • @Algovibes
      @Algovibes  3 роки тому

      Thanks for watching! This error is coming up for some people. I don't have this problem but I am still investigating on this issue.

    • @goldenbeast5160
      @goldenbeast5160 3 роки тому +1

      yes me too

    • @goldenbeast5160
      @goldenbeast5160 3 роки тому +1

      I have tried making queuesize to 10000 but still getting this error

    • @Algovibes
      @Algovibes  3 роки тому

      @@goldenbeast5160 Can you reduce the queusize to 100 and give me feedback again?

    • @jdclanc
      @jdclanc 3 роки тому

      My unsophisticated solution was to add error handling using try and except For example, try: the code except: print("Invalid Data") so if the API errors it just tries again

  • @markk4203
    @markk4203 3 роки тому +1

    At time index 19:05, it appears last_valid_index() is an attribute of cumret? Where does that come from? Thanks!

    • @Algovibes
      @Algovibes  3 роки тому +1

      Cumret is a series (pandas object) and we are just applying a pandas function on it.
      Is this answering your question?

    • @markk4203
      @markk4203 3 роки тому +1

      @@Algovibes I did not realize that was a pandas function. Thanks!

  • @sweetphilly2
    @sweetphilly2 3 роки тому +3

    Couple of questions:
    - Is this possible with Webull? Not sure if they have API to use but I figure I could use something similar to what you did at the very least.
    - Is there no request limit(s) for the API?
    - Any way to increase the timeframe?
    Well explained video btw. SUBSCRIBED!

    • @Algovibes
      @Algovibes  3 роки тому

      Thanks dude! :-)
      Didn't test out webull yet. There is a request limit for the API!
      What exactly do you mean with increasing the timeframe?

    • @sweetphilly2
      @sweetphilly2 3 роки тому

      @@Algovibes so if I'm not mistaken this captures every second of movement. What if I wanted every 10mins or so?

  • @eduardob5463
    @eduardob5463 3 роки тому +2

    Very very veery interesting! Thanks for share, very well explained! See you in a next video! 👌

    • @Algovibes
      @Algovibes  3 роки тому +1

      Thank you buddy :-)
      You are kindly invited to check out my cryptobot playlist, maybe you will find another relevant stuff for you.
      And looking forward to see you as well :-)

  • @kia4now
    @kia4now 3 роки тому +4

    Definitely interested in your videos, you have a very clearn and easy to understand way of teaching.
    I have a question for you, if I wanted to run a strategy with multiple coins, is it a waste of resources to have the websocket save data for the whole market?
    Also what do you think the best way to implement manual controls would be, a simple example an on/off, would running a seperate process on telegram or discord be okay. Or is there a better way in your opinion?
    Lastly, I would like to thank you for this content. It's truly amazing

    • @Algovibes
      @Algovibes  3 роки тому +4

      First of all thanks a lot for your kind words man!
      Secondly I already have content on these questions.
      Multiple symbols using BSM:
      ua-cam.com/video/C-SL4Tf25eg/v-deo.html
      Multiple symbols using WebSocket and csv storage:
      ua-cam.com/video/mDNIAkEZChg/v-deo.html
      Multiple symbols using WebSocket and SQL (also manual choice of buying as these are just signals)
      ua-cam.com/video/8p240qonj0E/v-deo.html
      Would be happy for a feedback below these videos! :-)

    • @kia4now
      @kia4now 3 роки тому +1

      @@Algovibes thank you so much for your detailed responses. I plan on going through all your videos one by one regardless.
      Im currently stuck in this video so I need to master this one first, do you manage a community by any chance?

  • @wickedgummybear3104
    @wickedgummybear3104 3 роки тому +3

    Hope you keep doing these videos man! Love following this series

    • @Algovibes
      @Algovibes  3 роки тому

      Thanks for the feedback buddy. There surely will be more videos on cryptobots. Be invited to check out the videos in the cryptobot playlist until then :-)

  • @alugunandan
    @alugunandan 2 роки тому +1

    you are so helfull man god bless you love from india

    • @Algovibes
      @Algovibes  2 роки тому

      Thanks a lot for your kind words Nandan! Love back to 🇮🇳

  • @remi_20
    @remi_20 3 роки тому +3

    Great video. Also the sqlite incorporation is a handy tip.
    According the documention a binance api stream / websocket disconnects after 24h, what's the best way to deal with this? Since the last thing you want is missing data in your dataframe when applying calculations like moving averages and stuff.

    • @Algovibes
      @Algovibes  3 роки тому +2

      Thanks for your comment mate :-)
      That's a very good point.
      There are some ways to deal with that: Incorporate a time tracker, so that after 24h a new connection is triggered or conditional check for a signal (pong) from the server. I will see that I am covering this problem in future videos e.g. when I am running a longer term strategy in the cloud.

  • @loryo80
    @loryo80 2 роки тому +1

    Thank you so much, you tutorial is perfect to start with in algorithmic trading

    • @Algovibes
      @Algovibes  2 роки тому +1

      Thanks for watching mate :-)

  • @issarlk
    @issarlk 3 роки тому +3

    Nice explanation, so small too. A binance bot I did ended up using agents and coroutines ; I'm on the "why make it simple if you can make it complicated" side >_>

    • @Algovibes
      @Algovibes  3 роки тому

      Hi mate thanks a lot for your kind comment. Be kindly invited to check out my videos in the cryptobot playlist. I am covering different approaches there.

  • @BorisenkoV89
    @BorisenkoV89 3 роки тому +2

    Thank you very much, very cool video. Please continue to create similar videos related to the binance API. Like put and subscribed!

    • @Algovibes
      @Algovibes  3 роки тому

      Thanks mate, really appreciate your comment :-)
      I just published one some days ago using a reversal and Trailing Stop Loss. Be kindly invited to check that out and let me know what you think:
      ua-cam.com/video/V6z1ME3-0_I/v-deo.html

  • @themathsprofessor6962
    @themathsprofessor6962 3 роки тому +11

    Great content, I'm not confident enough yet to implement something like this myself, but this is really helpful. Any chance you could post your code somewhere please?

    • @Algovibes
      @Algovibes  3 роки тому +3

      Thank you buddy! :-)
      You will be in some time for sure!

    • @ryanm7263
      @ryanm7263 3 роки тому +2

      You could practice writing your own trading bot using dummy data. Instead of placing real buy and sell orders through the API, just add and subtract integers from local variables. There will be some discrepancy given that prices move between API calls, but at the very least you'll be able to formulate an algorithmic strategy before taking it live. Once live, keep the values small as you fine tune, then once confident you can ramp it up. Good luck.

    • @thanksas
      @thanksas 3 роки тому

      @@ryanm7263 am i stupid here or its not working? i used with my own binance api keys and bot doesnt buy or sell

  • @chanxo643
    @chanxo643 3 роки тому +1

    Bro, this video is the goat!

    • @Algovibes
      @Algovibes  3 роки тому +1

      Thank you buddy :-) Happy you like it. I have a whole playlist on cryptobots. Be kindly invited to check them out and let me know what you think!

    • @chanxo643
      @chanxo643 3 роки тому +1

      @@Algovibes thank you! Will do!

  • @tonymudau3005
    @tonymudau3005 3 роки тому +4

    Amazing stuff... more content like this please!!

    • @Algovibes
      @Algovibes  3 роки тому +1

      Thanks for your feedback mate, appreciate it!

  • @akshaykumble540
    @akshaykumble540 2 роки тому +1

    For your analytics, subscribed

    • @Algovibes
      @Algovibes  2 роки тому +1

      Thanks buddy! :-)

    • @akshaykumble540
      @akshaykumble540 2 роки тому

      @@Algovibes need your constant guidance as I've started algo few weeks back

  • @ryanlovesyoukinda
    @ryanlovesyoukinda 3 роки тому +6

    Hi - Thank you for your content. When I execute the await socket loop, the prices are recorded sporadically. Sometimes its the same time snapshot, but others it takes a few minutes. Why is this happening and is there a better way to receive this data?

    • @Algovibes
      @Algovibes  3 роки тому +1

      Thanks for watching! Few minutes shouldn't happen at all. As some people have issues with this approach I will probably cover an alternative in one of my next videos.

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

    you are a great teacher
    in my opinion you might add some more Detailed explanations about what the code actual does
    the linkage between two or more different code files and so on
    just like i prompt gpt "like a child"

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

      Thank you so much! Be invited to check out my other stuff, I hope I improved since then :-)

  • @Kacisse
    @Kacisse 3 роки тому +6

    Nice video !
    Is it necessary to use a SQL data base or can we just store values in arrays or something ? What would be the benefit of the SQL database ? (I'm not initially a coder so probably a noob question :) )

    • @Algovibes
      @Algovibes  3 роки тому +4

      Thanks a lot for your kind comment :-)
      It's actually a very good question! It is not necessary, I just wanted to implement a DB in live trading. I have other videos where I am not using a DB.
      Be kindly invited to check out the cryptobot playlist.

    • @gabrielceolato2
      @gabrielceolato2 3 роки тому +1

      Depending on the dataset size array will just explode your memory

    • @julianusiv
      @julianusiv 3 роки тому +2

      @@gabrielceolato2 that and a database is persistent across runtimes, contrary to lists or arrays

    • @arorayugal
      @arorayugal 3 роки тому +1

      You can store it in memory db too like memcached or redis, read/write will be slightly faster then sql

  • @alexander91381
    @alexander91381 3 роки тому +2

    Thank you!! Please continue the series!

    • @Algovibes
      @Algovibes  3 роки тому

      Hi mate, thank YOU for watching :-) There are a lot more videos on the cryptobot playlist. Be kindly invited to check them out. Anyhow I am planning on some more crypto vids.

  • @roberto6698
    @roberto6698 3 роки тому +4

    Hi, just yerderday I was wondering how feasible something like this could be!
    I'll probably end up doing something similar, but I'd first have it running for some time without money to analize the results and see how the bot would behaved in a real environment.
    To do so, is there a way I can implement real fees and other issues I might incur into? For example, I'm talking about the inability to buy the fraction I want because it would be too small

    • @Algovibes
      @Algovibes  3 роки тому +2

      Hi buddy, thanks for your comment!
      Can't you just implement the buying logic in the data stream and add the potential profit to an array or similar?

  • @pietrolenzi5934
    @pietrolenzi5934 3 роки тому +2

    Hi, I was wondering: if you use 'if cumret[-1] > entry' and entry is set as a positive value "0.001" we are actually entering when price has just risen. Shouldn't we use 'if cumret[-1]

    • @Algovibes
      @Algovibes  3 роки тому +4

      Thanks for your kind words man :-)
      Just that we are on the same page: But that should be the goal right? So we want to enter the trade when the asset is rising. That's a "momentum" strategy not a reversal.

  • @elinversordepastos3204
    @elinversordepastos3204 9 місяців тому +1

    Excellent work, mate. TY VM

    • @Algovibes
      @Algovibes  9 місяців тому

      Thx for matching my man

  • @Receive_
    @Receive_ 2 роки тому +1

    Why await socket not working in vs code and working in jupyter? How to correctly write function while in the first bot using vs code?

    • @Algovibes
      @Algovibes  2 роки тому

      Hi Sam, please check the pinned comment. Solved it there. Cheers!

    • @Receive_
      @Receive_ 2 роки тому

      ​@@Algovibes Thanks for your time and your work!

  • @jeanfonssedeporte3158
    @jeanfonssedeporte3158 3 роки тому +1

    Really good quality video, I'm watching more and subscribing ! Also I'm interested in crypto trading, not equity trading :)

    • @Algovibes
      @Algovibes  3 роки тому

      Hi mate, thanks a lot for your comment and support. Really appreciate it :-) I will do both btw.

  • @philippeberl897
    @philippeberl897 3 роки тому +1

    Hi, I have a problem. When I execute the Live Data Script, I get 15 times the same value for the exact same time. So it prints for example "0 BTCUSDT 2021-10-21 11:05:23.645 65652.82" 15 times in a row. This happens all the time and I don't know why it happens. Maybe you or someone can help me. Thanks

    • @Algovibes
      @Algovibes  3 роки тому

      Could you try out the approach shown in this video and give me feedback please?
      ua-cam.com/video/OX5eDJDtqhc/v-deo.html

    • @philippeberl897
      @philippeberl897 3 роки тому

      @@Algovibes tried it an works like a charm! thanks! keep up the great work.

  • @ndev1666
    @ndev1666 3 роки тому +1

    Good work man, very interesting contents. 👏👏👏👏👏

    • @Algovibes
      @Algovibes  3 роки тому

      Thank you very much for your feedback! :-)

  • @maurosogni7419
    @maurosogni7419 2 роки тому +1

    Man you are freaking awseome - thank you for the lessons

  • @adrianrubiojimenez8229
    @adrianrubiojimenez8229 2 роки тому +1

    Very useful videos. I was exactly looking for this kind of techniques mixing data analysis ideas and simple investment strategies. Thanks a lot! I am waiting for the next related videos you will make:)

    • @Algovibes
      @Algovibes  2 роки тому

      Hey Adrian, thanks a lot for your comment. Be invited to check out the Crypobot playlist - I already built a lot of stuff there.

  • @sebiiopawesome8040
    @sebiiopawesome8040 3 роки тому +1

    I really like your content and I just subscribed to your channel. Please continue with the videos for cryptocurrencies.
    Are you by any chance from Austria or Germany? Your pronounciation sounds like it.
    Cheers!

    • @Algovibes
      @Algovibes  3 роки тому

      Hey man, thank you so much for subscribing and your kind comment. That is a huge help for me :-) I am from Germany 🇩🇪 I am working on my pronunciation. It was bad in this video but I wanted to record it in one round :D

    • @sebiiopawesome8040
      @sebiiopawesome8040 3 роки тому +1

      @@Algovibes Nein die Aussprache und dein Vokabular sind sehr gut, aber man bekommt diesen Akzent einfach sehr schwer weg. Mach weiter so, der Kanal ist richtig lehrreich!
      Lg aus Österreich

  • @gianlucamessina2231
    @gianlucamessina2231 2 роки тому +1

    Great video. Don't forget to set open_position = False after selling

  • @oczko1986
    @oczko1986 3 роки тому +1

    on 10:30 when i try to run i get error "NameError: name 'createframe' is not defined", is it because its derfinied ater the while True ?

    • @oczko1986
      @oczko1986 3 роки тому +1

      ok did it with def main():

    • @Algovibes
      @Algovibes  3 роки тому

      yep, it is just a function outside the strategy.

  • @psii
    @psii 2 роки тому +1

    Nice tutorial!
    Hard to find such tutorials these days.

    • @Algovibes
      @Algovibes  2 роки тому +1

      Thanks you very much Prajjwal,
      happy to read that :-)

  • @andremtvianna8331
    @andremtvianna8331 3 роки тому +1

    Thanks

    • @Algovibes
      @Algovibes  3 роки тому

      Thanks for watching mate and also thank you very much for using the Super thank feature :-)
      I guess greetings to Australia 🇦🇺?

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

    I would be more glad if you did this in node javascript. Oops, seems fun. Nice session!

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

      Thanks mate. Happy to enjoyed :-)

  • @blasdelezo8396
    @blasdelezo8396 2 роки тому +1

    What if instead of ask is a bid?. How to use the Ehlers transform ?

  • @stefandemerov8423
    @stefandemerov8423 3 роки тому +10

    The "await socket.__aenter__()
    msg = await socket.recv()"
    piece doesn't seem to be getting live data every second, but seems to flood the sql database with frames with the same (or very similar) timestamp over and over again. Any idea how to fix this?
    sample data:
    symbol Time Price
    0 ADAUSDT 2021-10-09 11:51:18.920 2.271
    symbol Time Price
    0 ADAUSDT 2021-10-09 11:51:20.398 2.272
    symbol Time Price
    0 ADAUSDT 2021-10-09 11:51:21.131 2.271
    symbol Time Price
    0 ADAUSDT 2021-10-09 11:51:22.043 2.272
    symbol Time Price
    0 ADAUSDT 2021-10-09 11:51:22.387 2.272
    symbol Time Price
    0 ADAUSDT 2021-10-09 11:51:22.387 2.272
    symbol Time Price
    0 ADAUSDT 2021-10-09 11:51:22.531 2.271
    symbol Time Price
    0 ADAUSDT 2021-10-09 11:51:22.531 2.271
    symbol Time Price
    0 ADAUSDT 2021-10-09 11:51:22.531 2.271

    • @Algovibes
      @Algovibes  3 роки тому +3

      Uff a lot of likes on this one. Seems you are not the only one having this problem. Apologies for that!
      First trivial way to solve it: Don't work with a SQL database. I have other videos in the cryptobot playlist where I am covering strategies without this step - it is just an (unnecessary) additional step for someone asking to implement a Database in live trading.
      Secondly to fix the flood you can just implement a simple if statement checking the new timestamp being "really" a new one by just checking if its later than the one before.

    • @stefandemerov8423
      @stefandemerov8423 3 роки тому +1

      @@Algovibes Yeah, dont think the SQL storing is at fault. Also implemented the "check if same timestamp" method, but sometimes the timestamp differs by only a few miliseconds and its no good. Anyway, just saw your new vid about a bot, will try that one as well. Also, thank you so much for showing us this, me and a colleague of mine attempted to build something similar a year ago, but kinda left it unfinished.

    • @kia4now
      @kia4now 3 роки тому

      @@Algovibes I am having a lot of errors with the database, basically it stops adding when I turn on the second script, idk what the best place to print the errors it's pretty long.
      You mentioned not using a database, but wouldn't that cause memory issues? Is there an alternative?

  • @alikadivar3168
    @alikadivar3168 3 роки тому +2

    Hi I got an error like: None of the indexes are in column and even I added if msg: frame = createframe(msg)

    • @Algovibes
      @Algovibes  3 роки тому

      Hi mate, can you check the approach used in my more recent videos? Would appreciate a feedback.

  • @mariogreco729
    @mariogreco729 3 роки тому +1

    Liked and subscribed! Excellent work, thanks for sharing

    • @Algovibes
      @Algovibes  3 роки тому

      Awesome, thanks a lot for subscribing! :-)

  • @vikashvashishat4011
    @vikashvashishat4011 3 роки тому +1

    when fetch the data and save into db after 70 or 80 interval its stops with key eror in def createframe line 3

    • @Algovibes
      @Algovibes  3 роки тому

      Hi mate, please check out the approach in my newer videos.
      E.g. this one:
      ua-cam.com/video/OX5eDJDtqhc/v-deo.html
      An alternative would be using a WebSocket stream, doing that in this one here:
      ua-cam.com/video/mDNIAkEZChg/v-deo.html

  • @walduss7939
    @walduss7939 3 роки тому +1

    Thanks for these videos.
    Waiting the next ones will be so useful for me as well.

    • @Algovibes
      @Algovibes  3 роки тому

      Welcome :-) There will be surely more on crypto. Until then I set up a cryptobot playlist.

  • @buddyguy6816
    @buddyguy6816 3 роки тому +1

    Excellent video! Please keep up with the good work! Thank you !

    • @Algovibes
      @Algovibes  3 роки тому

      Thank you - literally - Buddy :-)

  • @jan-michaelluis2252
    @jan-michaelluis2252 3 роки тому +1

    I love this cannel !!

    • @Algovibes
      @Algovibes  3 роки тому

      And this channel loves you for your kind comment ❤️

  • @arshadzoom1
    @arshadzoom1 2 роки тому +1

    Thank you for the Video.. Really Helpful!! Please do more videos on same topics.. :)

    • @Algovibes
      @Algovibes  2 роки тому

      Thanks for watching man. I have a lot of similar videos with different approaches in my cryptobot playlist. Be kindly invited to check that out.

  • @kurtschatteman5193
    @kurtschatteman5193 3 роки тому +1

    Thanks a lot for this very interesting video combining Python and Crypto.
    You explain it well and your code is clean.
    Just subscribed :-)
    Catching up on your previous content will take a while, but I think it's worth it.

    • @Algovibes
      @Algovibes  3 роки тому

      Thank you very much for subscribing and your kind words!
      Looking forward to know what you think about the other vids :-)

  • @nishchal_gupta
    @nishchal_gupta 3 роки тому +1

    Really loved this simple explanation .. would cover how we can create flash loan transactions

    • @Algovibes
      @Algovibes  3 роки тому

      Thanks a lot buddy. Didn't have exposure to flash loan yet.

  • @sajjadtabatabaei2625
    @sajjadtabatabaei2625 3 роки тому +1

    very nice and thank you for sharing your knowledge...I think trading with cryptocurrency is not well known yet. But this will definitely change over time and your tutorials are unique in this case

    • @Algovibes
      @Algovibes  3 роки тому

      Thanks a bunch for your feedback! Appreciate it :-) Either it will change or it will burst, lets see :-D

  • @ismaelconde8457
    @ismaelconde8457 2 роки тому +1

    Excellent video thanks so much. Very good content

    • @Algovibes
      @Algovibes  2 роки тому

      Thanks a lot Ismael,
      Happy to read that!

  • @JVkings7
    @JVkings7 3 роки тому +1

    Thanks man this is really cool. I'm planning to implement an auto regressive linear regression algorithm to decide when to buy. We'll see how that goes but thanks again!

    • @Algovibes
      @Algovibes  3 роки тому

      Thanks a lot. Would be quite curious about your results! Feel free to share them!

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

    Truly a great content and a great explanation.
    Thanks a ton... 🙂
    (A small request)
    It would be really helpful if u could show how to trim out older data from sql table (multiple cryptos if possible) inorder to avoid huge loads of data. 😀

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

      Hi buddy, thanks a lot.
      Check out this one, this is taking care of exactly that:
      ua-cam.com/video/n0d7kSGwskY/v-deo.html
      You can also implement a sql import/export within this structure.
      Cheers!

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

      @@Algovibes thanks for reply mate.
      Let me check out the video in the link.
      Keep up ur work.
      Make unlimited money :-D

  • @bresalbert
    @bresalbert 3 роки тому +1

    This is Mega interesting! Keep it going man

    • @Algovibes
      @Algovibes  3 роки тому

      Thanks for your feedback :-)
      Be invited to check out the other vids in the cryptobot playlist!

  • @hardikpatel5916
    @hardikpatel5916 3 роки тому +1

    Very very good video please make more video on more strategy automated
    Thank-you very much

    • @Algovibes
      @Algovibes  3 роки тому

      Thanks buddy, there are some more videos in the cryptobot playlist but I surely do some more of them :-)

  • @MRX_111
    @MRX_111 3 роки тому +2

    Will this bot auto trade(I mean buy crypto)even when my computer if switched off (means after closing python file)

    • @Algovibes
      @Algovibes  3 роки тому

      Nope! Therefore you would have to deploy this bot in a cloud. I am planning covering that in the upcoming weeks btw. Anyhow I would rather recommend to run a bot on a local machine.

  • @mastercrypto9587
    @mastercrypto9587 2 роки тому +1

    hi bro
    what is this error:
    AttributeError: module 'asyncio' has no attribute 'create_task'

    • @Algovibes
      @Algovibes  2 роки тому

      stackoverflow.com/questions/53247533/attributeerror-module-asyncio-has-no-attribute-create-task