Тёмный

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

Algovibes
Подписаться 121 тыс.
Просмотров 1,1 млн
50% 1

Опубликовано:

 

29 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 967   
@Algovibes
@Algovibes 3 года назад
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: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-nQkaJ207xYI.html 2. The stream stops and something like "None in the columns" is popping up: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-OX5eDJDtqhc.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: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-8p240qonj0E.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: ru-vid.com/group/PL9ATnizYJ7f8_opOpLnekEZNsNVUVbCZN 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 года назад
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 года назад
this does not work for me: "asyncio.run() cannot be called from a running event loop"
@henrydikeman4223
@henrydikeman4223 3 года назад
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 года назад
Thanks a lot for your kind words man, I appreciate it. This is super important to me!
@antman7673
@antman7673 2 года назад
No 300% guaranteed daily return. This must be the snakes salesman.
@brazed420
@brazed420 3 года назад
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 года назад
That is awesome! 😄
@ua6919
@ua6919 3 года назад
Link please 😃
@brazed420
@brazed420 3 года назад
@@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 года назад
The fact that I just did the same makes me want to befriend you 🤣
@MRX_111
@MRX_111 2 года назад
How to place a future prepetual order using python
@amisaban
@amisaban Год назад
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 :-)
@alugunandan
@alugunandan 2 года назад
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 🇮🇳
@RafeedChowdhury
@RafeedChowdhury 3 года назад
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 года назад
It actually was a bad time to trade on that day :-D Anyhow thank you very much for your feedback and your support!
@kia4now
@kia4now 2 года назад
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 2 года назад
First of all thanks a lot for your kind words man! Secondly I already have content on these questions. Multiple symbols using BSM: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-C-SL4Tf25eg.html Multiple symbols using WebSocket and csv storage: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-mDNIAkEZChg.html Multiple symbols using WebSocket and SQL (also manual choice of buying as these are just signals) ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-8p240qonj0E.html Would be happy for a feedback below these videos! :-)
@kia4now
@kia4now 2 года назад
@@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?
@elinversordepastos3204
@elinversordepastos3204 6 месяцев назад
Excellent work, mate. TY VM
@Algovibes
@Algovibes 6 месяцев назад
Thx for matching my man
@akshaykumble540
@akshaykumble540 2 года назад
For your analytics, subscribed
@Algovibes
@Algovibes 2 года назад
Thanks buddy! :-)
@akshaykumble540
@akshaykumble540 2 года назад
@@Algovibes need your constant guidance as I've started algo few weeks back
@ricardoandresleongomez5267
@ricardoandresleongomez5267 2 года назад
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 2 года назад
Reason for the error is a queue overflow. I solved it here: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-OX5eDJDtqhc.html Would be awesome if you provide me a feedback if this approach is working out for you.
@wickedgummybear3104
@wickedgummybear3104 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 :-)
@sebiiopawesome8040
@sebiiopawesome8040 3 года назад
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 года назад
@@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
@mariogreco729
@mariogreco729 3 года назад
Liked and subscribed! Excellent work, thanks for sharing
@Algovibes
@Algovibes 3 года назад
Awesome, thanks a lot for subscribing! :-)
@chunchunmaru6832
@chunchunmaru6832 2 года назад
Thank you for the tutorial and knowledge sir !
@Algovibes
@Algovibes 2 года назад
Thanks for watching buddy :-)
@mohammedberrezoug8019
@mohammedberrezoug8019 3 года назад
Nice job and explanation, congrat, please continue.
@Algovibes
@Algovibes 3 года назад
Thanks for your feedback. Appreciate it :-)
@Kr3m3rsVids
@Kr3m3rsVids 3 года назад
Love the content on your channel, especially the crypto related stuff. Looking forward to see how you would apply TA to this live data. Thanks and keep up the good work!
@Algovibes
@Algovibes 3 года назад
Thank you very much for your kind words and your feedback :-) Appreciate it.
@RoWiseBites
@RoWiseBites 3 года назад
I love your video
@Algovibes
@Algovibes 3 года назад
Love you too for your positivity ❤️
@aaronsarinana1654
@aaronsarinana1654 2 года назад
do you have something similar but for stocks? Any broker which you can do the same? Coding in python to live trade stocks? I mostly interested in stocks rather than cryptos. Great channel.
@Algovibes
@Algovibes 2 года назад
Hi man, thank you very much for your kind words. I didn't cover live trading with stocks yet. Just backtesting stuff and designing trading strategies but no Deployment in the market. It is on my list but can't say when I will cover that.
@aaronsarinana1654
@aaronsarinana1654 2 года назад
@@Algovibes thanks man! Great job by the way!
@MaryBenedict1155
@MaryBenedict1155 Год назад
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 Год назад
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 Год назад
@@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 Год назад
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 Год назад
@@JohnHealy7153 You can reach him VIA
@donald.jacoby.94
@donald.jacoby.94 Год назад
*tele* *gram*
@user-zo1np4lh5u
@user-zo1np4lh5u 3 года назад
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 года назад
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?
@Oz_rhodes
@Oz_rhodes 3 года назад
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 года назад
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 года назад
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 года назад
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
@milanmeyer2059
@milanmeyer2059 3 года назад
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 года назад
Awesome to hear and also great career pick ;-)
@ololh4xx
@ololh4xx 3 года назад
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 года назад
"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: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-oyL99oa6gf8.html
@chijiokechidozie3602
@chijiokechidozie3602 3 года назад
@@milanmeyer2059 I have a better way of doing same.
@pushkarkushwah7376
@pushkarkushwah7376 3 года назад
German ❤️
@joelalarconbarrientos3843
@joelalarconbarrientos3843 2 года назад
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 года назад
Hey Joel, that's awesome to read. Thanks a lot for your comment and I am sending you my best regards to Chile!
@Davidjune1970
@Davidjune1970 3 года назад
And let’s see if we made a profit here ….. I no longer need my channel bye bye everyone
@Algovibes
@Algovibes 3 года назад
:D :D nice comment. Even if that would be the case I would probably continue with RU-vid. I love the platform and I am on this platform since I was a teenager.
@iambonmucho
@iambonmucho 3 года назад
Imagine you forgot to stop the script executing and you become accidentally a millionaire overnight.
@Algovibes
@Algovibes 3 года назад
: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.
@bruhhbruhh7717
@bruhhbruhh7717 2 года назад
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 2 года назад
Yep, please check this video to fix that: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-OX5eDJDtqhc.html And also check my pinned comment. I would be grateful if you give me feedback if this is working out for you!
@martingiannechini1
@martingiannechini1 2 года назад
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 2 года назад
Hi buddy, thanks a lot for your feedback. I already did that. Be invited to check out the cryptobot playlist.
@joshuasmith2450
@joshuasmith2450 2 года назад
isn't MACD proven to be unusable nowadays? At least on the stock market I believe it is due to automated trading funds saturating.
@stefanfredin7120
@stefanfredin7120 2 года назад
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 2 года назад
What an awesome comment. Thank you buddy.
@theWSt
@theWSt 2 года назад
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 :-)
@nolan2736
@nolan2736 3 года назад
Hi, to make sure I understood, we have to run the 'data fetch' script in parallel of the stragety script ?
@gabrielsanches9296
@gabrielsanches9296 3 года назад
Yeap
@Algovibes
@Algovibes 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!
@sayemmohammad6450
@sayemmohammad6450 3 года назад
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 года назад
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
@swansurt1350
@swansurt1350 Год назад
Hi, I had a doubt. When I tried running the script - I noticed that the values were queued up heavily. Even after 5 seconds the timestamps of the incoming data had only changed by a few micro seconds - Which means I was reading old data from the queue. So the data I'm working on isn't realtime. Is there any way to solve this?
@drywater7201
@drywater7201 Год назад
have the same problem
@swansurt1350
@swansurt1350 Год назад
@@drywater7201 I mnged to solve it by popping the queue till it was empty before reading the next value. But that's pretty inefficient I guess..
@anthonymanuel1808
@anthonymanuel1808 2 года назад
It makes sense, BTC and crypto is off helping to regulate, rather than pretend it won't ever happen. The big institutions getting in is the catalyst that will launch us into the stratosphere. Most people don't like change but after the change is made they grow used to it and it becomes a non issue usually because their fears never materialize. The projects that initiated the process of regulation have not been ruined, they got involved in setting guidelines and helping the regulators understand the crypto space. I’d get involved more knowing that I have made over 7 btc and 15ETH from day-trade with FLOYD J JOHNSON in few weeks....
@edwardnaika1259
@edwardnaika1259 2 года назад
Hi, I'm very new to this and firstly, thank you for the good work you are doing helping us find our feet in this arena. I've replicated your code and tried to run the strategy. I'm however, getting a 'Lot Size' related error (see snippet below), and cannot seem to get to the bottom of it. Did you ever encounter such an error and if yes, how did you go about resolving it? ... --> 324 raise BinanceAPIException(response, response.status_code, response.text) 325 try: 326 return response.json() BinanceAPIException: APIError(code=-1013): Filter failure: LOT_SIZE
@AlbertKitamirike
@AlbertKitamirike 2 года назад
@Algovibes @Algo Vibes
@Algovibes
@Algovibes 2 года назад
Hi Edward, thanks a lot for watching. That simply means that you don't pass a valid amount to trade. As an example min Lotsize for coin X would be 0.01. You cannot buy/sell 0.015 of that coin as the Lotsize is 0.01 and you can only trade in those steps (0.02 would be possible). BTW I have shown ways to get around Lotsizes e.g. in this video and also other videos in my cryptobot playlist. Videolink: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-FlL1X17sw8o.html
@patrickwalsh1154
@patrickwalsh1154 3 года назад
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 года назад
Hi buddy, thank you very much for your kind comment :-) Yes, I will and I partly already have. Be invited to check this out: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-nQkaJ207xYI.html
@slaxblake
@slaxblake 3 года назад
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 года назад
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 года назад
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?
@suthan2003
@suthan2003 3 года назад
Do you teach coding please?
@Algovibes
@Algovibes 3 года назад
Only on my channel. I have a Python Introduction playlist. Be kindly invited to check that out!
@jabetancur12
@jabetancur12 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 года назад
yes me too
@goldenbeast5160
@goldenbeast5160 3 года назад
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
@moade333
@moade333 3 года назад
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!
@BorsaTrader
@BorsaTrader 2 года назад
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 2 года назад
Not an engineer :D Anyhow: Thanks a lot for your kind words mate.
@someone-eo1zf
@someone-eo1zf 3 года назад
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 года назад
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 года назад
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: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-qCZiENV83rE.html In general the most important thing is to get started in my experience 😛
@dcode863
@dcode863 2 года назад
Lol then ur gonna have to start from scratch, learn python basics before doing something as in depth as this
@dawsonhayfield4421
@dawsonhayfield4421 2 года назад
Hello, when I try to use the socket manager, I get an error saying "SyntaxError: 'await' outside function" Do you know why this would be? This is specifically when trying to run await socket.__aenter__() msg = await socket.recv() print(msg) Thank you and great content
@MrTASGER
@MrTASGER 2 года назад
"await" must be in "async" function. learn asyncio or use 'jupyter notebook' like author. async def main(): await socket.__aenter__() msg = await socket.recv() print(msg) loop = asyncio.get_event_loop() loop.run_until_complete(main())
@Algovibes
@Algovibes 2 года назад
Thank you buddy. Please use this approach in case you have any more problems: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-OX5eDJDtqhc.html
@ludwigmatheus762
@ludwigmatheus762 2 года назад
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 2 года назад
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".
@ZonDhay
@ZonDhay 2 года назад
"await" allowed only within async function 4:38 ):
@Algovibes
@Algovibes 2 года назад
Yep. It's because you are not using Jupyter. Please check out this one: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-nQkaJ207xYI.html
@kelliclark2737
@kelliclark2737 2 года назад
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 года назад
Hi Kelli, appreciate both your positivity and your kind words. Be invited to check out the other videos in the cryptobot playlist: ru-vid.com/group/PL9ATnizYJ7f8_opOpLnekEZNsNVUVbCZN
@mycinemax2653
@mycinemax2653 2 года назад
Subbed, i want to learn to create my binance bot from this channel, what video i should start with? I dont know coding, but i can follow instructions. Can you recommending the videos from a to z? Edit: does this python bot thing creating a lot of data when active 24/7? Can I open multiple position ( something like dca up and dca down) a lot of questions haha..
@Algovibes
@Algovibes 2 года назад
Hi mate, thanks a lot for your subscription. Please be invited to check out the videos in the cryptobot playlist. Covering basically everything there. Let me know if you need any support!
@remi_20
@remi_20 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 года назад
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.
@noahpilkington9631
@noahpilkington9631 2 года назад
Is there a way so we don't have to trade any real money? I see on Binance that you have to deposit some funds to be able to get the API credientials. Secondly, would this program still run if I got the API key but withdraw my money so it's trading no real money?
@Algovibes
@Algovibes 2 года назад
Hi Noah, this is designed for real trades. You can use this script but need to find a way to store the buyprice and sellprice (maybe in a list/dataframe/csv/other sql table).
@themathsprofessor6962
@themathsprofessor6962 3 года назад
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 года назад
Thank you buddy! :-) You will be in some time for sure!
@ryanm7263
@ryanm7263 3 года назад
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
@danielfenollfreire3022
@danielfenollfreire3022 Год назад
Does anyone if the channels Discord is somewhat noob friendly? I'm struggling while going through the tutorials and am not sure if it's because I'm using now depreciated functions, or my own noobness
@Algovibes
@Algovibes Год назад
People from all skill levels are warmly welcome on the discord server! Looking forward to see you there.
@yohannescahyadi7670
@yohannescahyadi7670 3 года назад
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 года назад
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.
@mdsystem8026
@mdsystem8026 2 года назад
what you mean by strategy(0.001, 60, 0.001) I know that 60 for 60 second but what you mean by first 0.001 and last 0.001
@Algovibes
@Algovibes 2 года назад
Hi and sorry for my late reply, can you pass me a timestamp? Happy to clarify!
@Prrt-rq3ym
@Prrt-rq3ym Год назад
Passing the Sql client into pandas.read_sql will produce "AttributeError: 'OptionEngine' object has no attribute 'execute'", when you are using the latest version of sqlalchemy (2.0 or higher) to fix this either downgrade sqlalchemy or us a one time call like this: with engine.begin() as conn: df = pd.read_sql('BTCUSDT', con=conn)
@Hexaholic
@Hexaholic 3 года назад
To everyone, please stay away from bots/signals/courses because the vast majority of them are not even legal or actually using a concept that's working correctly.
@Algovibes
@Algovibes 3 года назад
Agreed. Please understand that I don't want to sell you anything - I just think the programming side of constructing those bots is very interesting. I always put in a disclaimer in the beginning of every video and actually showing I made bad trades (e.g. in the MACD case). Anyhow thank you for raising this necessary caution!
@Hexaholic
@Hexaholic 3 года назад
@@Algovibes my comment was not specific to you or anyone else, just a reminder for everyone to be careful because theres too much illegal stuff going on since it's very easy to get people to believe in it. I appreciate that you're atleast honest about it and a quick reminder for you is to really dig into if your disclaimer is enough, because from experience i know theres a lot that need to be mentioned! Just for your safety
@Algovibes
@Algovibes 3 года назад
@@Hexaholic Do you have a suggestion what you would like to find in the disclaimer? I really appreciate your answer!
@cuteypatootie
@cuteypatootie 3 года назад
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!
@ryanlovesyoukinda
@ryanlovesyoukinda 3 года назад
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 года назад
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.
@gicehajunior9154
@gicehajunior9154 Год назад
I would be more glad if you did this in node javascript. Oops, seems fun. Nice session!
@Algovibes
@Algovibes Год назад
Thanks mate. Happy to enjoyed :-)
@Kacisse
@Kacisse 3 года назад
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 года назад
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 года назад
Depending on the dataset size array will just explode your memory
@julianusiv
@julianusiv 3 года назад
@@gabrielceolato2 that and a database is persistent across runtimes, contrary to lists or arrays
@arorayugal
@arorayugal 3 года назад
You can store it in memory db too like memcached or redis, read/write will be slightly faster then sql
@MRX_111
@MRX_111 2 года назад
Will this bot auto trade(I mean buy crypto)even when my computer if switched off (means after closing python file)
@Algovibes
@Algovibes 2 года назад
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.
@roberto6698
@roberto6698 2 года назад
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 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?
@alananthony7762
@alananthony7762 Год назад
Do you think Spyder is safe to use for this purpose? Great content btw, liked and subscribed!
@Algovibes
@Algovibes Год назад
Thanks mate! :-) For Spyder you have to use a slightly different approach since the async is working differently. I think I covered that in the pinned comment somewhere. Hope that helps!
@sweetphilly2
@sweetphilly2 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?
@66255517
@66255517 2 года назад
hi, can u please help me why im getting an error saying "mandatory parameter time stamp not sent" . i am using a different code but I get this error can u please help
@Algovibes
@Algovibes 2 года назад
Well :D How can I if I don't know what you did?
@issarlk
@issarlk 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.
@mughalhouse9244
@mughalhouse9244 2 года назад
hello sir first of all bundles of thanks for this content but i have question i am unable to test binance api in this code you provided will you please explain me in miore detials
@Algovibes
@Algovibes 2 года назад
Thanks a lot mate, can you elaborate on your issue?
@tonymudau3005
@tonymudau3005 3 года назад
Amazing stuff... more content like this please!!
@Algovibes
@Algovibes 3 года назад
Thanks for your feedback mate, appreciate it!
@jackku7515
@jackku7515 2 года назад
Please continue launched more clips with tradingview and crypto binance.
@Algovibes
@Algovibes 2 года назад
Did some stuff on that but videos weren't performing at all. Sorry!
@oaomai
@oaomai Год назад
cumret😂😂 sorry mayeb im immature 29:40
@Algovibes
@Algovibes Год назад
lmao 😂 Well, keep up the inner child.
@ahmednishaal9432
@ahmednishaal9432 3 года назад
is there a way to open a demo binance account, which has fake money? for testing purposes only
@Algovibes
@Algovibes 2 года назад
Not 100% sure. I have heard about it. But what about testing the strategies without placing an order. So just append the profit to e.g. a list?
@elgrot4885
@elgrot4885 2 года назад
Hi, when i run the code for getting information about coin it goes as shown in video and I can even buy and sell crypto but after a while I'm getting an error: raise KeyError(f"None of [{key}] are in the [{axis_name}]") KeyError: "None of [Index(['s', 'E', 'p'], dtype='object')] are in the [columns]" Can someone help me with this?
@Algovibes
@Algovibes 2 года назад
Sure, I have answered that in the pinned comment below this video: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-OX5eDJDtqhc.html I recommend to check out my newer videos. I am showing way more convenient ways to live stream crypto data.
@stanislawlesniak6768
@stanislawlesniak6768 2 года назад
@@Algovibes Hello, I am getting the same error while using the recommendation in the provided link. I have just implemented the "if res" statement. I am getting "None of [Index(['s', 'E', 'p'], dtype='object')] are in the [columns]". Any other recommendations? Or have I simply implemented it wrong?
@VerzyCheez
@VerzyCheez 2 года назад
If I want bot works 24/7 should my computer be on?
@Algovibes
@Algovibes 2 года назад
24/7 needs some adjustments as the Binance livestream is disconnecting after exactly 24 hours. The recommended way is probably a Virtual machine. I will cover that kind of stuff in the future.
@yashakageyama4915
@yashakageyama4915 2 года назад
If i follow this video step by step would i end up in the same result.. also is it still usable up to know or this needs some update to use
@Algovibes
@Algovibes 2 года назад
Well it was just an example. This is surely not a ready to use product. But it will work in a technical way - yes.
@Importol
@Importol 2 года назад
Hello! Thank u for videos, very informative! I am new to sqlalchemy and sqlite, and was wondering how can I delete the previously aquired data from df. Started bot when btcusdt was 40k and these data seems to be from another world right now. Thnx in advance.
@Algovibes
@Algovibes 2 года назад
Thank you my man! Nice profile pic :D You can delete rows in a SQL DB by simply using the delete statement and then just get rid of those rows which are before a certain date.
@Importol
@Importol 2 года назад
:D thank you!
@ducocatch
@ducocatch 2 года назад
Your list of BTCUSDT information, updates every like 1.3 seconds. I tried to copy your work, and mine is sending info like 12 times a second, which seem to result in a bunch of errors. Any help or advise?
@Algovibes
@Algovibes 2 года назад
Could you please check out the approach shown in this video here? Also check out the pinned comment below the vid please. ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-OX5eDJDtqhc.html An alternative would be to use Websocket: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-8p240qonj0E.html BTW thanks a lot for watching.
@ducocatch
@ducocatch 2 года назад
@@Algovibes i just found the first video you send, the data now is coming through, but now, how to get it in the SQL stream?
@giggity2302
@giggity2302 3 года назад
Sana may kristocurrency narin para makaipon ng ligtas points 🤣🤣🤣
@Algovibes
@Algovibes 2 года назад
What is that language? :D
@segma.dev_
@segma.dev_ Год назад
Please can u make a video on how to create a binance bot trading using triangle arbitrage🙏
@Algovibes
@Algovibes Год назад
Thanks for the suggestion mate. Highly appreciated!
@TradingBantai
@TradingBantai 2 года назад
Sir how can we run multiple symbols in the programme Please help me out
@Algovibes
@Algovibes 2 года назад
Hi James, Please just check out the newer videos in the crypto bot playlist. I have covered multiple symbols in some videos. Thanks for watching :-)
@Christian_Ky
@Christian_Ky 3 года назад
@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 года назад
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.
@mertkacir9981
@mertkacir9981 2 года назад
Why i get the name error socket is not defined i literally wrote the same thing as you do.
@Algovibes
@Algovibes 2 года назад
Well double check if you have defined the socket variable :D
@gianlucamessina2231
@gianlucamessina2231 2 года назад
Great video. Don't forget to set open_position = False after selling
@Algovibes
@Algovibes 2 года назад
Thx a lot Gianluca!
@alexvillagrasa213
@alexvillagrasa213 3 года назад
Hi man, could we talk together private? Thanks
@alexvillagrasa213
@alexvillagrasa213 2 года назад
Where can I contact you? Thanks.
@arynum1
@arynum1 2 года назад
Thanks Buddy for the video. It is amazing. I am new to this subject. But definitely look forward to learn it. I want to trade in crypto I use binance app, can u share info how this bot technique be useful. Thanks in advance.
@toutduweb
@toutduweb Год назад
df = pd.read_sql('BTCBUSD', engine) ... why i have error ... ? -> 1901 cursor, statement, parameters, context
@Algovibes
@Algovibes Год назад
Need more elaboration on that please. Thanks a lot!
@gomotase8694
@gomotase8694 11 месяцев назад
great work sir...please the source codes links have expired
@Algovibes
@Algovibes 11 месяцев назад
Thanks mate!
@juandiegorodriguez7583
@juandiegorodriguez7583 2 года назад
11:00 I ran that code in my visual studio code and it works for 2 minutes and stop. You know why this happens?
@Receive_
@Receive_ 2 года назад
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!
@blasdelezo8396
@blasdelezo8396 2 года назад
What if instead of ask is a bid?. How to use the Ehlers transform ?
@Algovibes
@Algovibes 2 года назад
Can you elaborate?
@markostupar427
@markostupar427 2 года назад
Has anyone made money with this code and this bot? i want to make sure...
@Algovibes
@Algovibes 2 года назад
This video is showing the coding of a very simple trading strategy. As said in the video and in the pinned comment this is a tutorial and not a recommendation to trade this strategy.
@gurkii6725
@gurkii6725 3 года назад
ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-rc_Y6rdBqXM.html Hay, bei mir stimmt die Zeit nicht. In der ersten Sekunde stimmt die Zeit, danach kommt jede Sekunde ein Wert welcher nur etwa 0.2 Sekunden älter ist. Dadurch wird alles immer asynchroner.
@Algovibes
@Algovibes 3 года назад
Hi :-) Kannst du einmal den Weg im allerneusten Video abchecken ob das dein Problem löst? Danke dir: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-OX5eDJDtqhc.html
@inspiration2292
@inspiration2292 2 года назад
How about one video for the FTX Websocket as well?
@Algovibes
@Algovibes 2 года назад
I have FTX on my list as an alternative to binance. I am not quite sure if I cover the websocket in the first tutorial. Thanks for the suggestion tho :-)
@alchristianmabute1996
@alchristianmabute1996 2 года назад
it says await should be used inside async. What fix should be done?
@Algovibes
@Algovibes 2 года назад
Hi mate, its explained here: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-nQkaJ207xYI.html
@ismaelconde8457
@ismaelconde8457 2 года назад
Excellent video thanks so much. Very good content
@Algovibes
@Algovibes 2 года назад
Thanks a lot Ismael, Happy to read that!
@kt10uk
@kt10uk 2 года назад
Great video! Are you a data engineer for web3 company?
@Algovibes
@Algovibes 2 года назад
Thanks man, no I am working in DS.
@zaid20rajab
@zaid20rajab 2 года назад
Is it necessary to be a python programmer to be able to program a bot trading ?
@Algovibes
@Algovibes 2 года назад
There are frameworks to set up a trading bot without needing the programming knowledge but just in my opinion the possibilities of those frameworks are quite limited.
@alikadivar3168
@alikadivar3168 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 2 года назад
Hi mate, can you check the approach used in my more recent videos? Would appreciate a feedback.
@Lisaschuhe
@Lisaschuhe 2 года назад
The await comment in Line 6 doesnt work. it stucks on loading and nothing happens just "In [*]" the whole time
@Algovibes
@Algovibes 2 года назад
It is working. To help you out I need more background information. What exactly did you do and where did you deviate from my approach?
@Lisaschuhe
@Lisaschuhe 2 года назад
@@Algovibes so i did anything like you explained, but in line 6 with the aenter and await command, nothing happens. i run it and nothing happens. No error, no success, just stuck with a "*" in the [] if i try it in pycharm it says error "the await command is outside of a function"
@KevinLopezfr
@KevinLopezfr 2 года назад
Hi, thanks for sharing. I'm facing a problem regarding real time data retrieval. Nothing happens after await socket.__aenter__() msg = await socket.recv() print(msg). I've also tried the Asyncio part but that's the same... Any helps ? Cheers ;)
@Algovibes
@Algovibes 2 года назад
Hi mate, can you check my newest video? I have shown an alternative data stream approach there.
@krunkrun2103
@krunkrun2103 Год назад
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 Год назад
Hi buddy, thanks a lot. Check out this one, this is taking care of exactly that: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-n0d7kSGwskY.html You can also implement a sql import/export within this structure. Cheers!
@krunkrun2103
@krunkrun2103 Год назад
@@Algovibes thanks for reply mate. Let me check out the video in the link. Keep up ur work. Make unlimited money :-D
Далее
FATAL CHASE 😳 😳
00:19
Просмотров 1,4 млн
I Built a Trading Bot with ChatGPT
18:33
Просмотров 1,9 млн
I Analyzed My Finance With Local LLMs
17:51
Просмотров 482 тыс.
How to Code a AI Trading bot (so you can make $$$)
35:09
How I'd Learn AI in 2024 (if I could start over)
17:55